|
@@ -622,6 +622,31 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // 签单月份
|
|
|
|
|
+ Predicate<InsPlyIncome> signMonthPredicate = insPlyIncome ->{
|
|
|
|
|
+ if(!names.contains(IncomeDataVO.SearchVO.signMonth)){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ IncomeDataVO.SearchVO searchVO = searchVOMap.get(IncomeDataVO.SearchVO.signMonth);
|
|
|
|
|
+ String type = searchVO.getType();
|
|
|
|
|
+ String search = searchVO.getSearch();
|
|
|
|
|
+ if("为空".equals(type)|| "不为空".equals(type)){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StrUtil.isEmpty(search)){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if("等于".equalsIgnoreCase(type) || "包含".equalsIgnoreCase(type)){
|
|
|
|
|
+ List<String> signMonths = Arrays.asList(search.split(","));
|
|
|
|
|
+ return signMonths.contains(insPlyIncome.getSignMonth());
|
|
|
|
|
+ }
|
|
|
|
|
+ if("不等于".equalsIgnoreCase(type) || "不包含".equalsIgnoreCase(type)){
|
|
|
|
|
+ List<String> signMonths = Arrays.asList(search.split(","));
|
|
|
|
|
+ return !signMonths.contains(insPlyIncome.getSignMonth());
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 车牌号 licenseNo
|
|
// 车牌号 licenseNo
|
|
|
Predicate<InsPlyIncome> licenseNoPredicate = insPlyIncome -> {
|
|
Predicate<InsPlyIncome> licenseNoPredicate = insPlyIncome -> {
|
|
|
if(!names.contains(IncomeDataVO.SearchVO.licenseNo)){
|
|
if(!names.contains(IncomeDataVO.SearchVO.licenseNo)){
|
|
@@ -727,12 +752,12 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
if("and".equalsIgnoreCase(incomeDataVO.getLogicJudge())){
|
|
if("and".equalsIgnoreCase(incomeDataVO.getLogicJudge())){
|
|
|
Predicate<InsPlyIncome> and = companyIdPredicate.or(companySubIdPredicate).and(signDatePredicate).
|
|
Predicate<InsPlyIncome> and = companyIdPredicate.or(companySubIdPredicate).and(signDatePredicate).
|
|
|
and(ptlAgreementPredicate).and(orderTypePredicate).and(signYearPredicate).and(licenseNoPredicate)
|
|
and(ptlAgreementPredicate).and(orderTypePredicate).and(signYearPredicate).and(licenseNoPredicate)
|
|
|
- .and(contactPredicate).and(jqPolicyNoPredicate).and(syPolicyNoPredicate).and(jyPolicyNoPredicate);
|
|
|
|
|
|
|
+ .and(contactPredicate).and(jqPolicyNoPredicate).and(syPolicyNoPredicate).and(jyPolicyNoPredicate).and(signMonthPredicate);
|
|
|
filterIncomes = incomes.stream().filter(and).toList();
|
|
filterIncomes = incomes.stream().filter(and).toList();
|
|
|
}else if ("or".equalsIgnoreCase(incomeDataVO.getLogicJudge())){
|
|
}else if ("or".equalsIgnoreCase(incomeDataVO.getLogicJudge())){
|
|
|
Predicate<InsPlyIncome> or = companyIdPredicate.or(companySubIdPredicate).or(signDatePredicate).
|
|
Predicate<InsPlyIncome> or = companyIdPredicate.or(companySubIdPredicate).or(signDatePredicate).
|
|
|
or(ptlAgreementPredicate).or(orderTypePredicate).or(signYearPredicate).or(licenseNoPredicate)
|
|
or(ptlAgreementPredicate).or(orderTypePredicate).or(signYearPredicate).or(licenseNoPredicate)
|
|
|
- .or(contactPredicate).or(jqPolicyNoPredicate).or(syPolicyNoPredicate).or(jyPolicyNoPredicate);
|
|
|
|
|
|
|
+ .or(contactPredicate).or(jqPolicyNoPredicate).or(syPolicyNoPredicate).or(jyPolicyNoPredicate).or(signMonthPredicate);
|
|
|
filterIncomes = incomes.stream().filter(or).toList();
|
|
filterIncomes = incomes.stream().filter(or).toList();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2556,8 +2581,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
errrMsg.append("该批数据的保险机构为空. ");
|
|
errrMsg.append("该批数据的保险机构为空. ");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- errrMsg.append(this.validatePolicy(datas));
|
|
|
|
|
- errrMsg.append(this.validateProportion(datas));
|
|
|
|
|
|
|
+ errrMsg.append(this.validatePolicy(datas, type));
|
|
|
|
|
+ errrMsg.append(this.validateProportion(datas, type));
|
|
|
return errrMsg.toString();
|
|
return errrMsg.toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2567,7 +2592,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
* @author lipf
|
|
* @author lipf
|
|
|
* @date 2026/8/20 10:35
|
|
* @date 2026/8/20 10:35
|
|
|
*/
|
|
*/
|
|
|
- private String validatePolicy(List<ImportContentExt> datas) {
|
|
|
|
|
|
|
+ private String validatePolicy(List<ImportContentExt> datas, String type) {
|
|
|
StringBuilder errrMsg = new StringBuilder();
|
|
StringBuilder errrMsg = new StringBuilder();
|
|
|
for (ImportContentExt data : datas) {
|
|
for (ImportContentExt data : datas) {
|
|
|
boolean all = false;
|
|
boolean all = false;
|
|
@@ -2575,36 +2600,60 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
boolean sy = false;
|
|
boolean sy = false;
|
|
|
boolean jy = false;
|
|
boolean jy = false;
|
|
|
InsOrdersPolicy insOrdersPolicy = data.getInsOrdersPolicy();
|
|
InsOrdersPolicy insOrdersPolicy = data.getInsOrdersPolicy();
|
|
|
- if(insOrdersPolicy == null){
|
|
|
|
|
|
|
+ if (insOrdersPolicy == null) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- if(!Objects.equals(insOrdersPolicy.getJqPolicyNo(), data.getJqPolicyNo())){
|
|
|
|
|
- all = true;
|
|
|
|
|
- jq = true;
|
|
|
|
|
- }
|
|
|
|
|
- if(!Objects.equals(insOrdersPolicy.getSyPolicyNo(), data.getSyPolicyNo())){
|
|
|
|
|
- all = true;
|
|
|
|
|
- sy = true;
|
|
|
|
|
- }
|
|
|
|
|
- if(!Objects.equals(insOrdersPolicy.getJyPolicyNo(), data.getJyPolicyNo())){
|
|
|
|
|
- all = true;
|
|
|
|
|
- jy = true;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // type=20:全部校验;type=11:仅交强、商业险;type=12:仅驾意险
|
|
|
|
|
+ if ("20".equals(type)) {
|
|
|
|
|
+ // 全部校验:交强、商业、驾意
|
|
|
|
|
+ if (!Objects.equals(insOrdersPolicy.getJqPolicyNo(), data.getJqPolicyNo())) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jq = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Objects.equals(insOrdersPolicy.getSyPolicyNo(), data.getSyPolicyNo())) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ sy = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Objects.equals(insOrdersPolicy.getJyPolicyNo(), data.getJyPolicyNo())) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jy = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if ("11".equals(type)) {
|
|
|
|
|
+ // 只校验交强、商业险保单号
|
|
|
|
|
+ if (!Objects.equals(insOrdersPolicy.getJqPolicyNo(), data.getJqPolicyNo())) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jq = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Objects.equals(insOrdersPolicy.getSyPolicyNo(), data.getSyPolicyNo())) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ sy = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if ("12".equals(type)) {
|
|
|
|
|
+ // 只校验驾意险保单号
|
|
|
|
|
+ if (!Objects.equals(insOrdersPolicy.getJyPolicyNo(), data.getJyPolicyNo())) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jy = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- if(all){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (all) {
|
|
|
errrMsg.append("车牌号为[").append(data.getLicenseNo()).append("]的保单号不一致: ");
|
|
errrMsg.append("车牌号为[").append(data.getLicenseNo()).append("]的保单号不一致: ");
|
|
|
- if(jq){
|
|
|
|
|
|
|
+ if (jq) {
|
|
|
errrMsg.append("交强险保单号不一致. 应收数据的交强险保单号是[").append(insOrdersPolicy.getJqPolicyNo()).append("].excel维护的交强险保单号是[").append(data.getJqPolicyNo()).append("].");
|
|
errrMsg.append("交强险保单号不一致. 应收数据的交强险保单号是[").append(insOrdersPolicy.getJqPolicyNo()).append("].excel维护的交强险保单号是[").append(data.getJqPolicyNo()).append("].");
|
|
|
}
|
|
}
|
|
|
- if(sy){
|
|
|
|
|
|
|
+ if (sy) {
|
|
|
errrMsg.append("商业险保单号不一致. 应收数据的商业险保单号是[").append(insOrdersPolicy.getSyPolicyNo()).append("].excel维护的商业险保单号是[").append(data.getSyPolicyNo()).append("].");
|
|
errrMsg.append("商业险保单号不一致. 应收数据的商业险保单号是[").append(insOrdersPolicy.getSyPolicyNo()).append("].excel维护的商业险保单号是[").append(data.getSyPolicyNo()).append("].");
|
|
|
}
|
|
}
|
|
|
- if(jy){
|
|
|
|
|
|
|
+ if (jy) {
|
|
|
errrMsg.append("驾意险保单号不一致. 应收数据的驾意险保单号是[").append(insOrdersPolicy.getJyPolicyNo()).append("].excel维护的驾意险保单号是[").append(data.getJyPolicyNo()).append("].");
|
|
errrMsg.append("驾意险保单号不一致. 应收数据的驾意险保单号是[").append(insOrdersPolicy.getJyPolicyNo()).append("].excel维护的驾意险保单号是[").append(data.getJyPolicyNo()).append("].");
|
|
|
}
|
|
}
|
|
|
|
|
+ errrMsg.append(";");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return errrMsg.toString();
|
|
return errrMsg.toString();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 校验应收比例
|
|
* 校验应收比例
|
|
|
*
|
|
*
|
|
@@ -2612,7 +2661,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
* @author lipf
|
|
* @author lipf
|
|
|
* @date 2026/8/20 10:27
|
|
* @date 2026/8/20 10:27
|
|
|
*/
|
|
*/
|
|
|
- private static String validateProportion(List<ImportContentExt> datas) {
|
|
|
|
|
|
|
+ private String validateProportion(List<ImportContentExt> datas, String type) {
|
|
|
StringBuilder errrMsg = new StringBuilder();
|
|
StringBuilder errrMsg = new StringBuilder();
|
|
|
for (ImportContentExt data : datas) {
|
|
for (ImportContentExt data : datas) {
|
|
|
boolean all = false;
|
|
boolean all = false;
|
|
@@ -2620,45 +2669,113 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
boolean sy = false;
|
|
boolean sy = false;
|
|
|
boolean jy = false;
|
|
boolean jy = false;
|
|
|
InsPlyIncome insPlyIncome = data.getInsPlyIncome();
|
|
InsPlyIncome insPlyIncome = data.getInsPlyIncome();
|
|
|
- if(insPlyIncome == null){
|
|
|
|
|
|
|
+ if (insPlyIncome == null) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- String jqadd = BigDecimalUtil.add(insPlyIncome.getJqSuperviseCostsProportion(), insPlyIncome.getJqOtherCostsProportion());
|
|
|
|
|
- BigDecimal jqsubtract = BigDecimalUtil.subtract(new BigDecimal(jqadd), new BigDecimal(data.getJqInletRatio()));
|
|
|
|
|
- if(BigDecimal.ZERO.compareTo(jqsubtract) != 0){
|
|
|
|
|
- all = true;
|
|
|
|
|
- jq = true;
|
|
|
|
|
- }
|
|
|
|
|
- String syadd = BigDecimalUtil.add(insPlyIncome.getSySuperviseCostsProportion(), insPlyIncome.getSyOtherCostsProportion());
|
|
|
|
|
- BigDecimal sysubtract = BigDecimalUtil.subtract(new BigDecimal(syadd), new BigDecimal(data.getSyInletRatio()));
|
|
|
|
|
- if(BigDecimal.ZERO.compareTo(sysubtract) != 0){
|
|
|
|
|
- all = true;
|
|
|
|
|
- sy = true;
|
|
|
|
|
- }
|
|
|
|
|
- String jyadd = BigDecimalUtil.add(insPlyIncome.getJySuperviseCostsProportion(), insPlyIncome.getJyOtherCostsProportion());
|
|
|
|
|
- BigDecimal jysubtract = BigDecimalUtil.subtract(new BigDecimal(jyadd), new BigDecimal(data.getJyInletRatio()));
|
|
|
|
|
- if(BigDecimal.ZERO.compareTo(jysubtract) != 0){
|
|
|
|
|
- all = true;
|
|
|
|
|
- jy = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- if(all){
|
|
|
|
|
- errrMsg.append("车牌号为").append(data.getLicenseNo()).append("的导入记录中,");
|
|
|
|
|
- if(jq){
|
|
|
|
|
- errrMsg.append("交强险入口比例异常. 应收数据的交强险入口比例是[").append(jqadd).append("].excel维护的交强险入口比例是[").append(data.getJqInletRatio()).append("].");
|
|
|
|
|
|
|
+ if ("20".equals(type)) {
|
|
|
|
|
+ // 平台协议校验比例
|
|
|
|
|
+ String jqadd = BigDecimalUtil.add(insPlyIncome.getJqSuperviseCostsProportion(), insPlyIncome.getJqOtherCostsProportion());
|
|
|
|
|
+ String jqInletRatioStr = data.getJqInletRatio();
|
|
|
|
|
+ if (jqadd == null || jqInletRatioStr == null) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jq = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ BigDecimal jqsubtract = BigDecimalUtil.subtract(new BigDecimal(jqadd), new BigDecimal(jqInletRatioStr));
|
|
|
|
|
+ if (BigDecimal.ZERO.compareTo(jqsubtract) != 0) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jq = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String syadd = BigDecimalUtil.add(insPlyIncome.getSySuperviseCostsProportion(), insPlyIncome.getSyOtherCostsProportion());
|
|
|
|
|
+ String syInletRatioStr = data.getSyInletRatio();
|
|
|
|
|
+ if (syadd == null || syInletRatioStr == null) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ sy = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ BigDecimal sysubtract = BigDecimalUtil.subtract(new BigDecimal(syadd), new BigDecimal(syInletRatioStr));
|
|
|
|
|
+ if (BigDecimal.ZERO.compareTo(sysubtract) != 0) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ sy = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String jyadd = BigDecimalUtil.add(insPlyIncome.getJySuperviseCostsProportion(), insPlyIncome.getJyOtherCostsProportion());
|
|
|
|
|
+ String jyInletRatioStr = data.getJyInletRatio();
|
|
|
|
|
+ if (jyadd == null || jyInletRatioStr == null) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jy = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ BigDecimal jysubtract = BigDecimalUtil.subtract(new BigDecimal(jyadd), new BigDecimal(jyInletRatioStr));
|
|
|
|
|
+ if (BigDecimal.ZERO.compareTo(jysubtract) != 0) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jy = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (all) {
|
|
|
|
|
+ errrMsg.append("车牌号为").append(data.getLicenseNo()).append("的导入记录中,");
|
|
|
|
|
+ if (jq) {
|
|
|
|
|
+ errrMsg.append("交强险入口比例异常. 应收数据的交强险入口比例是[").append(jqadd).append("].excel维护的交强险入口比例是[").append(jqInletRatioStr).append("].");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sy) {
|
|
|
|
|
+ errrMsg.append("商业险入口比例异常.应收数据的商业险入口比例是[").append(syadd).append("].excel维护的商业险入口比例是[").append(syInletRatioStr).append("].");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (jy) {
|
|
|
|
|
+ errrMsg.append("驾意险入口比例异常.应收数据的驾意险入口比例是[").append(jyadd).append("].excel维护的驾意险入口比例是[").append(jyInletRatioStr).append("].");
|
|
|
|
|
+ }
|
|
|
|
|
+ errrMsg.append(";");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if ("11".equals(type)) {
|
|
|
|
|
+ // 私有协议校验比例
|
|
|
|
|
+ String jqDb = insPlyIncome.getJqSuperviseCostsProportion();
|
|
|
|
|
+ BigDecimal jqExcel = data.getJqSuperviseCostsProportion();
|
|
|
|
|
+ // compareTo判等,同时判空
|
|
|
|
|
+ if (!(StrUtil.isNotBlank(jqDb) && jqExcel != null && BigDecimalUtil.valueOf(jqDb).compareTo(jqExcel) == 0)) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jq = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String syDb = insPlyIncome.getSySuperviseCostsProportion();
|
|
|
|
|
+ BigDecimal syExcel = data.getSySuperviseCostsProportion();
|
|
|
|
|
+ if (!(StrUtil.isNotBlank(syDb) && syExcel != null && BigDecimalUtil.valueOf(syDb).compareTo(syExcel) == 0)) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ sy = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (all) {
|
|
|
|
|
+ errrMsg.append("车牌号为").append(data.getLicenseNo()).append("的导入记录中,");
|
|
|
|
|
+ if (jq) {
|
|
|
|
|
+ errrMsg.append("交强险手续费比例异常. 应收数据的交强险手续费比例是[").append(jqDb).append("].excel维护的交强险手续费比例是[").append(jqExcel).append("].");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sy) {
|
|
|
|
|
+ errrMsg.append("商业险手续费比例异常.应收数据的商业险手续费比例是[").append(syDb).append("].excel维护的商业险手续费比例是[").append(syExcel).append("].");
|
|
|
|
|
+ }
|
|
|
|
|
+ errrMsg.append(";");
|
|
|
}
|
|
}
|
|
|
- if(sy){
|
|
|
|
|
- errrMsg.append("商业险入口比例异常.应收数据的商业险入口比例是[").append(syadd).append("].excel维护的商业险入口比例是[").append(data.getSyInletRatio()).append("].");
|
|
|
|
|
|
|
+ } else if ("12".equals(type)) {
|
|
|
|
|
+ // 非车私有协议校验比例
|
|
|
|
|
+ String jyDb = insPlyIncome.getJySuperviseCostsProportion();
|
|
|
|
|
+ BigDecimal jyExcel = data.getJySuperviseCostsProportion();
|
|
|
|
|
+ if (!(StrUtil.isNotBlank(jyDb) && jyExcel != null && BigDecimalUtil.valueOf(jyDb).compareTo(jyExcel) == 0)) {
|
|
|
|
|
+ all = true;
|
|
|
|
|
+ jy = true;
|
|
|
}
|
|
}
|
|
|
- if(jy){
|
|
|
|
|
- errrMsg.append("驾意险入口比例异常.应收数据的驾意险入口比例是[").append(jyadd).append("].excel维护的驾意险入口比例是[").append(data.getJyInletRatio()).append("].");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (all) {
|
|
|
|
|
+ errrMsg.append("车牌号为").append(data.getLicenseNo()).append("的导入记录中,");
|
|
|
|
|
+ if (jy) {
|
|
|
|
|
+ errrMsg.append("驾意险手续费比例异常. 应收数据的驾意险手续费比例是[").append(jyDb).append("].excel维护的驾意险手续费比例是[").append(jyExcel).append("].");
|
|
|
|
|
+ }
|
|
|
|
|
+ errrMsg.append(";");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return errrMsg.toString();
|
|
return errrMsg.toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 解析Excel内容并填充缺失的字段
|
|
* 解析Excel内容并填充缺失的字段
|
|
|
*
|
|
*
|
|
@@ -6107,8 +6224,18 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
Function<CompanySuperviseSettlementReportDto, String> getter) {
|
|
Function<CompanySuperviseSettlementReportDto, String> getter) {
|
|
|
return list.stream()
|
|
return list.stream()
|
|
|
.map(getter)
|
|
.map(getter)
|
|
|
|
|
+ // 自定义安全转换,失败返回null
|
|
|
|
|
+ .map(val -> {
|
|
|
|
|
+ if (!StrUtil.isNotBlank(val)) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ return new BigDecimal(val.trim());
|
|
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
.filter(Objects::nonNull)
|
|
.filter(Objects::nonNull)
|
|
|
- .map(BigDecimal::new)
|
|
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
.toString();
|
|
.toString();
|
|
|
}
|
|
}
|