fourcal/src/main/java/cn/palmte/work/service/StatisticsService.java

122 lines
5.3 KiB
Java
Raw Normal View History

2021-11-17 02:42:56 +00:00
package cn.palmte.work.service;
import cn.palmte.work.bean.PrimaryIndicatorBean;
import cn.palmte.work.model.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
2021-11-18 02:35:10 +00:00
import java.math.BigDecimal;
2021-11-17 02:42:56 +00:00
import java.util.ArrayList;
import java.util.List;
@Service
public class StatisticsService {
@Autowired
private ProjectBudgetCostRepository projectBudgetCostRepository;
@Autowired
private ProjectBudgetIncomeRepository projectBudgetIncomeRepository;
@Autowired
private ProjectBudgetCostManageRepository projectBudgetCostManageRepository;
/**
*
*
* @return
*/
public List<PrimaryIndicatorBean> getPrimaryIndicator() {
List<PrimaryIndicatorBean> list = new ArrayList<>();
PrimaryIndicatorBean include = new PrimaryIndicatorBean();
include.setTitle("预算金额(含税)");
//收入数据
2021-11-18 02:35:10 +00:00
BigDecimal deviceIncomeTaxIncludeSum = projectBudgetIncomeRepository.incomeTaxIncludeSum(ProjectBudgetIncome.TYPE_DEVICE);
BigDecimal engineerIncomeTaxIncludeSum = projectBudgetIncomeRepository.incomeTaxIncludeSum(ProjectBudgetIncome.TYPE_ENGINEER);
BigDecimal serviceIncomeTaxIncludeSum = projectBudgetIncomeRepository.incomeTaxIncludeSum(ProjectBudgetIncome.TYPE_SERVICE);
2021-11-17 02:42:56 +00:00
include.setIncomeDevice(deviceIncomeTaxIncludeSum);
include.setIncomeEngineer(engineerIncomeTaxIncludeSum);
include.setIncomeService(serviceIncomeTaxIncludeSum);
//成本
2021-11-18 02:35:10 +00:00
BigDecimal deviceCostTaxIncludeSum = projectBudgetCostRepository.costTaxIncludeSum(ProjectBudgetCost.TYPE_DEVICE);
BigDecimal buildingCostTaxIncludeSum = projectBudgetCostRepository.costTaxIncludeSum(ProjectBudgetCost.TYPE_BUILDING);
BigDecimal serviceCostTaxIncludeSum = projectBudgetCostRepository.costTaxIncludeSum(ProjectBudgetCost.TYPE_SERVICE);
BigDecimal otherCostTaxIncludeSum = projectBudgetCostRepository.costTaxIncludeSum(ProjectBudgetCost.TYPE_OTHER);
BigDecimal projectManageCostTaxIncludeSum = projectBudgetCostRepository.costTaxIncludeSum(ProjectBudgetCost.TYPE_PROJECT_MANAGE);
BigDecimal otherOtherCostTaxIncludeSum = projectBudgetCostRepository.costTaxIncludeSum(ProjectBudgetCost.TYPE_OTHER_OTHER);
2021-11-17 02:42:56 +00:00
include.setCostPurchaseDevice(deviceCostTaxIncludeSum);
include.setCostPurchaseBuild(buildingCostTaxIncludeSum);
include.setCostPurchaseService(serviceCostTaxIncludeSum);
include.setCostPurchaseOther(otherCostTaxIncludeSum);
include.setCostProjectManage(projectManageCostTaxIncludeSum);
include.setCostOtherOther(otherOtherCostTaxIncludeSum);
list.add(include);
PrimaryIndicatorBean exclude = new PrimaryIndicatorBean();
exclude.setTitle("预算金额(不含税)");
//收入数据
2021-11-18 02:35:10 +00:00
BigDecimal deviceIncomeTaxExcludeSum = projectBudgetIncomeRepository.incomeTaxExcludeSum(ProjectBudgetIncome.TYPE_DEVICE);
BigDecimal engineerIncomeTaxExcludeSum = projectBudgetIncomeRepository.incomeTaxExcludeSum(ProjectBudgetIncome.TYPE_ENGINEER);
BigDecimal serviceIncomeTaxExcludeSum = projectBudgetIncomeRepository.incomeTaxExcludeSum(ProjectBudgetIncome.TYPE_SERVICE);
2021-11-17 02:42:56 +00:00
exclude.setIncomeDevice(deviceIncomeTaxExcludeSum);
exclude.setIncomeEngineer(engineerIncomeTaxExcludeSum);
exclude.setIncomeService(serviceIncomeTaxExcludeSum);
//成本
2021-11-18 02:35:10 +00:00
BigDecimal deviceCostTaxExcludeSum = projectBudgetCostRepository.costTaxExcludeSum(ProjectBudgetCost.TYPE_DEVICE);
BigDecimal buildingCostTaxExcludeSum = projectBudgetCostRepository.costTaxExcludeSum(ProjectBudgetCost.TYPE_BUILDING);
BigDecimal serviceCostTaxExcludeSum = projectBudgetCostRepository.costTaxExcludeSum(ProjectBudgetCost.TYPE_SERVICE);
BigDecimal otherCostTaxExcludeSum = projectBudgetCostRepository.costTaxExcludeSum(ProjectBudgetCost.TYPE_OTHER);
BigDecimal projectManageCostTaxExcludeSum = projectBudgetCostRepository.costTaxExcludeSum(ProjectBudgetCost.TYPE_PROJECT_MANAGE);
BigDecimal otherOtherCostTaxExcludeSum = projectBudgetCostRepository.costTaxExcludeSum(ProjectBudgetCost.TYPE_OTHER_OTHER);
2021-11-17 02:42:56 +00:00
exclude.setCostPurchaseDevice(deviceCostTaxExcludeSum);
exclude.setCostPurchaseBuild(buildingCostTaxExcludeSum);
exclude.setCostPurchaseService(serviceCostTaxExcludeSum);
exclude.setCostPurchaseOther(otherCostTaxExcludeSum);
exclude.setCostProjectManage(projectManageCostTaxExcludeSum);
exclude.setCostOtherOther(otherOtherCostTaxExcludeSum);
//管理
2021-11-18 02:35:10 +00:00
BigDecimal expropriationSum = projectBudgetCostManageRepository.costTaxExcludeSum(ProjectBudgetCostManage.TYPE_EXPROPRIATION);
BigDecimal companyManageSum = projectBudgetCostManageRepository.costTaxExcludeSum(ProjectBudgetCostManage.TYPE_COMPANY_MANAGE);
2021-11-17 02:42:56 +00:00
exclude.setCostExpropriation(expropriationSum);
exclude.setCostCompanyManage(companyManageSum);
2021-11-18 02:35:10 +00:00
2021-11-17 02:42:56 +00:00
list.add(exclude);
return list;
}
/**
*
*
* @return
*/
public List getIncomeStatement() {
return null;
}
/**
*
*
* @return
*/
public List getCashFlow() {
return null;
}
}