资金计划基本展示
parent
f6612cc130
commit
476168b21b
|
@ -139,10 +139,19 @@ public class ProjectController extends BaseController{
|
|||
Project project = projectService.getProject(id);
|
||||
model.put("project", project);
|
||||
BudgetBean budgetBean = projectBudgetService.getBudget(project);
|
||||
//预算主页面数据
|
||||
model.put("budgetBean", budgetBean);
|
||||
//收入明细
|
||||
model.put("incomeDetails", projectBudgetService.getBudgetIncomeDetail(project));
|
||||
//成本明细
|
||||
model.put("costDetails", projectBudgetService.getBudgetCostDetail(project));
|
||||
//项目管理成本明细
|
||||
model.put("costProjectManageDetails", projectBudgetService.getBudgetCostProjectManageDetail(project));
|
||||
List<ProjectBudgetPlan> projectBudgetPlans = projectBudgetService.getProjectBudgetPlans(project);
|
||||
//资金计划明细
|
||||
model.put("projectBudgetPlans", projectBudgetPlans);
|
||||
//资金计划总
|
||||
model.put("projectBudgetPlanTotal", projectBudgetService.getProjectBudgetPlanTotal(projectBudgetPlans));
|
||||
return "admin/project_budget_edit";
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,207 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 资金计划表
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_plan")
|
||||
public class ProjectBudgetPlan {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private String month;
|
||||
|
||||
/**
|
||||
* 设备支出
|
||||
*/
|
||||
@Column(name = "device_cost")
|
||||
private BigDecimal deviceCost;
|
||||
/**
|
||||
*工程支出
|
||||
*/
|
||||
@Column(name = "engineer_cost")
|
||||
private BigDecimal engineerCost;
|
||||
/**
|
||||
*经营性开支
|
||||
*/
|
||||
@Column(name = "project_manage_cost")
|
||||
private BigDecimal projectManageCost;
|
||||
/**
|
||||
*保证金支出
|
||||
*/
|
||||
@Column(name = "earnest_money_cost")
|
||||
private BigDecimal earnestMoneyCost;
|
||||
/**
|
||||
*支出合计
|
||||
*/
|
||||
@Column(name = "total_cost")
|
||||
private BigDecimal totalCost;
|
||||
/**
|
||||
*销售收款
|
||||
*/
|
||||
@Column(name = "sale_income")
|
||||
private BigDecimal saleIncome;
|
||||
/**
|
||||
*保证金收款
|
||||
*/
|
||||
@Column(name = "earnest_money_income")
|
||||
private BigDecimal earnestMoneyIncome;
|
||||
/**
|
||||
*收款合计
|
||||
*/
|
||||
@Column(name = "total_income")
|
||||
private BigDecimal totalIncome;
|
||||
/**
|
||||
*资金余额
|
||||
*/
|
||||
@Column(name = "fund_balance")
|
||||
private BigDecimal fundBalance;
|
||||
/**
|
||||
*资金利息
|
||||
*/
|
||||
@Column(name = "capital_interest")
|
||||
private BigDecimal capitalInterest;
|
||||
/**
|
||||
*垫资计划
|
||||
*/
|
||||
@Column(name = "underwritten_plan")
|
||||
private BigDecimal underwrittenPlan;
|
||||
/**
|
||||
*还款计划
|
||||
*/
|
||||
@Column(name = "repayment_plan")
|
||||
private BigDecimal repaymentPlan;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(String month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public BigDecimal getDeviceCost() {
|
||||
return deviceCost;
|
||||
}
|
||||
|
||||
public void setDeviceCost(BigDecimal deviceCost) {
|
||||
this.deviceCost = deviceCost;
|
||||
}
|
||||
|
||||
public BigDecimal getEngineerCost() {
|
||||
return engineerCost;
|
||||
}
|
||||
|
||||
public void setEngineerCost(BigDecimal engineerCost) {
|
||||
this.engineerCost = engineerCost;
|
||||
}
|
||||
|
||||
public BigDecimal getProjectManageCost() {
|
||||
return projectManageCost;
|
||||
}
|
||||
|
||||
public void setProjectManageCost(BigDecimal projectManageCost) {
|
||||
this.projectManageCost = projectManageCost;
|
||||
}
|
||||
|
||||
public BigDecimal getEarnestMoneyCost() {
|
||||
return earnestMoneyCost;
|
||||
}
|
||||
|
||||
public void setEarnestMoneyCost(BigDecimal earnestMoneyCost) {
|
||||
this.earnestMoneyCost = earnestMoneyCost;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalCost() {
|
||||
return totalCost;
|
||||
}
|
||||
|
||||
public void setTotalCost(BigDecimal totalCost) {
|
||||
this.totalCost = totalCost;
|
||||
}
|
||||
|
||||
public BigDecimal getSaleIncome() {
|
||||
return saleIncome;
|
||||
}
|
||||
|
||||
public void setSaleIncome(BigDecimal saleIncome) {
|
||||
this.saleIncome = saleIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getEarnestMoneyIncome() {
|
||||
return earnestMoneyIncome;
|
||||
}
|
||||
|
||||
public void setEarnestMoneyIncome(BigDecimal earnestMoneyIncome) {
|
||||
this.earnestMoneyIncome = earnestMoneyIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalIncome() {
|
||||
return totalIncome;
|
||||
}
|
||||
|
||||
public void setTotalIncome(BigDecimal totalIncome) {
|
||||
this.totalIncome = totalIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getFundBalance() {
|
||||
return fundBalance;
|
||||
}
|
||||
|
||||
public void setFundBalance(BigDecimal fundBalance) {
|
||||
this.fundBalance = fundBalance;
|
||||
}
|
||||
|
||||
public BigDecimal getCapitalInterest() {
|
||||
return capitalInterest;
|
||||
}
|
||||
|
||||
public void setCapitalInterest(BigDecimal capitalInterest) {
|
||||
this.capitalInterest = capitalInterest;
|
||||
}
|
||||
|
||||
public BigDecimal getUnderwrittenPlan() {
|
||||
return underwrittenPlan;
|
||||
}
|
||||
|
||||
public void setUnderwrittenPlan(BigDecimal underwrittenPlan) {
|
||||
this.underwrittenPlan = underwrittenPlan;
|
||||
}
|
||||
|
||||
public BigDecimal getRepaymentPlan() {
|
||||
return repaymentPlan;
|
||||
}
|
||||
|
||||
public void setRepaymentPlan(BigDecimal repaymentPlan) {
|
||||
this.repaymentPlan = repaymentPlan;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProjectBudgetPlanRepository extends JpaRepository<ProjectBudgetPlan,Integer> {
|
||||
List<ProjectBudgetPlan> findAllByProjectIdEquals(int id);
|
||||
}
|
|
@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||
import org.springframework.stereotype.Service;
|
||||
import top.jfunc.common.utils.CollectionUtil;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -30,6 +31,8 @@ public class ProjectBudgetService {
|
|||
private ProjectBudgetCostDetailRepository projectBudgetCostDetailRepository;
|
||||
@Autowired
|
||||
private ProjectBudgetCostProjectManageDetailRepository projectBudgetCostProjectManageDetailRepository;
|
||||
@Autowired
|
||||
private ProjectBudgetPlanRepository projectBudgetPlanRepository;
|
||||
|
||||
@Value("#{'${fourcal.fixedprojectmanagedetails}'.split('\\|')}")
|
||||
private String[] fixedProjectManageDetails;
|
||||
|
@ -287,6 +290,10 @@ public class ProjectBudgetService {
|
|||
projectBudgetCostProjectManageDetailRepository.save(detailList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目管理明细
|
||||
*/
|
||||
public List<ProjectBudgetCostProjectManageDetail> getBudgetCostProjectManageDetail(Project project){
|
||||
List<ProjectBudgetCostProjectManageDetail> projectManageDetails = projectBudgetCostProjectManageDetailRepository.findAllByProjectIdEquals(project.getId());
|
||||
|
||||
|
@ -313,4 +320,64 @@ public class ProjectBudgetService {
|
|||
|
||||
return projectManageDetails;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取资金计划数据
|
||||
*/
|
||||
public List<ProjectBudgetPlan> getProjectBudgetPlans(Project project){
|
||||
return projectBudgetPlanRepository.findAllByProjectIdEquals(project.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据每个月的计算资金计划的总
|
||||
*/
|
||||
public ProjectBudgetPlan getProjectBudgetPlanTotal(List<ProjectBudgetPlan> projectBudgetPlans) {
|
||||
ProjectBudgetPlan projectBudgetPlan = new ProjectBudgetPlan();
|
||||
BigDecimal deviceCost = new BigDecimal(0);
|
||||
BigDecimal engineerCost = new BigDecimal(0);
|
||||
BigDecimal projectManageCost = new BigDecimal(0);
|
||||
BigDecimal earnestMoneyCost = new BigDecimal(0);
|
||||
BigDecimal totalCost = new BigDecimal(0);
|
||||
BigDecimal saleIncome = new BigDecimal(0);
|
||||
BigDecimal earnestMoneyIncome = new BigDecimal(0);
|
||||
BigDecimal totalIncome = new BigDecimal(0);
|
||||
BigDecimal fundBalance = new BigDecimal(0);
|
||||
BigDecimal capitalInterest = new BigDecimal(0);
|
||||
BigDecimal underwrittenPlan = new BigDecimal(0);
|
||||
BigDecimal repaymentPlan = new BigDecimal(0);
|
||||
|
||||
if(CollectionUtil.isNotEmpty(projectBudgetPlans)){
|
||||
for (ProjectBudgetPlan budgetPlan : projectBudgetPlans) {
|
||||
deviceCost = deviceCost.add(budgetPlan.getDeviceCost());
|
||||
engineerCost = engineerCost.add(budgetPlan.getEngineerCost());
|
||||
projectManageCost = projectManageCost.add(budgetPlan.getProjectManageCost());
|
||||
earnestMoneyCost = earnestMoneyCost.add(budgetPlan.getEarnestMoneyCost());
|
||||
totalCost = totalCost.add(budgetPlan.getTotalCost());
|
||||
saleIncome = saleIncome.add(budgetPlan.getSaleIncome());
|
||||
earnestMoneyIncome = earnestMoneyIncome.add(budgetPlan.getEarnestMoneyIncome());
|
||||
totalIncome = totalIncome.add(budgetPlan.getTotalIncome());
|
||||
fundBalance = fundBalance.add(budgetPlan.getFundBalance());
|
||||
capitalInterest = capitalInterest.add(budgetPlan.getCapitalInterest());
|
||||
underwrittenPlan = underwrittenPlan.add(budgetPlan.getUnderwrittenPlan());
|
||||
repaymentPlan = repaymentPlan.add(budgetPlan.getRepaymentPlan());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
projectBudgetPlan.setMonth("合计");
|
||||
projectBudgetPlan.setDeviceCost(deviceCost);
|
||||
projectBudgetPlan.setEngineerCost(engineerCost);
|
||||
projectBudgetPlan.setProjectManageCost(projectManageCost);
|
||||
projectBudgetPlan.setEarnestMoneyCost(earnestMoneyCost);
|
||||
projectBudgetPlan.setTotalCost(totalCost);
|
||||
projectBudgetPlan.setSaleIncome(saleIncome);
|
||||
projectBudgetPlan.setEarnestMoneyIncome(earnestMoneyIncome);
|
||||
projectBudgetPlan.setTotalIncome(totalIncome);
|
||||
projectBudgetPlan.setFundBalance(fundBalance);
|
||||
projectBudgetPlan.setCapitalInterest(capitalInterest);
|
||||
projectBudgetPlan.setUnderwrittenPlan(underwrittenPlan);
|
||||
projectBudgetPlan.setRepaymentPlan(repaymentPlan);
|
||||
return projectBudgetPlan;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
/**
|
||||
* 一个资金计划的字段
|
||||
*/
|
||||
BUDGET_PLAN_DETAIL_ARR=["type","name","detail","unit","amount","price","total","predictMethod","predictWhy","remark","deletable"];
|
||||
$(function () {
|
||||
$(".budget-plan-detail").click(function () {
|
||||
$('#my-prompt-budget-detail').modal({
|
||||
relatedTarget: this,
|
||||
onConfirm: function(e) {
|
||||
//不能使用e.data,因为无法获取动态添加的
|
||||
var data = collectData("am-modal-prompt-input-budget-plan");
|
||||
data = prepareAjaxData(data, BUDGET_PLAN_DETAIL_ARR, $("#id").val());
|
||||
saveDetail("/fourcal/project/budgetEditSaveBudgetPlanDetail", data, updateBudgetPlanData);
|
||||
},
|
||||
onCancel: function(e) {
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#budgetPlanAddBtn").click(function () {
|
||||
appendTrBudgetPlan();
|
||||
});
|
||||
});
|
||||
/**
|
||||
* 资金计划增加一行
|
||||
*/
|
||||
function appendTrBudgetPlan() {
|
||||
var template = '<tr>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" readonly></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" readonly></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
||||
' <td><button type="button" class="am-btn am-btn-warning am-btn-xs am-round am-modal-line-delete"><span class="am-icon-minus"></span></button></td>\n' +
|
||||
' </tr>';
|
||||
$("#budgetPlanTable").append(template);
|
||||
//重新绑定删除事件和input修改事件
|
||||
bindDeleteBtn();
|
||||
bindChangeableInputBudgetPlan();
|
||||
}
|
||||
|
||||
function bindChangeableInputBudgetPlan() {
|
||||
}
|
||||
/**
|
||||
* 更新页面收入的数据
|
||||
*/
|
||||
function updateBudgetPlanData(details) {
|
||||
}
|
|
@ -295,7 +295,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<span class="am-text-lg">管理</span>
|
||||
<span class="am-text-primary"><a style="cursor: pointer" id="plan-detail">资金计划表</a></span>
|
||||
<span class="am-text-primary budget-plan-detail"><a style="cursor: pointer">资金计划表</a></span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
@ -338,7 +338,7 @@
|
|||
</table>
|
||||
|
||||
<span class="am-text-lg">现金流量表</span>
|
||||
<span class="am-text-primary"><a style="cursor: pointer">资金计划表</a></span>
|
||||
<span class="am-text-primary budget-plan-detail"><a style="cursor: pointer">资金计划表</a></span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
@ -583,6 +583,77 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<#--资金计划明细表弹窗-->
|
||||
<div class="am-modal am-modal-prompt" style="width: 1200px;max-height:600px;overflow-y:auto;" tabindex="-1" id="my-prompt-budget-detail">
|
||||
<div class="am-modal-dialog">
|
||||
<div class="am-modal-hd">新增资金计划明细表——${project.name}</div>
|
||||
<div class="am-modal-bd">
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;" id="budgetPlanTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>月份</td>
|
||||
<td>设备支出</td>
|
||||
<td>工程支出</td>
|
||||
<td>经营性开支</td>
|
||||
<td>保证金支出</td>
|
||||
<td>支出合计</td>
|
||||
<td>销售收款</td>
|
||||
<td>保证金收款</td>
|
||||
<td>收款合计</td>
|
||||
<td>资金余额</td>
|
||||
<td>资金利息</td>
|
||||
<td>垫资计划</td>
|
||||
<td>还款计划</td>
|
||||
<td>操作</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${projectBudgetPlanTotal.month}</td>
|
||||
<td>${projectBudgetPlanTotal.deviceCost}</td>
|
||||
<td>${projectBudgetPlanTotal.engineerCost}</td>
|
||||
<td>${projectBudgetPlanTotal.projectManageCost}</td>
|
||||
<td>${projectBudgetPlanTotal.earnestMoneyCost}</td>
|
||||
<td>${projectBudgetPlanTotal.totalCost}</td>
|
||||
<td>${projectBudgetPlanTotal.saleIncome}</td>
|
||||
<td>${projectBudgetPlanTotal.earnestMoneyIncome}</td>
|
||||
<td>${projectBudgetPlanTotal.totalIncome}</td>
|
||||
<td>${projectBudgetPlanTotal.fundBalance}</td>
|
||||
<td>${projectBudgetPlanTotal.capitalInterest}</td>
|
||||
<td>${projectBudgetPlanTotal.underwrittenPlan}</td>
|
||||
<td>${projectBudgetPlanTotal.repaymentPlan}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<#if projectBudgetPlans??>
|
||||
<#list projectBudgetPlans as projectBudgetPlan>
|
||||
<tr>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.month!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.deviceCost!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.engineerCost!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.projectManageCost!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.earnestMoneyCost!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.totalCost!}" readonly></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.saleIncome!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.earnestMoneyIncome!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.totalIncome!}" readonly></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.fundBalance!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.capitalInterest!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.underwrittenPlan!}"></td>
|
||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" value="${projectBudgetPlan.repaymentPlan!}"></td>
|
||||
<td><button type="button" class="am-btn am-btn-warning am-btn-xs am-round am-modal-line-delete"><span class="am-icon-minus"></span></button></td>
|
||||
</tr>
|
||||
</#list>
|
||||
</#if>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="button" id="budgetPlanAddBtn" class="am-btn am-btn-primary am-btn-xs am-round"><span class="am-icon-plus"></span></button>
|
||||
</div>
|
||||
<div class="am-modal-footer">
|
||||
<span class="am-modal-btn" data-am-modal-cancel>取消</span>
|
||||
<span class="am-modal-btn" data-am-modal-confirm>保存</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
@ -604,6 +675,7 @@
|
|||
<script src="${base}/assets/js/project_budget_income.js"></script>
|
||||
<script src="${base}/assets/js/project_budget_cost.js"></script>
|
||||
<script src="${base}/assets/js/project_budget_cost_project_manage.js"></script>
|
||||
<script src="${base}/assets/js/project_budget_plan.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
|
|
Loading…
Reference in New Issue