Commit f92bcf9a by zhouhaibao

[+]毛利额返回问题

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