Merge remote-tracking branch 'origin/master'

master
xxssyyyyssxx 2021-12-13 18:13:13 +08:00
commit 497d99ad2b
2 changed files with 9 additions and 1 deletions

View File

@ -283,9 +283,17 @@ public class StatisticsService {
BigDecimal typeContributionProfit = profitMargins.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleProfitMargin.TYPE_CONTRIBUTION_PROFIT).map(ProjectSettleProfitMargin::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal typeNetProfit = profitMargins.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleProfitMargin.TYPE_NET_PROFIT).map(ProjectSettleProfitMargin::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal divide2 = profitAndLossBean.getIncome();
BigDecimal min = BigDecimal.valueOf(0.01);
if (divide2.compareTo(min) < 0) {
divide2 = BigDecimal.valueOf(1);
}
profitAndLossBean.setGrossProfit(typeGrossProfit);
profitAndLossBean.setGrossProfitProfit(profitAndLossBean.getGrossProfit().multiply(new BigDecimal(100)).divide(divide2, 4, BigDecimal.ROUND_HALF_UP));
profitAndLossBean.setContributionMargin(typeContributionProfit);
profitAndLossBean.setContributionMarginProfit(profitAndLossBean.getContributionMargin().multiply(new BigDecimal(100)).divide(divide2, 4, BigDecimal.ROUND_HALF_UP));
profitAndLossBean.setNetMargin(typeNetProfit);
profitAndLossBean.setNetMarginProfit(profitAndLossBean.getNetMargin().multiply(new BigDecimal(100)).divide(divide2, 4, BigDecimal.ROUND_HALF_UP));
list.add(primaryIndicatorBean);
profitAndLossList.add(profitAndLossBean);

View File

@ -88,8 +88,8 @@
<#list profitAndLossList as list>
<tr>
<td>${list.title!}</td>
<td>${(list.cost!0)?string("0.##")}</td>
<td>${(list.income!0)?string("0.##")}</td>
<td>${(list.cost!0)?string("0.##")}</td>
<td>${(list.manageCost!0)?string("0.##")}</td>
<td>${(list.other!0)?string("0.##")}</td>
<td>${(list.expropriation!0)?string("0.##")}</td>