|
@@ -700,9 +700,17 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
for (BusinessAgentData record : records) {
|
|
for (BusinessAgentData record : records) {
|
|
|
this.appendName(record);
|
|
this.appendName(record);
|
|
|
//新增毛利润率 毛利润/成本(出口费用)
|
|
//新增毛利润率 毛利润/成本(出口费用)
|
|
|
- BigDecimal grossMarginBD = record.getDistributionAmount().divide(record.getExportAllFee(), 4, RoundingMode.HALF_UP); //毛利润率
|
|
|
|
|
- DecimalFormat decimalFormat = new DecimalFormat("0.00%");
|
|
|
|
|
- String grossMargin = decimalFormat.format(grossMarginBD);
|
|
|
|
|
|
|
+ String grossMargin = "0.00%";
|
|
|
|
|
+ BigDecimal zreo = new BigDecimal("0");
|
|
|
|
|
+ BigDecimal distributionAmount = record.getDistributionAmount();
|
|
|
|
|
+ BigDecimal exportAllFee = record.getExportAllFee();
|
|
|
|
|
+ if (distributionAmount.compareTo(zreo) > 0 && exportAllFee.compareTo(zreo) > 0) {
|
|
|
|
|
+ BigDecimal grossMarginBD = distributionAmount.divide(exportAllFee, 4, RoundingMode.HALF_UP); //毛利润率
|
|
|
|
|
+ DecimalFormat decimalFormat = new DecimalFormat("0.00%");
|
|
|
|
|
+ grossMargin = decimalFormat.format(grossMarginBD);
|
|
|
|
|
+ } else if (distributionAmount.compareTo(zreo) > 0 && exportAllFee.compareTo(zreo) == 0) {
|
|
|
|
|
+ grossMargin = "100.00%";
|
|
|
|
|
+ }
|
|
|
record.setGrossMargin(grossMargin);
|
|
record.setGrossMargin(grossMargin);
|
|
|
}
|
|
}
|
|
|
Long total = this.taskStatisticsMapper.getBusinessAgentDataTotal(taskStatisticsVo);
|
|
Long total = this.taskStatisticsMapper.getBusinessAgentDataTotal(taskStatisticsVo);
|