展示其他明细表的数据到资金计划的表头

master
xxssyyyyssxx 2021-11-30 14:23:20 +08:00
parent 0956883c35
commit 90ce3ac4b9
7 changed files with 156 additions and 9 deletions

View File

@ -174,21 +174,30 @@ public class ProjectController extends BaseController {
public String budget(@RequestParam("id") int id, Map<String, Object> model) {
Project project = projectService.getProject(id);
model.put("project", project);
//采购类型
model.put("procurementTypes", procurementTypeService.allProcurementTypeList());
BudgetBean budgetBean = projectBudgetService.getBudget(project);
//预算主页面数据
model.put("budgetBean", budgetBean);
//收入明细
model.put("incomeDetails", projectBudgetService.getBudgetIncomeDetail(project));
List<ProjectBudgetIncomeDetail> budgetIncomeDetail = projectBudgetService.getBudgetIncomeDetail(project);
model.put("incomeDetails", budgetIncomeDetail);
//成本明细
model.put("costDetails", projectBudgetService.getBudgetCostDetail(project));
//采购类型
model.put("procurementTypes", procurementTypeService.allProcurementTypeList());
List<ProjectBudgetCostDetail> budgetCostDetail = projectBudgetService.getBudgetCostDetail(project);
model.put("costDetails", budgetCostDetail);
//项目管理成本明细
model.put("costProjectManageDetails", projectBudgetService.getBudgetCostProjectManageDetail(project));
List<ProjectBudgetCostProjectManageDetail> budgetCostProjectManageDetail = projectBudgetService.getBudgetCostProjectManageDetail(project);
model.put("costProjectManageDetails", budgetCostProjectManageDetail);
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
//资金计划明细
model.put("projectBudgetPlanDetails", projectBudgetPlanDetails);
//资金计划总【上面汇总表】
//资金计划总【上面汇总表第一行】
model.put("projectBudgetPlanDetailTotalTitle", projectBudgetService.getProjectBudgetPlanDetailTotalTitle(project,
budgetIncomeDetail,
budgetCostDetail,
budgetCostProjectManageDetail,
projectBudgetPlanDetails));
//资金计划总【上面汇总表第二行】
model.put("projectBudgetPlanDetailTotal", projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails));
//资金计划表中的统计信息【下面资金小表】
model.put("underwrittenPlanStatistic", projectBudgetService.getProjectUnderwrittenPlanStatisticBean(projectBudgetPlanDetails));

View File

@ -462,7 +462,6 @@ public class ProjectBudgetService {
*
*/
public ProjectBudgetPlanDetail getProjectBudgetPlanDetailTotal(Project project, List<ProjectBudgetPlanDetail> projectBudgetPlanDetails) {
ProjectBudgetPlanDetail projectBudgetPlanDetail = new ProjectBudgetPlanDetail();
BigDecimal deviceCost = new BigDecimal(0);
BigDecimal engineerCost = new BigDecimal(0);
BigDecimal projectManageCost = new BigDecimal(0);
@ -498,6 +497,7 @@ public class ProjectBudgetService {
fundBalance = totalIncome.subtract(totalCost);
ProjectBudgetPlanDetail projectBudgetPlanDetail = new ProjectBudgetPlanDetail();
projectBudgetPlanDetail.setMonth("合计");
projectBudgetPlanDetail.setDeviceCost(deviceCost);
projectBudgetPlanDetail.setEngineerCost(engineerCost);
@ -515,6 +515,102 @@ public class ProjectBudgetService {
return projectBudgetPlanDetail;
}
/**
*
*/
public ProjectBudgetPlanDetail getProjectBudgetPlanDetailTotalTitle(Project project,
List<ProjectBudgetIncomeDetail> budgetIncomeDetail,
List<ProjectBudgetCostDetail> budgetCostDetail,
List<ProjectBudgetCostProjectManageDetail> budgetCostProjectManageDetail,
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails) {
BigDecimal deviceCost = calDeviceCost(budgetCostDetail);
BigDecimal engineerCost = calEngineerCost(budgetCostDetail);
BigDecimal projectManageCost = calProjectManageCost(budgetCostProjectManageDetail);
BigDecimal saleIncome = calSaleIncome(budgetIncomeDetail);
BigDecimal earnestMoneyIncome = new BigDecimal(0);
BigDecimal earnestMoneyCost = new BigDecimal(0);
BigDecimal capitalInterest = new BigDecimal(0);
BigDecimal underwrittenPlan = new BigDecimal(0);
BigDecimal repaymentPlan = new BigDecimal(0);
if(CollectionUtil.isNotEmpty(projectBudgetPlanDetails)){
for (ProjectBudgetPlanDetail budgetPlan : projectBudgetPlanDetails) {
earnestMoneyCost = earnestMoneyCost.add(budgetPlan.getEarnestMoneyCost());
earnestMoneyIncome = earnestMoneyIncome.add(budgetPlan.getEarnestMoneyIncome());
capitalInterest = capitalInterest.add(budgetPlan.getCapitalInterest());
underwrittenPlan = underwrittenPlan.add(budgetPlan.getUnderwrittenPlan());
repaymentPlan = repaymentPlan.add(budgetPlan.getRepaymentPlan());
}
}
BigDecimal totalCost = deviceCost.add(engineerCost).add(projectManageCost).add(earnestMoneyCost);
BigDecimal totalIncome = saleIncome.add(earnestMoneyIncome);
//总余额等于总收入-总支出
BigDecimal fundBalance = totalIncome.subtract(totalCost);
ProjectBudgetPlanDetail projectBudgetPlanDetail = new ProjectBudgetPlanDetail();
projectBudgetPlanDetail.setMonth("合计");
projectBudgetPlanDetail.setDeviceCost(deviceCost);
projectBudgetPlanDetail.setEngineerCost(engineerCost);
projectBudgetPlanDetail.setProjectManageCost(projectManageCost);
projectBudgetPlanDetail.setEarnestMoneyCost(earnestMoneyCost);
projectBudgetPlanDetail.setTotalCost(totalCost);
projectBudgetPlanDetail.setSaleIncome(saleIncome);
projectBudgetPlanDetail.setEarnestMoneyIncome(earnestMoneyIncome);
projectBudgetPlanDetail.setTotalIncome(totalIncome);
projectBudgetPlanDetail.setFundBalance(fundBalance);
projectBudgetPlanDetail.setCapitalInterest(capitalInterest);
projectBudgetPlanDetail.setUnderwrittenPlan(underwrittenPlan);
projectBudgetPlanDetail.setRepaymentPlan(repaymentPlan);
return projectBudgetPlanDetail;
}
private BigDecimal calSaleIncome(List<ProjectBudgetIncomeDetail> budgetIncomeDetail) {
BigDecimal saleIncome = new BigDecimal(0);
if(CollectionUtil.isNotEmpty(budgetIncomeDetail)){
for (ProjectBudgetIncomeDetail projectBudgetIncomeDetail : budgetIncomeDetail) {
saleIncome = saleIncome.add(projectBudgetIncomeDetail.getTotalTaxExclude());
}
}
return saleIncome;
}
private BigDecimal calProjectManageCost(List<ProjectBudgetCostProjectManageDetail> budgetCostProjectManageDetail) {
BigDecimal projectManageCost = new BigDecimal(0);
if(CollectionUtil.isNotEmpty(budgetCostProjectManageDetail)){
for (ProjectBudgetCostProjectManageDetail projectBudgetCostProjectManageDetail : budgetCostProjectManageDetail) {
projectManageCost = projectManageCost.add(projectBudgetCostProjectManageDetail.getTotal());
}
}
return projectManageCost;
}
private BigDecimal calEngineerCost(List<ProjectBudgetCostDetail> budgetCostDetail) {
BigDecimal engineerCost = new BigDecimal(0);
if(CollectionUtil.isNotEmpty(budgetCostDetail)){
List<ProjectBudgetCostDetail> costDetailList = budgetCostDetail.stream().filter(b -> b.getType() != ProjectBudgetCostDetail.TYPE_DEVICE).collect(Collectors.toList());
for (ProjectBudgetCostDetail projectBudgetCostDetail : costDetailList) {
engineerCost = engineerCost.add(projectBudgetCostDetail.getTotalTaxExclude());
}
}
return engineerCost;
}
private BigDecimal calDeviceCost(List<ProjectBudgetCostDetail> budgetCostDetail) {
BigDecimal deviceCost = new BigDecimal(0);
if(CollectionUtil.isNotEmpty(budgetCostDetail)){
List<ProjectBudgetCostDetail> costDetailList = budgetCostDetail.stream().filter(b -> b.getType() == ProjectBudgetCostDetail.TYPE_DEVICE).collect(Collectors.toList());
for (ProjectBudgetCostDetail projectBudgetCostDetail : costDetailList) {
deviceCost = deviceCost.add(projectBudgetCostDetail.getTotalTaxExclude());
}
}
return deviceCost;
}
/**
* 使
*

View File

@ -185,6 +185,14 @@ function updateCostData(data, returnData) {
$("input[name='costPurchaseOtherTaxInclude']").val(f2(otherTaxInclude));
$("input[name='costPurchaseOtherTaxExclude']").val(f2(otherTaxExclude));
//资金计划表中的
$(".input-total-title-device-cost-budget-plan").val(f2(deviceTaxExclude));
$(".input-total-title-engineer-cost-budget-plan").val(f2(f2(buildTaxExclude)+f2(serviceTaxExclude)+f2(otherTaxExclude)));
$(".input-total-title-total-cost-budget-plan").val(f2(f2(deviceTaxExclude)+f2(buildTaxExclude)+f2(serviceTaxExclude)+f2(otherTaxExclude)
+f2($(".input-total-title-project-manage-cost-budget-plan").val())
+f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
/* var costOtherOtherTaxInclude = f2($("input[name='costOtherOtherTaxInclude']").val());
var costOtherOtherTaxExclude = f2($("input[name='costOtherOtherTaxExclude']").val());

View File

@ -86,6 +86,18 @@ function updateCostProjectManageData(data,returnData) {
$("input[name='costProjectManageTaxExclude']").val(total);
$("input[name='costProjectManageTaxInclude']").val(total);
//资金计划表中的
$(".input-total-title-project-manage-cost-budget-plan").val(total);
var deviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']").val();
var buildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']").val();
var serviceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']").val();
var otherTaxExclude = $("input[name='costPurchaseOtherTaxExclude']").val();
$(".input-total-title-total-cost-budget-plan").val(f2(f2(deviceTaxExclude)+f2(buildTaxExclude)+f2(serviceTaxExclude)+f2(otherTaxExclude)
+total
+f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
/*var costPurchaseDeviceTaxInclude = f2($("input[name='costPurchaseDeviceTaxInclude']").val());
var costPurchaseBuildTaxInclude = f2($("input[name='costPurchaseBuildTaxInclude']").val());
var costPurchaseServiceTaxInclude = f2($("input[name='costPurchaseServiceTaxInclude']").val());

View File

@ -59,6 +59,12 @@ function updateIncomeData(data,returnData) {
$("input[name='incomeTotalTaxInclude']").val(f2(deviceTaxInclude+engineerTaxInclude+serviceTaxInclude));
$("input[name='incomeTotalTaxExclude']").val(f2(deviceTaxExclude+engineerTaxExclude+serviceTaxExclude));
$(".input-total-title-sale-income-budget-plan").val($("input[name='incomeTotalTaxExclude']").val());
$(".input-total-title-total-income-budget-plan").val(f2($("input[name='incomeTotalTaxExclude']").val())
+f2($(".input-total-title-earnest-money-income-budget-plan").val()));
updateProjectContributionProfitRate();
}

View File

@ -487,8 +487,8 @@ function summationByClass(input, className, myIndex) {
var total = 0;
var trs = input.parent().parent().parent().find("tr");
trs.each(function (index, element) {
//myIndex从0开始刨除表头和总计两行
index-=2;
//myIndex从0开始刨除表头和总计、总计两行
index-=3;
if(index>=0 && index<=myIndex){
total += f2($(this).find(className).val());
}

View File

@ -613,6 +613,22 @@
<td>还款计划</td>
<td>操作</td>
</tr>
<tr>
<td><input type="text" class="am-modal-prompt-input input-total-title-month-budget-plan" value="${projectBudgetPlanDetailTotalTitle.month}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-device-cost-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.deviceCost)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-engineer-cost-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.engineerCost)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-project-manage-cost-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.projectManageCost)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-earnest-money-cost-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.earnestMoneyCost)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-total-cost-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.totalCost)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-sale-income-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.saleIncome)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-earnest-money-income-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.earnestMoneyIncome)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-total-income-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.totalIncome)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-fund-balance-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.fundBalance)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-capital-interest-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.capitalInterest)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-underwritten-plan-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.underwrittenPlan)}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-title-repayment-plan-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotalTitle.repaymentPlan)}" readonly/></td>
<td></td>
</tr>
<tr>
<td><input type="text" class="am-modal-prompt-input input-total-month-budget-plan" value="${projectBudgetPlanDetailTotal.month}" readonly/></td>
<td><input type="number" class="am-modal-prompt-input input-total-device-cost-budget-plan" value="${Utils.format(projectBudgetPlanDetailTotal.deviceCost)}" readonly/></td>