利润率计算

master
OathK1per 2022-08-19 17:19:16 +08:00
parent 020eaf80cb
commit 597142b9ed
2 changed files with 13 additions and 9 deletions

View File

@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentHashMap;
*/
@Service
public class MonthlySettleService {
private static final Logger logger = LoggerFactory.getLogger(MonthlySettleController.class);
private static final Logger logger = LoggerFactory.getLogger(MonthlySettleService.class);
@Autowired
private MonthlySettleRepository monthlySettleRepository;

View File

@ -4,16 +4,20 @@ import cn.palmte.work.bean.BudgetBean;
import cn.palmte.work.bean.CashFlowBean;
import cn.palmte.work.bean.FormerBean;
import cn.palmte.work.bean.SettleBean;
import cn.palmte.work.service.MonthlySettleService;
import cn.palmte.work.utils.Utils;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletOutputStream;
import java.math.BigDecimal;
public class ExportSettleExcelUtils {
private static final Logger logger = LoggerFactory.getLogger(ExportSettleExcelUtils.class);
public void exportSettleExcel(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean formerBean, SettleBean settleBean, FormerBean currentBean, int rowIndex, String sheetName, ServletOutputStream outputStream, String otherName, XSSFWorkbook workbook, CellStyle style, CellStyle style2) {
// 遍历集合数据,产生数据行
@ -686,7 +690,7 @@ public class ExportSettleExcelUtils {
sixthCell.setCellStyle(style2);
sixthCell.setCellType(CellType.NUMERIC);
if (currentBean.getIncomeTotalTaxExclude().abs().compareTo(BigDecimal.valueOf(0.01)) > 0) {
sixthCell.setCellValue(Utils.format(currentBean.getGrossProfit().multiply(new BigDecimal(100)).divide(currentBean.getIncomeTotalTaxExclude())));
sixthCell.setCellValue(Utils.format(currentBean.getGrossProfit().multiply(new BigDecimal(100)).divide(currentBean.getIncomeTotalTaxExclude(), BigDecimal.ROUND_CEILING)));
} else {
sixthCell.setCellValue(Utils.format(currentBean.getGrossProfit().multiply(new BigDecimal(100))));
}
@ -731,7 +735,7 @@ public class ExportSettleExcelUtils {
sixthCell.setCellStyle(style2);
sixthCell.setCellType(CellType.NUMERIC);
if (currentBean.getIncomeTotalTaxExclude().abs().compareTo(BigDecimal.valueOf(0.01)) > 0) {
sixthCell.setCellValue(Utils.format(currentBean.getContributionProfit().multiply(new BigDecimal(100)).divide(currentBean.getIncomeTotalTaxExclude())));
sixthCell.setCellValue(Utils.format(currentBean.getContributionProfit().multiply(new BigDecimal(100)).divide(currentBean.getIncomeTotalTaxExclude(), BigDecimal.ROUND_CEILING)));
} else {
sixthCell.setCellValue(Utils.format(currentBean.getContributionProfit().multiply(new BigDecimal(100))));
}
@ -775,12 +779,12 @@ public class ExportSettleExcelUtils {
Cell sixthCell = row.createCell(5);
sixthCell.setCellStyle(style2);
sixthCell.setCellType(CellType.NUMERIC);
// if (currentBean.getIncomeTotalTaxExclude().abs().compareTo(BigDecimal.valueOf(0.01)) > 0) {
//
// } else {
//
// }
sixthCell.setCellValue(Utils.format(currentBean.getNetProfitMargin()));
if (currentBean.getIncomeTotalTaxExclude().abs().compareTo(BigDecimal.valueOf(0.01)) > 0) {
sixthCell.setCellValue(Utils.format(currentBean.getNetProfitMargin().multiply(new BigDecimal(100)).divide(currentBean.getIncomeTotalTaxExclude(), BigDecimal.ROUND_CEILING)));
} else {
sixthCell.setCellValue(Utils.format(currentBean.getNetProfitMargin().multiply(new BigDecimal(100))));
}
// sixthCell.setCellValue(Utils.format(currentBean.getNetProfitMargin()));
}