利润率计算
parent
020eaf80cb
commit
597142b9ed
|
@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MonthlySettleService {
|
public class MonthlySettleService {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(MonthlySettleController.class);
|
private static final Logger logger = LoggerFactory.getLogger(MonthlySettleService.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MonthlySettleRepository monthlySettleRepository;
|
private MonthlySettleRepository monthlySettleRepository;
|
||||||
|
|
|
@ -4,16 +4,20 @@ import cn.palmte.work.bean.BudgetBean;
|
||||||
import cn.palmte.work.bean.CashFlowBean;
|
import cn.palmte.work.bean.CashFlowBean;
|
||||||
import cn.palmte.work.bean.FormerBean;
|
import cn.palmte.work.bean.FormerBean;
|
||||||
import cn.palmte.work.bean.SettleBean;
|
import cn.palmte.work.bean.SettleBean;
|
||||||
|
import cn.palmte.work.service.MonthlySettleService;
|
||||||
import cn.palmte.work.utils.Utils;
|
import cn.palmte.work.utils.Utils;
|
||||||
import org.apache.poi.hssf.util.HSSFColor;
|
import org.apache.poi.hssf.util.HSSFColor;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
public class ExportSettleExcelUtils {
|
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) {
|
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.setCellStyle(style2);
|
||||||
sixthCell.setCellType(CellType.NUMERIC);
|
sixthCell.setCellType(CellType.NUMERIC);
|
||||||
if (currentBean.getIncomeTotalTaxExclude().abs().compareTo(BigDecimal.valueOf(0.01)) > 0) {
|
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 {
|
} else {
|
||||||
sixthCell.setCellValue(Utils.format(currentBean.getGrossProfit().multiply(new BigDecimal(100))));
|
sixthCell.setCellValue(Utils.format(currentBean.getGrossProfit().multiply(new BigDecimal(100))));
|
||||||
}
|
}
|
||||||
|
@ -731,7 +735,7 @@ public class ExportSettleExcelUtils {
|
||||||
sixthCell.setCellStyle(style2);
|
sixthCell.setCellStyle(style2);
|
||||||
sixthCell.setCellType(CellType.NUMERIC);
|
sixthCell.setCellType(CellType.NUMERIC);
|
||||||
if (currentBean.getIncomeTotalTaxExclude().abs().compareTo(BigDecimal.valueOf(0.01)) > 0) {
|
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 {
|
} else {
|
||||||
sixthCell.setCellValue(Utils.format(currentBean.getContributionProfit().multiply(new BigDecimal(100))));
|
sixthCell.setCellValue(Utils.format(currentBean.getContributionProfit().multiply(new BigDecimal(100))));
|
||||||
}
|
}
|
||||||
|
@ -775,12 +779,12 @@ public class ExportSettleExcelUtils {
|
||||||
Cell sixthCell = row.createCell(5);
|
Cell sixthCell = row.createCell(5);
|
||||||
sixthCell.setCellStyle(style2);
|
sixthCell.setCellStyle(style2);
|
||||||
sixthCell.setCellType(CellType.NUMERIC);
|
sixthCell.setCellType(CellType.NUMERIC);
|
||||||
// if (currentBean.getIncomeTotalTaxExclude().abs().compareTo(BigDecimal.valueOf(0.01)) > 0) {
|
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 {
|
} else {
|
||||||
//
|
sixthCell.setCellValue(Utils.format(currentBean.getNetProfitMargin().multiply(new BigDecimal(100))));
|
||||||
// }
|
}
|
||||||
sixthCell.setCellValue(Utils.format(currentBean.getNetProfitMargin()));
|
// sixthCell.setCellValue(Utils.format(currentBean.getNetProfitMargin()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue