|
@@ -2,6 +2,7 @@ package org.springblade.manager.vo;
|
|
|
|
|
|
import com.alibaba.fastjson.annotation.JSONField;
|
|
|
import lombok.Data;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springblade.core.tool.utils.StringPool;
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
@@ -82,17 +83,18 @@ public class SubprojectInterimPaymentSummary {
|
|
|
public SubprojectInterimPaymentSummary() {
|
|
|
}
|
|
|
|
|
|
- public void count( @NotNull Consumer<String> setting ,@NotNull List<SubprojectInterimPaymentSummary> data, @NotNull Function<SubprojectInterimPaymentSummary,String> fc){
|
|
|
- setting.accept(data.stream().map(e->new BigDecimal(fc.apply(e))).reduce(BigDecimal.ZERO,BigDecimal::add).setScale(1, RoundingMode.HALF_UP).toString());
|
|
|
+ public void count( @NotNull Consumer<String> setting ,@NotNull List<SubprojectInterimPaymentSummary> data, @NotNull Function<SubprojectInterimPaymentSummary,String> fc,@NotNull Integer scale){
|
|
|
+ setting.accept(data.stream().map(e->new BigDecimal(fc.apply(e))).reduce(BigDecimal.ZERO,BigDecimal::add).setScale(scale, RoundingMode.HALF_UP).toString());
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void calculate(List<SubprojectInterimPaymentSummary> data){
|
|
|
+ public void calculate(List<SubprojectInterimPaymentSummary> data,Integer scale){
|
|
|
if(data!=null&&data.size()>0){
|
|
|
+
|
|
|
/*本次支付*/
|
|
|
- count(this::setCurrentPeriodPay,data,SubprojectInterimPaymentSummary::getCurrentPeriodPay);
|
|
|
+ count(this::setCurrentPeriodPay,data,SubprojectInterimPaymentSummary::getCurrentPeriodPay,scale);
|
|
|
/*本次累计支付*/
|
|
|
- count(this::setCurrentPeriodEndPay,data,SubprojectInterimPaymentSummary::getCurrentPeriodEndPay);
|
|
|
+ count(this::setCurrentPeriodEndPay,data,SubprojectInterimPaymentSummary::getCurrentPeriodEndPay,scale);
|
|
|
}
|
|
|
}
|
|
|
}
|