parent
9a6d9d8911
commit
f9b0c1d551
|
@ -173,10 +173,10 @@ public class ProjectController extends BaseController {
|
|||
ExportExcelUtils exportExcelUtils = new ExportExcelUtils();
|
||||
String[] headers0 = {"部门名称", "项目编号", "项目名称", "项目类型", "项目计划开始时间", "项目计划结束时间", "垫资模式", "合作对象", "垫资利息", "垫资峰值", "合同金额",
|
||||
"项目毛利", "项目毛利率", "华智产品金额", "汇智产品金额", "华三产品金额", "其他产品金额", "项目把握度", "行业场景应用", "项目解决方案", "客户名称", "最终用户名称",
|
||||
"价值及风险", "项目负责人", "预计合同签订时间", "项目计划招标时间", "是否二次合作", "直签", "主合同收款条款", "主合同具体解决方案", "计收计划","项目阶段", "公司销售阶段", "当前进度描述", "下一步计划"};
|
||||
"价值及风险", "项目负责人", "预计合同签订时间", "项目计划招标时间", "是否二次合作", "直签", "计收计划","项目阶段", "公司销售阶段", "当前进度描述", "下一步计划"};
|
||||
String[] columns0 = {"deptName", "projectNo", "name", "typeDesc", "startDate", "endDate", "underwrittenModeStr", "collaborator", "advanceInterestAmountRound", "advancePeakAmountRound", "contractRound",
|
||||
"grossProfitRound", "grossProfitMarginRound", "huazhiRound", "huizhiRound", "huasanRound", "ziguangRound", "certaintyStr", "industryScenario", "resolvePlanStr", "customer", "terminalCustomer",
|
||||
"valueRisk", "principal", "contractTime", "bidsTime", "isSecondStr", "signTypeStr", "mainContractCollectionTerms", "mainContractResolvePlan", "calculationCollection","stageName", "saleStageName", "stageRemark", "nextPlan"};
|
||||
"valueRisk", "principal", "contractTime", "bidsTime", "isSecondStr", "signTypeStr", "calculationCollection","stageName", "saleStageName", "stageRemark", "nextPlan"};
|
||||
exportExcelUtils.exportProjectExcel(headers0, columns0, project, "yyyy-MM-dd", 0, "项目立项(概算)信息", outputStream);
|
||||
|
||||
if (project.getStatus() < 5) {
|
||||
|
@ -211,8 +211,8 @@ public class ProjectController extends BaseController {
|
|||
} else {
|
||||
incomeTaxRates = incomeTaxSb.toString();
|
||||
}
|
||||
String[] headers2 = {"序号", "类别", "名称", "规格类型", "参数", "单位", "数量", "单价", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)"};
|
||||
String[] columns2 = {"tempId", "type", "name", "spec", "param", "unit", "amount", "price", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax"};
|
||||
String[] headers2 = {"序号", "类别", "产品大类", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)"};
|
||||
String[] columns2 = {"tempId", "type", "name", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax"};
|
||||
exportExcelUtils.exportIncomeDetailExcel(headers2, columns2, project, budgetBean, budgetIncomeDetail, incomeTotalAmount, "yyyy-MM-dd", 0, "收入明细表", outputStream);
|
||||
//收入计划
|
||||
List<ProjectBudgetIncomePlanDetail> budgetIncomePlanDetail = projectBudgetService.getBudgetIncomePlanDetail(project);
|
||||
|
@ -241,15 +241,15 @@ public class ProjectController extends BaseController {
|
|||
} else {
|
||||
costTaxRates = costTaxSb.toString();
|
||||
}
|
||||
String[] headers3 = {"序号", "费用项目", "采购类别", "名称", "单位", "数量", "单价", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)", "签约方", "是否垫资", "预估垫资金额(元)", "支出时间", "支出金额(元)", "付款方式", "备注"};
|
||||
String[] columns3 = {"tempId", "type", "category", "name", "unit", "amount", "price", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax", "contractParty", "isUnderwritten", "underwrittenAmount", "payTime", "payAmount", "payWay", "remark"};
|
||||
String[] headers3 = {"序号", "采购成本项目", "产品大类", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)", "供应商", "备注"};
|
||||
String[] columns3 = {"tempId", "type", "category", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax", "contractParty", "remark"};
|
||||
exportExcelUtils.exportCostDetailExcel(headers3, columns3, project, budgetBean, budgetCostDetail, costTotalAmount, costUnderwrittenAmountTotal, costPayAmountTotal, procurementMap, "yyyy-MM-dd", 0, "采购成本明细表", outputStream);
|
||||
//项目管理成本明细
|
||||
List<ProjectBudgetCostProjectManageDetail> budgetCostProjectManageDetail = projectBudgetService.getBudgetCostProjectManageDetail(project);
|
||||
BigDecimal costProjectManageTotalAmount = projectBudgetService.getBudgetCostProjectManageAmount(project);
|
||||
BigDecimal managePayAmountTotal = projectBudgetService.getBudgetCostProjectManagePayAmount(project);
|
||||
String[] headers4 = {"序号", "财务费用类别", "业务项目", "项目明细", "单位", "数量", "单价", "总金额(元)", "支出时间", "支出金额(元)", "预估计算方法", "预估依据", "备注"};
|
||||
String[] columns4 = {"tempId", "type", "name", "detail", "unit", "amount", "price", "total", "payTime", "payAmount", "predictMethod", "predictWhy", "remark"};
|
||||
String[] headers4 = {"序号", "费用类别", "业务项目", "项目明细", "总金额(元)", "支出时间", "支出金额(元)", "预估计算方法", "预估依据", "备注"};
|
||||
String[] columns4 = {"tempId", "type", "name", "detail", "total", "payTime", "payAmount", "predictMethod", "predictWhy", "remark"};
|
||||
exportExcelUtils.exportCostManageDetailExcel(headers4, columns4, project, budgetBean, budgetCostProjectManageDetail, costProjectManageTotalAmount, managePayAmountTotal, "yyyy-MM-dd", 0, "项目管理成本表", outputStream);
|
||||
//资金计划明细
|
||||
// ProjectBudgetPlanDetail projectBudgetPlanDetailTotalTitle = projectBudgetService.getProjectBudgetPlanDetailTotalTitle(project,
|
||||
|
@ -258,9 +258,10 @@ public class ProjectController extends BaseController {
|
|||
// budgetCostProjectManageDetail,
|
||||
// projectBudgetPlanDetails);
|
||||
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
|
||||
projectBudgetService.dealProjectBudgetPlanDetail(project, projectBudgetPlanDetails);
|
||||
ProjectBudgetPlanDetail projectBudgetPlanDetailTotal = projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails);
|
||||
String[] headers5 = {"月份", "设备支出", "工程支出(含服务+施工+其他)", "经营性开支", "保证金支出", "支出合计", "销售收款", "保证金收款", "收款合计", "资金余额", "资金利息", "垫资计划", "还款计划"};
|
||||
String[] row5 = {"month", "deviceCost", "engineerCost", "projectManageCost", "earnestMoneyCost", "totalCost", "saleIncome", "earnestMoneyIncome", "totalIncome", "fundBalance", "capitalInterest", "underwrittenPlan", "repaymentPlan"};
|
||||
String[] headers5 = {"月份", "设备支出", "工程付款","服务付款","其他付款", "经营性开支", "保证金支出", "支出合计", "销售收款", "保证金收款", "收款合计", "资金余额", "资金利息", "垫资计划", "还款计划"};
|
||||
String[] row5 = {"month", "deviceCost", "projectCost", "serviceCost","otherCost", "projectManageCost", "earnestMoneyCost", "totalCost", "saleIncome", "earnestMoneyIncome", "totalIncome", "fundBalance", "capitalInterest", "underwrittenPlan", "repaymentPlan"};
|
||||
exportExcelUtils.exportPlanDetailExcel(headers5, row5, project, budgetBean, projectBudgetPlanDetails, projectBudgetPlanDetailTotal, "yyyy-MM-dd", 0, "资金计划表", outputStream);
|
||||
|
||||
CashFlowBean cashFlowBean = projectBudgetService.getCashFlowBean(project, projectBudgetPlanDetails);
|
||||
|
@ -402,11 +403,12 @@ public class ProjectController extends BaseController {
|
|||
//收入计划
|
||||
List<ProjectBudgetIncomePlanDetail> budgetIncomePlanDetail = projectBudgetService.getBudgetIncomePlanDetail(project);
|
||||
model.put("incomePlanDetails", budgetIncomePlanDetail);
|
||||
BigDecimal incomePlanTotalReceiveAmount = projectBudgetService.getBudgetIncomePlanReceiveAmount(project);
|
||||
model.put("incomePlanTotal", incomePlanTotalReceiveAmount);
|
||||
//付款计划表
|
||||
List<ProjectBudgetPayPlan> budgetPayPlan = projectBudgetService.getBudgetPayPlan(project);
|
||||
model.put("budgetPayPlan", budgetPayPlan);
|
||||
BigDecimal incomePlanTotalReceiveAmount = projectBudgetService.getBudgetIncomePlanReceiveAmount(project);
|
||||
model.put("incomePlanTotal", incomePlanTotalReceiveAmount);
|
||||
model.put("budgetPayPlanTotal", budgetPayPlan.stream().filter(p->p.getPayAmount()!=null).map(p->p.getPayAmount()).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
//成本明细
|
||||
List<ProjectBudgetCostDetail> budgetCostDetail = projectBudgetService.getBudgetCostDetail(project);
|
||||
Set<String> rates2 = new HashSet<>();
|
||||
|
@ -432,6 +434,7 @@ public class ProjectController extends BaseController {
|
|||
model.put("costProjectManageTotalAmount", projectBudgetService.getBudgetCostProjectManageAmount(project));
|
||||
model.put("managePayAmountTotal", projectBudgetService.getBudgetCostProjectManagePayAmount(project));
|
||||
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
|
||||
projectBudgetService.dealProjectBudgetPlanDetail(project,projectBudgetPlanDetails);
|
||||
//资金计划明细
|
||||
model.put("projectBudgetPlanDetails", projectBudgetPlanDetails);
|
||||
//资金计划总【上面汇总表第一行】
|
||||
|
@ -734,6 +737,7 @@ public class ProjectController extends BaseController {
|
|||
model.put("costProjectManageTotalAmount", projectBudgetService.getBudgetCostProjectManageAmount(project));
|
||||
model.put("managePayAmountTotal", projectBudgetService.getBudgetCostProjectManagePayAmount(project));
|
||||
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
|
||||
projectBudgetService.dealProjectBudgetPlanDetail(project,projectBudgetPlanDetails);
|
||||
//资金计划明细
|
||||
model.put("projectBudgetPlanDetails", projectBudgetPlanDetails);
|
||||
//资金计划总【上面汇总表】
|
||||
|
@ -1207,10 +1211,10 @@ public class ProjectController extends BaseController {
|
|||
ExportExcelUtils exportExcelUtils = new ExportExcelUtils();
|
||||
String[] headers0 = {"部门名称", "项目编号", "项目名称", "项目类型", "项目计划开始时间", "项目计划结束时间", "垫资模式", "合作对象", "垫资利息", "垫资峰值",
|
||||
"合同金额", "项目毛利", "项目毛利率", "华智产品金额", "汇智产品金额", "华三产品金额", "其他产品金额", "项目把握度", "行业场景应用", "项目解决方案",
|
||||
"客户名称", "最终用户名称", "价值及风险", "项目负责人", "预计合同签订时间", "项目计划招标时间", "是否二次合作", "直签", "主合同收款条款", "主合同具体解决方案", "计收计划", "项目阶段", "公司销售阶段", "当前进度描述", "下一步计划"};
|
||||
"客户名称", "最终用户名称", "价值及风险", "项目负责人", "预计合同签订时间", "项目计划招标时间", "是否二次合作", "直签", "计收计划", "项目阶段", "公司销售阶段", "当前进度描述", "下一步计划"};
|
||||
String[] columns0 = {"deptName", "projectNo", "name", "typeDesc", "startDate", "endDate", "underwrittenModeStr", "collaborator", "advanceInterestAmountRound", "advancePeakAmountRound",
|
||||
"contractRound", "grossProfitRound", "grossProfitMarginRound", "huazhiRound", "huizhiRound", "huasanRound", "ziguangRound", "certaintyStr", "industryScenario", "resolvePlanStr",
|
||||
"customer", "terminalCustomer", "valueRisk", "principal", "contractTime", "bidsTime", "isSecondStr", "signTypeStr", "mainContractCollectionTerms", "mainContractResolvePlan", "calculationCollection", "stageName", "saleStageName", "stageRemark", "nextPlan"};
|
||||
"customer", "terminalCustomer", "valueRisk", "principal", "contractTime", "bidsTime", "isSecondStr", "signTypeStr", "calculationCollection", "stageName", "saleStageName", "stageRemark", "nextPlan"};
|
||||
exportExcelUtils.exportProjectExcel(headers0, columns0, project, "yyyy-MM-dd", 0, "项目立项(概算)信息", outputStream);
|
||||
|
||||
exportExcelUtils.end(outputStream);
|
||||
|
@ -1346,9 +1350,10 @@ public class ProjectController extends BaseController {
|
|||
BudgetBean budgetBean = projectBudgetService.getBudget(project);
|
||||
//资金计划明细
|
||||
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
|
||||
projectBudgetService.dealProjectBudgetPlanDetail(project, projectBudgetPlanDetails);
|
||||
ProjectBudgetPlanDetail projectBudgetPlanDetailTotal = projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails);
|
||||
String[] headers5 = {"月份", "设备支出", "工程支出(含服务+施工+其他)", "项目管理费用付款", "保证金付款", "付款合计", "销售收款", "保证金收款", "收款合计", "资金余额", "资金利息", "垫资计划", "还款计划"};
|
||||
String[] row5 = {"month", "deviceCost", "engineerCost", "projectManageCost", "earnestMoneyCost", "totalCost", "saleIncome", "earnestMoneyIncome", "totalIncome", "fundBalance", "capitalInterest", "underwrittenPlan", "repaymentPlan"};
|
||||
String[] headers5 = {"月份", "设备支出", "工程付款","服务付款","其他付款", "项目管理费用付款", "保证金付款", "付款合计", "销售收款", "保证金收款", "收款合计", "资金余额", "资金利息", "垫资计划", "还款计划"};
|
||||
String[] row5 = {"month", "deviceCost", "projectCost", "serviceCost","otherCost","projectManageCost", "earnestMoneyCost", "totalCost", "saleIncome", "earnestMoneyIncome", "totalIncome", "fundBalance", "capitalInterest", "underwrittenPlan", "repaymentPlan"};
|
||||
exportExcelUtils.exportPlanDetailExcel(headers5, row5, project, budgetBean, projectBudgetPlanDetails, projectBudgetPlanDetailTotal, "yyyy-MM-dd", 0, "资金计划表", outputStream);
|
||||
|
||||
exportExcelUtils.end(outputStream);
|
||||
|
|
|
@ -727,15 +727,7 @@ public class ProjectBudgetService {
|
|||
return projectBudgetPlanDetail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算资金计划的表头展示数据
|
||||
*/
|
||||
public ProjectBudgetPlanDetail getProjectBudgetPlanDetailTotalTitle(Project project,
|
||||
List<ProjectBudgetIncomeDetail> budgetIncomeDetail,
|
||||
List<ProjectBudgetCostDetail> budgetCostDetail,
|
||||
List<ProjectBudgetCostProjectManageDetail> budgetCostProjectManageDetail,
|
||||
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails) {
|
||||
|
||||
public void dealProjectBudgetPlanDetail(Project project,List<ProjectBudgetPlanDetail> projectBudgetPlanDetails){
|
||||
List<ProjectBudgetPayPlan> budgetPayPlan = projectBudgetService.getBudgetPayPlan(project);
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
|
||||
|
@ -751,6 +743,37 @@ public class ProjectBudgetService {
|
|||
)
|
||||
)
|
||||
));
|
||||
|
||||
if(CollectionUtil.isNotEmpty(projectBudgetPlanDetails)){
|
||||
for (ProjectBudgetPlanDetail budgetPlan : projectBudgetPlanDetails) {
|
||||
String month = budgetPlan.getMonth();
|
||||
|
||||
Map<String, BigDecimal> projectPayments = monthlyProjectPaymentSum.getOrDefault(month, Collections.emptyMap());
|
||||
BigDecimal projectCostTemp = projectPayments.getOrDefault("2", BigDecimal.ZERO);
|
||||
budgetPlan.setProjectCost(projectCostTemp);
|
||||
|
||||
BigDecimal serviceCostTemp = projectPayments.getOrDefault("3", BigDecimal.ZERO);
|
||||
budgetPlan.setServiceCost(serviceCostTemp);
|
||||
|
||||
BigDecimal otherCostTemp = projectPayments.getOrDefault("4", BigDecimal.ZERO);
|
||||
budgetPlan.setOtherCost(otherCostTemp);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算资金计划的表头展示数据
|
||||
*/
|
||||
public ProjectBudgetPlanDetail getProjectBudgetPlanDetailTotalTitle(Project project,
|
||||
List<ProjectBudgetIncomeDetail> budgetIncomeDetail,
|
||||
List<ProjectBudgetCostDetail> budgetCostDetail,
|
||||
List<ProjectBudgetCostProjectManageDetail> budgetCostProjectManageDetail,
|
||||
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails) {
|
||||
|
||||
BigDecimal projectCost = new BigDecimal(0);
|
||||
BigDecimal serviceCost = new BigDecimal(0);
|
||||
BigDecimal otherCost = new BigDecimal(0);
|
||||
BigDecimal deviceCost = calDeviceCost(budgetCostDetail);
|
||||
BigDecimal engineerCost = calEngineerCost(budgetCostDetail);
|
||||
BigDecimal projectManageCost = calProjectManageCost(budgetCostProjectManageDetail);
|
||||
|
@ -762,25 +785,12 @@ public class ProjectBudgetService {
|
|||
BigDecimal capitalInterest = new BigDecimal(0);
|
||||
BigDecimal underwrittenPlan = new BigDecimal(0);
|
||||
BigDecimal repaymentPlan = new BigDecimal(0);
|
||||
BigDecimal projectCost = new BigDecimal(0);
|
||||
BigDecimal serviceCost = new BigDecimal(0);
|
||||
BigDecimal otherCost = new BigDecimal(0);
|
||||
|
||||
if(CollectionUtil.isNotEmpty(projectBudgetPlanDetails)){
|
||||
for (ProjectBudgetPlanDetail budgetPlan : projectBudgetPlanDetails) {
|
||||
String month = budgetPlan.getMonth();
|
||||
|
||||
Map<String, BigDecimal> projectPayments = monthlyProjectPaymentSum.getOrDefault(month, Collections.emptyMap());
|
||||
BigDecimal projectCostTemp = projectPayments.getOrDefault("2", BigDecimal.ZERO);
|
||||
budgetPlan.setProjectCost(projectCostTemp);
|
||||
projectCost = projectCost.add(projectCostTemp);
|
||||
|
||||
BigDecimal serviceCostTemp = projectPayments.getOrDefault("3", BigDecimal.ZERO);
|
||||
budgetPlan.setServiceCost(serviceCostTemp);
|
||||
serviceCost = serviceCost.add(serviceCostTemp);
|
||||
|
||||
BigDecimal otherCostTemp = projectPayments.getOrDefault("4", BigDecimal.ZERO);
|
||||
budgetPlan.setOtherCost(otherCostTemp);
|
||||
otherCost=otherCost.add(otherCostTemp);
|
||||
projectCost = projectCost.add(budgetPlan.getProjectCost());
|
||||
serviceCost = serviceCost.add(budgetPlan.getServiceCost());
|
||||
otherCost=otherCost.add(budgetPlan.getOtherCost());
|
||||
earnestMoneyCost = earnestMoneyCost.add(budgetPlan.getEarnestMoneyCost());
|
||||
earnestMoneyIncome = earnestMoneyIncome.add(budgetPlan.getEarnestMoneyIncome());
|
||||
capitalInterest = capitalInterest.add(budgetPlan.getCapitalInterest());
|
||||
|
|
|
@ -1119,15 +1119,12 @@ public class ExportExcelUtils {
|
|||
totalCell.setCellType(CellType.STRING);
|
||||
totalCell.setCellValue("总计");
|
||||
} else if (i == 4) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(incomeTotalAmount));
|
||||
} else if (i == 7) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(budgetBean.getIncomeTotalTaxInclude()));
|
||||
} else if (i == 8) {
|
||||
} else if (i == 5) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(budgetBean.getIncomeTotalTaxExclude()));
|
||||
} else if (i == 9) {
|
||||
} else if (i == 6) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(budgetBean.getIncomeTotalTax()));
|
||||
} else {
|
||||
|
@ -1284,24 +1281,15 @@ public class ExportExcelUtils {
|
|||
if (i == 0) {
|
||||
totalCell.setCellType(CellType.STRING);
|
||||
totalCell.setCellValue("总计");
|
||||
} else if (i == 5) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(costTotalAmount));
|
||||
} else if (i == 8) {
|
||||
} else if (i == 4) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(budgetBean.getCostPurchaseTotalTaxInclude()));
|
||||
} else if (i == 9) {
|
||||
} else if (i == 5) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(budgetBean.getCostPurchaseTotalTaxExclude()));
|
||||
} else if (i == 10) {
|
||||
} else if (i == 6) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(budgetBean.getCostPurchaseTotalTax()));
|
||||
} else if (i == 13) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(costUnderwrittenAmountTotal));
|
||||
} else if (i == 15) {
|
||||
totalCell.setCellType(CellType.NUMERIC);
|
||||
totalCell.setCellValue(Utils.format(costPayAmountTotal));
|
||||
} else {
|
||||
totalCell.setCellType(CellType.STRING);
|
||||
totalCell.setCellValue("");
|
||||
|
|
Loading…
Reference in New Issue