分月统计优化
parent
bef5ae36a1
commit
da3f51b4a0
|
@ -0,0 +1,80 @@
|
||||||
|
package cn.palmte.work.bean;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 损益表数据
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProfitAndLossBean {
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业收入
|
||||||
|
*/
|
||||||
|
private BigDecimal income;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业成本
|
||||||
|
*/
|
||||||
|
private BigDecimal cost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目管理成本
|
||||||
|
*/
|
||||||
|
private BigDecimal manageCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他
|
||||||
|
*/
|
||||||
|
private BigDecimal other;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 财务费用
|
||||||
|
*/
|
||||||
|
private BigDecimal expropriation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目毛利
|
||||||
|
*/
|
||||||
|
private BigDecimal grossProfit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目毛利率
|
||||||
|
*/
|
||||||
|
private BigDecimal grossProfitProfit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司管理费用
|
||||||
|
*/
|
||||||
|
private BigDecimal CompanyManage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目贡献利润
|
||||||
|
*/
|
||||||
|
private BigDecimal contributionMargin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目贡献利润率
|
||||||
|
*/
|
||||||
|
private BigDecimal contributionMarginProfit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所得税费用
|
||||||
|
*/
|
||||||
|
private BigDecimal incomeTax;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目净利润
|
||||||
|
*/
|
||||||
|
private BigDecimal netMargin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目净利润率
|
||||||
|
*/
|
||||||
|
private BigDecimal netMarginProfit;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package cn.palmte.work.bean;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StatisticsBean {
|
||||||
|
|
||||||
|
private List<PrimaryIndicatorBean> primaryIndicatorBeanList;
|
||||||
|
|
||||||
|
private List<ProfitAndLossBean> profitAndLossBeanList;
|
||||||
|
|
||||||
|
private List<CashFlowStatisticsBean> cashFlowStatisticsBeanList;
|
||||||
|
|
||||||
|
}
|
|
@ -66,6 +66,8 @@ public class ProjectController extends BaseController {
|
||||||
private ProjectSettleService projectSettleService;
|
private ProjectSettleService projectSettleService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProcurementTypeService procurementTypeService;
|
private ProcurementTypeService procurementTypeService;
|
||||||
|
@Autowired
|
||||||
|
private ProjectSettleIncomeRepository projectSettleIncomeRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目列表
|
* 项目列表
|
||||||
|
@ -335,7 +337,6 @@ public class ProjectController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/approve")
|
@RequestMapping("/approve")
|
||||||
public String approve(@RequestParam("id") int id, @RequestParam String listFrom, Map<String, Object> model) {
|
public String approve(@RequestParam("id") int id, @RequestParam String listFrom, Map<String, Object> model) {
|
||||||
String time = "2021-11";
|
|
||||||
Project project = projectService.getProject(id);
|
Project project = projectService.getProject(id);
|
||||||
|
|
||||||
//项目信息
|
//项目信息
|
||||||
|
@ -367,10 +368,17 @@ public class ProjectController extends BaseController {
|
||||||
model.put("cashFlowBean", projectBudgetService.getCashFlowBean(project, projectBudgetPlanDetails));
|
model.put("cashFlowBean", projectBudgetService.getCashFlowBean(project, projectBudgetPlanDetails));
|
||||||
|
|
||||||
//结算信息
|
//结算信息
|
||||||
|
ProjectSettleIncome projectSettleIncome = projectSettleIncomeRepository.findNewByProjectId(id);
|
||||||
|
String time = "";
|
||||||
|
if(null == projectSettleIncome){
|
||||||
|
model.put("time", time);
|
||||||
|
}else {
|
||||||
|
time = projectSettleIncome.getTime();
|
||||||
|
model.put("time", time);
|
||||||
|
}
|
||||||
model.put("formerBean", projectSettleService.getFormerSettle(project, time));
|
model.put("formerBean", projectSettleService.getFormerSettle(project, time));
|
||||||
model.put("monthBean", projectSettleService.getMonthSettle(project, time));
|
model.put("monthBean", projectSettleService.getMonthSettle(project, time));
|
||||||
model.put("currentBean", projectSettleService.getCurrentSettle(project, time));
|
model.put("currentBean", projectSettleService.getCurrentSettle(project, time));
|
||||||
model.put("time", time);
|
|
||||||
|
|
||||||
//决算信息
|
//决算信息
|
||||||
model.put("finalBean", projectFinalSevice.getFinal(project));
|
model.put("finalBean", projectFinalSevice.getFinal(project));
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.palmte.work.controller.backend;
|
||||||
|
|
||||||
import cn.palmte.work.bean.CashFlowStatisticsBean;
|
import cn.palmte.work.bean.CashFlowStatisticsBean;
|
||||||
import cn.palmte.work.bean.PrimaryIndicatorBean;
|
import cn.palmte.work.bean.PrimaryIndicatorBean;
|
||||||
|
import cn.palmte.work.bean.StatisticsBean;
|
||||||
import cn.palmte.work.service.StatisticsService;
|
import cn.palmte.work.service.StatisticsService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -19,10 +20,10 @@ public class StatisticsController extends BaseController{
|
||||||
|
|
||||||
@RequestMapping("/month")
|
@RequestMapping("/month")
|
||||||
public String month(Map<String, Object> model){
|
public String month(Map<String, Object> model){
|
||||||
List<PrimaryIndicatorBean> primaryIndicatorList = statisticsService.getPrimaryIndicator();
|
StatisticsBean statisticsData = statisticsService.getStatisticsData();
|
||||||
List<CashFlowStatisticsBean> cashFlowList = statisticsService.getCashFlow();
|
model.put("primaryIndicatorList",statisticsData.getPrimaryIndicatorBeanList());
|
||||||
model.put("primaryIndicatorList",primaryIndicatorList);
|
model.put("profitAndLossList",statisticsData.getProfitAndLossBeanList());
|
||||||
model.put("cashFlowList",cashFlowList);
|
model.put("cashFlowList",statisticsData.getCashFlowStatisticsBeanList());
|
||||||
return "admin/month_statistics";
|
return "admin/month_statistics";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,17 @@ public class ProjectSettleProfitMargin {
|
||||||
@Column(name = "budget")
|
@Column(name = "budget")
|
||||||
private BigDecimal budget;
|
private BigDecimal budget;
|
||||||
|
|
||||||
|
@Column(name = "profit_margin")
|
||||||
|
private BigDecimal profitMargin;
|
||||||
|
|
||||||
|
public BigDecimal getProfitMargin() {
|
||||||
|
return profitMargin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProfitMargin(BigDecimal profitMargin) {
|
||||||
|
this.profitMargin = profitMargin;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package cn.palmte.work.service;
|
||||||
|
|
||||||
import cn.palmte.work.bean.CashFlowStatisticsBean;
|
import cn.palmte.work.bean.CashFlowStatisticsBean;
|
||||||
import cn.palmte.work.bean.PrimaryIndicatorBean;
|
import cn.palmte.work.bean.PrimaryIndicatorBean;
|
||||||
|
import cn.palmte.work.bean.ProfitAndLossBean;
|
||||||
|
import cn.palmte.work.bean.StatisticsBean;
|
||||||
import cn.palmte.work.model.*;
|
import cn.palmte.work.model.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -38,15 +40,26 @@ public class StatisticsService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectSettleCashFlowRepository projectSettleCashFlowRepository;
|
private ProjectSettleCashFlowRepository projectSettleCashFlowRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProjectSettleProfitMarginRepository projectSettleProfitMarginRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分月项目统计 获取主要指标数据
|
* 分月项目统计 获取主要指标数据、损益表
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<PrimaryIndicatorBean> getPrimaryIndicator() {
|
public StatisticsBean getStatisticsData() {
|
||||||
|
StatisticsBean statisticsBean = new StatisticsBean();
|
||||||
List<PrimaryIndicatorBean> list = new ArrayList<>();
|
List<PrimaryIndicatorBean> list = new ArrayList<>();
|
||||||
|
List<ProfitAndLossBean> profitAndLossList = new ArrayList<>();
|
||||||
|
|
||||||
PrimaryIndicatorBean include = new PrimaryIndicatorBean();
|
PrimaryIndicatorBean include = new PrimaryIndicatorBean();
|
||||||
PrimaryIndicatorBean exclude = new PrimaryIndicatorBean();
|
PrimaryIndicatorBean exclude = new PrimaryIndicatorBean();
|
||||||
|
|
||||||
|
ProfitAndLossBean profitAndLossBeanInclude = new ProfitAndLossBean();
|
||||||
|
ProfitAndLossBean profitAndLossBeanExclude = new ProfitAndLossBean();
|
||||||
|
profitAndLossBeanInclude.setTitle("预算金额(含税)");
|
||||||
|
profitAndLossBeanExclude.setTitle("预算金额(不含税)");
|
||||||
include.setTitle("预算金额(含税)");
|
include.setTitle("预算金额(含税)");
|
||||||
exclude.setTitle("预算金额(不含税)");
|
exclude.setTitle("预算金额(不含税)");
|
||||||
//收入数据
|
//收入数据
|
||||||
|
@ -68,6 +81,10 @@ public class StatisticsService {
|
||||||
exclude.setIncomeEngineer(engineerIncomeTaxExcludeSum);
|
exclude.setIncomeEngineer(engineerIncomeTaxExcludeSum);
|
||||||
exclude.setIncomeService(serviceIncomeTaxExcludeSum);
|
exclude.setIncomeService(serviceIncomeTaxExcludeSum);
|
||||||
|
|
||||||
|
BigDecimal incomeInclude = allIncome.stream().map(ProjectBudgetIncome::getIncomeTaxInclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
profitAndLossBeanInclude.setIncome(incomeInclude);
|
||||||
|
BigDecimal incomeExclude = allIncome.stream().map(ProjectBudgetIncome::getIncomeTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
profitAndLossBeanExclude.setIncome(incomeExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
//成本数据
|
//成本数据
|
||||||
|
@ -101,6 +118,18 @@ public class StatisticsService {
|
||||||
exclude.setCostPurchaseOther(otherCostTaxExcludeSum);
|
exclude.setCostPurchaseOther(otherCostTaxExcludeSum);
|
||||||
exclude.setCostProjectManage(projectManageCostTaxExcludeSum);
|
exclude.setCostProjectManage(projectManageCostTaxExcludeSum);
|
||||||
exclude.setCostOtherOther(otherOtherCostTaxExcludeSum);
|
exclude.setCostOtherOther(otherOtherCostTaxExcludeSum);
|
||||||
|
|
||||||
|
BigDecimal costInclude = allCost.stream().filter(d -> d.getType() == ProjectBudgetCost.TYPE_DEVICE || d.getType() == ProjectBudgetCost.TYPE_BUILDING || d.getType() == ProjectBudgetCost.TYPE_SERVICE).map(ProjectBudgetCost::getCostTaxInclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal costExclude = allCost.stream().filter(d -> d.getType() == ProjectBudgetCost.TYPE_DEVICE || d.getType() == ProjectBudgetCost.TYPE_BUILDING || d.getType() == ProjectBudgetCost.TYPE_SERVICE).map(ProjectBudgetCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
profitAndLossBeanInclude.setCost(costInclude);
|
||||||
|
profitAndLossBeanInclude.setManageCost(projectManageCostTaxIncludeSum);
|
||||||
|
profitAndLossBeanInclude.setOther(otherCostTaxIncludeSum.add(otherOtherCostTaxIncludeSum));
|
||||||
|
|
||||||
|
profitAndLossBeanExclude.setCost(costExclude);
|
||||||
|
profitAndLossBeanInclude.setManageCost(projectManageCostTaxExcludeSum);
|
||||||
|
profitAndLossBeanExclude.setOther(otherCostTaxExcludeSum.add(otherOtherCostTaxExcludeSum));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//管理成本数据
|
//管理成本数据
|
||||||
|
@ -111,13 +140,20 @@ public class StatisticsService {
|
||||||
|
|
||||||
exclude.setCostExpropriation(expropriationSum);
|
exclude.setCostExpropriation(expropriationSum);
|
||||||
exclude.setCostCompanyManage(companyManageSum);
|
exclude.setCostCompanyManage(companyManageSum);
|
||||||
|
|
||||||
|
profitAndLossBeanExclude.setExpropriation(expropriationSum);
|
||||||
|
profitAndLossBeanExclude.setCompanyManage(companyManageSum);
|
||||||
}
|
}
|
||||||
|
|
||||||
list.add(include);
|
list.add(include);
|
||||||
list.add(exclude);
|
list.add(exclude);
|
||||||
|
profitAndLossList.add(profitAndLossBeanInclude);
|
||||||
|
profitAndLossList.add(profitAndLossBeanExclude);
|
||||||
|
|
||||||
PrimaryIndicatorBean allSettle = new PrimaryIndicatorBean();
|
PrimaryIndicatorBean allSettle = new PrimaryIndicatorBean();
|
||||||
|
ProfitAndLossBean allProfitAndLoss = new ProfitAndLossBean();
|
||||||
allSettle.setTitle("实际累计(不含税)");
|
allSettle.setTitle("实际累计(不含税)");
|
||||||
|
allProfitAndLoss.setTitle("实际累计(不含税)");
|
||||||
|
|
||||||
List<ProjectSettleIncome> allSettleIncome = projectSettleIncomeRepository.findAll();
|
List<ProjectSettleIncome> allSettleIncome = projectSettleIncomeRepository.findAll();
|
||||||
if (CollectionUtil.isNotEmpty(allSettleIncome)) {
|
if (CollectionUtil.isNotEmpty(allSettleIncome)) {
|
||||||
|
@ -128,6 +164,9 @@ public class StatisticsService {
|
||||||
allSettle.setIncomeDevice(incomeDeviceAll);
|
allSettle.setIncomeDevice(incomeDeviceAll);
|
||||||
allSettle.setIncomeEngineer(incomeEngineerAll);
|
allSettle.setIncomeEngineer(incomeEngineerAll);
|
||||||
allSettle.setIncomeService(incomeServiceAll);
|
allSettle.setIncomeService(incomeServiceAll);
|
||||||
|
|
||||||
|
BigDecimal incomeExclude = allSettleIncome.stream().map(ProjectSettleIncome::getIncomeTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
allProfitAndLoss.setIncome(incomeExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ProjectSettleCost> allSettleCost = projectSettleCostRepository.findAll();
|
List<ProjectSettleCost> allSettleCost = projectSettleCostRepository.findAll();
|
||||||
|
@ -145,6 +184,12 @@ public class StatisticsService {
|
||||||
allSettle.setCostPurchaseOther(costOtherAll);
|
allSettle.setCostPurchaseOther(costOtherAll);
|
||||||
allSettle.setCostProjectManage(costProjectManageAll);
|
allSettle.setCostProjectManage(costProjectManageAll);
|
||||||
allSettle.setCostOtherOther(costOtherOtherAll);
|
allSettle.setCostOtherOther(costOtherOtherAll);
|
||||||
|
|
||||||
|
BigDecimal cost = allSettleCost.stream().filter(d -> d.getType() == ProjectSettleCost.TYPE_DEVICE || d.getType() == ProjectSettleCost.TYPE_BUILDING || d.getType() == ProjectSettleCost.TYPE_SERVICE).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
allProfitAndLoss.setCost(cost);
|
||||||
|
allProfitAndLoss.setManageCost(costProjectManageAll);
|
||||||
|
allProfitAndLoss.setOther(costOtherAll.add(costOtherOtherAll));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ProjectSettleCostManage> allSettleCostManage = projectSettleCostManageRepository.findAll();
|
List<ProjectSettleCostManage> allSettleCostManage = projectSettleCostManageRepository.findAll();
|
||||||
|
@ -154,15 +199,33 @@ public class StatisticsService {
|
||||||
|
|
||||||
allSettle.setCostExpropriation(expropriationAll);
|
allSettle.setCostExpropriation(expropriationAll);
|
||||||
allSettle.setCostCompanyManage(companyManageAll);
|
allSettle.setCostCompanyManage(companyManageAll);
|
||||||
|
|
||||||
|
allProfitAndLoss.setExpropriation(expropriationAll);
|
||||||
|
allProfitAndLoss.setCompanyManage(companyManageAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<ProjectSettleProfitMargin> profitMargins = projectSettleProfitMarginRepository.findAll();
|
||||||
|
if(CollectionUtil.isNotEmpty(profitMargins)){
|
||||||
|
BigDecimal typeGrossProfit = profitMargins.stream().filter(d -> d.getType() == ProjectSettleProfitMargin.TYPE_GROSS_PROFIT).map(ProjectSettleProfitMargin::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal typeContributionProfit = profitMargins.stream().filter(d -> d.getType() == ProjectSettleProfitMargin.TYPE_CONTRIBUTION_PROFIT).map(ProjectSettleProfitMargin::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal typeNetProfit = profitMargins.stream().filter(d -> d.getType() == ProjectSettleProfitMargin.TYPE_NET_PROFIT).map(ProjectSettleProfitMargin::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
allProfitAndLoss.setGrossProfit(typeGrossProfit);
|
||||||
|
allProfitAndLoss.setContributionMargin(typeContributionProfit);
|
||||||
|
allProfitAndLoss.setNetMargin(typeNetProfit);
|
||||||
|
}
|
||||||
|
|
||||||
list.add(allSettle);
|
list.add(allSettle);
|
||||||
|
profitAndLossList.add(allProfitAndLoss);
|
||||||
|
|
||||||
List<String> projectTime = projectSettleIncomeRepository.getProjectTime();
|
List<String> projectTime = projectSettleIncomeRepository.getProjectTime();
|
||||||
if (CollectionUtil.isNotEmpty(projectTime)) {
|
if (CollectionUtil.isNotEmpty(projectTime)) {
|
||||||
for (String time : projectTime) {
|
for (String time : projectTime) {
|
||||||
|
|
||||||
PrimaryIndicatorBean primaryIndicatorBean = new PrimaryIndicatorBean();
|
PrimaryIndicatorBean primaryIndicatorBean = new PrimaryIndicatorBean();
|
||||||
|
ProfitAndLossBean profitAndLossBean = new ProfitAndLossBean();
|
||||||
primaryIndicatorBean.setTitle(time);
|
primaryIndicatorBean.setTitle(time);
|
||||||
|
profitAndLossBean.setTitle(time);
|
||||||
|
|
||||||
BigDecimal incomeDevice = allSettleIncome.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleIncome.TYPE_DEVICE).map(ProjectSettleIncome::getIncomeTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal incomeDevice = allSettleIncome.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleIncome.TYPE_DEVICE).map(ProjectSettleIncome::getIncomeTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
BigDecimal incomeEngineer = allSettleIncome.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleIncome.TYPE_ENGINEER).map(ProjectSettleIncome::getIncomeTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal incomeEngineer = allSettleIncome.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleIncome.TYPE_ENGINEER).map(ProjectSettleIncome::getIncomeTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
@ -172,6 +235,9 @@ public class StatisticsService {
|
||||||
primaryIndicatorBean.setIncomeEngineer(incomeEngineer);
|
primaryIndicatorBean.setIncomeEngineer(incomeEngineer);
|
||||||
primaryIndicatorBean.setIncomeService(incomeService);
|
primaryIndicatorBean.setIncomeService(incomeService);
|
||||||
|
|
||||||
|
BigDecimal income = allSettleIncome.stream().filter(d -> d.getTime().equals(time)).map(ProjectSettleIncome::getIncomeTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
profitAndLossBean.setIncome(income);
|
||||||
|
|
||||||
BigDecimal costDevice = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_DEVICE).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal costDevice = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_DEVICE).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
BigDecimal costBuilding = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_BUILDING).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal costBuilding = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_BUILDING).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
BigDecimal costService = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_SERVICE).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal costService = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_SERVICE).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
@ -179,7 +245,6 @@ public class StatisticsService {
|
||||||
BigDecimal costProjectManage = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_PROJECT_MANAGE).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal costProjectManage = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_PROJECT_MANAGE).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
BigDecimal costOtherOther = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_OTHER_OTHER).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal costOtherOther = allSettleCost.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCost.TYPE_OTHER_OTHER).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
|
||||||
primaryIndicatorBean.setCostPurchaseDevice(costDevice);
|
primaryIndicatorBean.setCostPurchaseDevice(costDevice);
|
||||||
primaryIndicatorBean.setCostPurchaseBuild(costBuilding);
|
primaryIndicatorBean.setCostPurchaseBuild(costBuilding);
|
||||||
primaryIndicatorBean.setCostPurchaseService(costService);
|
primaryIndicatorBean.setCostPurchaseService(costService);
|
||||||
|
@ -187,28 +252,39 @@ public class StatisticsService {
|
||||||
primaryIndicatorBean.setCostProjectManage(costProjectManage);
|
primaryIndicatorBean.setCostProjectManage(costProjectManage);
|
||||||
primaryIndicatorBean.setCostOtherOther(costOtherOther);
|
primaryIndicatorBean.setCostOtherOther(costOtherOther);
|
||||||
|
|
||||||
|
BigDecimal cost = allSettleCost.stream().filter(d -> d.getTime().equals(time) && (d.getType() == ProjectSettleCost.TYPE_DEVICE || d.getType() == ProjectSettleCost.TYPE_BUILDING || d.getType() == ProjectSettleCost.TYPE_SERVICE)).map(ProjectSettleCost::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
profitAndLossBean.setCost(cost);
|
||||||
|
profitAndLossBean.setManageCost(costProjectManage);
|
||||||
|
profitAndLossBean.setOther(costOther.add(costOtherOther));
|
||||||
|
|
||||||
BigDecimal expropriation = allSettleCostManage.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCostManage.TYPE_EXPROPRIATION).map(ProjectSettleCostManage::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal expropriation = allSettleCostManage.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCostManage.TYPE_EXPROPRIATION).map(ProjectSettleCostManage::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
BigDecimal companyManage = allSettleCostManage.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCostManage.TYPE_COMPANY_MANAGE).map(ProjectSettleCostManage::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal companyManage = allSettleCostManage.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleCostManage.TYPE_COMPANY_MANAGE).map(ProjectSettleCostManage::getCostTaxExclude).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
primaryIndicatorBean.setCostExpropriation(expropriation);
|
primaryIndicatorBean.setCostExpropriation(expropriation);
|
||||||
primaryIndicatorBean.setCostCompanyManage(companyManage);
|
primaryIndicatorBean.setCostCompanyManage(companyManage);
|
||||||
|
|
||||||
|
profitAndLossBean.setExpropriation(expropriation);
|
||||||
|
profitAndLossBean.setCompanyManage(companyManage);
|
||||||
|
|
||||||
|
BigDecimal typeGrossProfit = profitMargins.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleProfitMargin.TYPE_GROSS_PROFIT).map(ProjectSettleProfitMargin::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal typeContributionProfit = profitMargins.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleProfitMargin.TYPE_CONTRIBUTION_PROFIT).map(ProjectSettleProfitMargin::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal typeNetProfit = profitMargins.stream().filter(d -> d.getTime().equals(time) && d.getType() == ProjectSettleProfitMargin.TYPE_NET_PROFIT).map(ProjectSettleProfitMargin::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
profitAndLossBean.setGrossProfit(typeGrossProfit);
|
||||||
|
profitAndLossBean.setContributionMargin(typeContributionProfit);
|
||||||
|
profitAndLossBean.setNetMargin(typeNetProfit);
|
||||||
|
|
||||||
list.add(primaryIndicatorBean);
|
list.add(primaryIndicatorBean);
|
||||||
|
profitAndLossList.add(profitAndLossBean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
List<CashFlowStatisticsBean> cashFlow = getCashFlow();
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
statisticsBean.setPrimaryIndicatorBeanList(list);
|
||||||
* 分月项目统计 获取损益表数据
|
statisticsBean.setProfitAndLossBeanList(profitAndLossList);
|
||||||
*
|
statisticsBean.setCashFlowStatisticsBeanList(cashFlow);
|
||||||
* @return
|
return statisticsBean;
|
||||||
*/
|
|
||||||
public List getIncomeStatement() {
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -84,24 +84,23 @@
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<#if (cashFlowList)?exists && (cashFlowList?size>0)>
|
<#if (profitAndLossList)?exists && (profitAndLossList?size>0)>
|
||||||
<#list cashFlowList as list>
|
<#list profitAndLossList as list>
|
||||||
<tr>
|
<tr>
|
||||||
<td>${list.title!}</td>
|
<td>${list.title!}</td>
|
||||||
<td>${list.saleIncomeCash!}</td>
|
<td>${(list.cost!0)?string("0.##")}</td>
|
||||||
<td>${list.taxReturn!}</td>
|
<td>${(list.income!0)?string("0.##")}</td>
|
||||||
<td>${list.earnestMoneyIncome!}</td>
|
<td>${(list.manageCost!0)?string("0.##")}</td>
|
||||||
<td>${list.purchaseCost!}</td>
|
<td>${(list.other!0)?string("0.##")}</td>
|
||||||
<td>${list.taxCost!}</td>
|
<td>${(list.expropriation!0)?string("0.##")}</td>
|
||||||
<td>${list.earnestMoneyCost!}</td>
|
<td>${(list.grossProfit!0)?string("0.##")}</td>
|
||||||
<td>${list.netCashFlow!}</td>
|
<td>${(list.grossProfitProfit!0)?string("0.##")}</td>
|
||||||
<td>${list.cashInflowFromInvestingActivities!}</td>
|
<td>${(list.companyManage!0)?string("0.##")}</td>
|
||||||
<td>${list.cashOutflowFromInvestingActivities!}</td>
|
<td>${(list.contributionMargin!0)?string("0.##")}</td>
|
||||||
<td>${list.netCashFromInvestingActivities!}</td>
|
<td>${(list.contributionMarginProfit!0)?string("0.##")}</td>
|
||||||
<td>${list.financingCapitalInflow!}</td>
|
<td>${(list.incomeTax!0)?string("0.##")}</td>
|
||||||
<td>${list.financingCapitalOutflow!}</td>
|
<td>${(list.netMargin!0)?string("0.##")}</td>
|
||||||
<td>${list.financingCapitalCashflow!}</td>
|
<td>${(list.netMarginProfit!0)?string("0.##")}</td>
|
||||||
<td>${list.netIncreaseMonetaryFunds!}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</#list>
|
</#list>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
Loading…
Reference in New Issue