Commit f92bcf9a by zhouhaibao

[+]毛利额返回问题

1 parent 8fdc2774
...@@ -595,8 +595,7 @@ public class BusinessAnalysisService { ...@@ -595,8 +595,7 @@ public class BusinessAnalysisService {
// 计算店均产值 // 计算店均产值
BigDecimal avgOutput = totalOutput.multiply(BigDecimal.valueOf(100)) BigDecimal avgOutput = totalOutput.divide(BigDecimal.valueOf(storeNumber), 2, RoundingMode.HALF_UP);
.divide(BigDecimal.valueOf(storeNumber), 2, RoundingMode.HALF_UP);
resp.setAvgOutput(avgOutput); resp.setAvgOutput(avgOutput);
// 门店占比 // 门店占比
...@@ -1955,13 +1954,14 @@ public class BusinessAnalysisService { ...@@ -1955,13 +1954,14 @@ public class BusinessAnalysisService {
if (checkSearchType(cycleType)) { if (checkSearchType(cycleType)) {
profit = integerBigDecimalMap.get(sceneType) == null ? BigDecimal.ZERO profit = integerBigDecimalMap.get(sceneType) == null ? BigDecimal.ZERO
: integerBigDecimalMap.get(sceneType); : integerBigDecimalMap.get(sceneType);
}
// 毛利率 = 毛利额 / 产值(避免除零) // 毛利率 = 毛利额 / 产值(避免除零)
BigDecimal margin = BigDecimal.ZERO; BigDecimal margin = BigDecimal.ZERO;
if (sceneOutput.compareTo(BigDecimal.ZERO) > 0) { if (sceneOutput.compareTo(BigDecimal.ZERO) > 0) {
margin = profit.divide(sceneOutput, 4, RoundingMode.HALF_UP); margin = profit.divide(sceneOutput, 4, RoundingMode.HALF_UP);
} }
detail.setProfitMargin(margin); detail.setProfitMargin(margin);
}
return detail; return detail;
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!