利润率计算
parent
020eaf80cb
commit
597142b9ed
|
@ -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;
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue