|
@@ -70,11 +70,20 @@ public class CapitalPlanController extends BaseController {
|
|
|
* 资金计划管理页面
|
|
|
*/
|
|
|
@RequestMapping(value = "capitalPlanList")
|
|
|
- public String basicInformation(Project project, Model model) {
|
|
|
- model.addAttribute("project", project);
|
|
|
+ public String basicInformation(CapitalPlan capitalPlan, Model model) {
|
|
|
+ model.addAttribute("capitalPlan", capitalPlan);
|
|
|
return "modules/sg/capitalPlan/capitalPlanList";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改项目费率页面
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "editRate")
|
|
|
+ public String editRate(CapitalPlan capitalPlan, Model model) {
|
|
|
+ model.addAttribute("capitalPlan", capitalPlan);
|
|
|
+ return "modules/sg/capitalPlan/editRate";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -86,26 +95,48 @@ public class CapitalPlanController extends BaseController {
|
|
|
Page<CapitalPlan> page = capitalPlanService.findPage(new Page<CapitalPlan>(request, response), capitalPlan);
|
|
|
List<CapitalPlan> list = page.getList();
|
|
|
for (CapitalPlan c:list) {
|
|
|
+ //项目预算
|
|
|
String projectBudget = c.getProjectBudget();
|
|
|
+ //项目实际费用
|
|
|
String actualCost = c.getActualCost();
|
|
|
-
|
|
|
+ //施工费
|
|
|
String constructionCost = c.getConstructionCost();
|
|
|
+ //实际施工费
|
|
|
String actualConstructionCost = c.getActualConstructionCost();
|
|
|
-
|
|
|
+ //物资费
|
|
|
String materialCost = c.getMaterialCost();
|
|
|
+ //项目实际物资费
|
|
|
String actualMaterialCost = c.getActualMaterialCost();
|
|
|
-
|
|
|
+ //设计费
|
|
|
String designFee = c.getDesignFee();
|
|
|
+ //项目实际设计费
|
|
|
String actualDesignCost = c.getActualDesignCost();
|
|
|
-
|
|
|
+ //监理费
|
|
|
+ String supervisionFee = c.getSupervisionFee();
|
|
|
+ //应付监理费
|
|
|
String supervisionPayFee = c.getSupervisionPayFee();
|
|
|
+ //项目实际监理费
|
|
|
String actualSupervisionCost = c.getActualSupervisionCost();
|
|
|
-
|
|
|
+ //政策处理费用
|
|
|
String policyProcessingFee = c.getPolicyProcessingFee();
|
|
|
+ //项目实际管理费
|
|
|
String actualManagementFee = c.getActualManagementFee();
|
|
|
-
|
|
|
+ //其他费用
|
|
|
String otherExpenses = c.getOtherExpenses();
|
|
|
+ //实际其他费用
|
|
|
String actualOtherCost = c.getActualOtherCost();
|
|
|
+ //设计费费率
|
|
|
+ String designRate = c.getDesignRate();
|
|
|
+ //监理费费率
|
|
|
+ String supervisionRate = c.getSupervisionRate();
|
|
|
+ //判断费率是否为空值,为空值,自动配置为0
|
|
|
+ if (null == designRate || "".equals(designRate)) {
|
|
|
+ designRate = "0";
|
|
|
+ }
|
|
|
+ if (null==supervisionRate || "".equals(supervisionRate)) {
|
|
|
+ supervisionRate = "0";
|
|
|
+ }
|
|
|
+
|
|
|
//将空值初始化
|
|
|
projectBudget = getString(projectBudget);
|
|
|
actualCost = getString(actualCost);
|
|
@@ -122,21 +153,42 @@ public class CapitalPlanController extends BaseController {
|
|
|
otherExpenses = getString(otherExpenses);
|
|
|
actualOtherCost = getString(actualOtherCost);
|
|
|
|
|
|
+
|
|
|
BigDecimal projectDifference = new BigDecimal(projectBudget);
|
|
|
BigDecimal constructionDifference = new BigDecimal(constructionCost);
|
|
|
BigDecimal costDifference = new BigDecimal(materialCost);
|
|
|
- BigDecimal designDifference = new BigDecimal(designFee);
|
|
|
- BigDecimal supervisionDifference = new BigDecimal(supervisionPayFee);
|
|
|
+ //设计费
|
|
|
+ BigDecimal designFeeDiff = new BigDecimal(designFee);
|
|
|
+ //监理费
|
|
|
+ BigDecimal supervisionPayFeeDiff = new BigDecimal(supervisionPayFee);
|
|
|
BigDecimal policyDifference = new BigDecimal(policyProcessingFee);
|
|
|
BigDecimal otherDifference = new BigDecimal(otherExpenses);
|
|
|
-
|
|
|
+ //设计费费率
|
|
|
+ BigDecimal designRateDiff = new BigDecimal(designRate);
|
|
|
+ //监理费费率
|
|
|
+ BigDecimal supervisionRateDiff = new BigDecimal(supervisionRate);
|
|
|
+ //监理费
|
|
|
+ BigDecimal supervisionFeeDiff = new BigDecimal(supervisionFee);
|
|
|
+
|
|
|
+ //项目预算-项目实际费用
|
|
|
projectDifference = projectDifference.subtract(new BigDecimal(actualCost));
|
|
|
+ //施工费-实际施工费
|
|
|
constructionDifference = constructionDifference.subtract(new BigDecimal(actualConstructionCost));
|
|
|
+ //物资费-项目实际物资费
|
|
|
costDifference = costDifference.subtract(new BigDecimal(actualMaterialCost));
|
|
|
- designDifference = designDifference.subtract(new BigDecimal(actualDesignCost));
|
|
|
- supervisionDifference = supervisionDifference.subtract(new BigDecimal(actualSupervisionCost));
|
|
|
+ //应付设计费=设计费*费率
|
|
|
+ BigDecimal multiply = designRateDiff.multiply(designFeeDiff);
|
|
|
+ //应付设计费-实际设计费
|
|
|
+ BigDecimal designDifference = multiply.subtract(new BigDecimal(actualDesignCost));
|
|
|
+// supervisionDifference = supervisionDifference.subtract();
|
|
|
policyDifference = policyDifference.subtract(new BigDecimal(actualManagementFee));
|
|
|
otherDifference = otherDifference.subtract(new BigDecimal(actualOtherCost));
|
|
|
+ designRateDiff = designRateDiff.multiply(new BigDecimal(designFee));
|
|
|
+ //应付监理费=监理费*监理费费率
|
|
|
+ BigDecimal multiply1 = supervisionFeeDiff.multiply(supervisionRateDiff);
|
|
|
+ //应付-实际,监理差额
|
|
|
+ BigDecimal supervisionDifference = multiply1.subtract(new BigDecimal(actualSupervisionCost));
|
|
|
+
|
|
|
|
|
|
c.setProjectDifference(projectDifference.toString());
|
|
|
c.setConstructionDifference(constructionDifference.toString());
|
|
@@ -145,6 +197,8 @@ public class CapitalPlanController extends BaseController {
|
|
|
c.setSupervisionDifference(supervisionDifference.toString());
|
|
|
c.setPolicyDifference(policyDifference.toString());
|
|
|
c.setOtherDifference(otherDifference.toString());
|
|
|
+ c.setDesignPayFee(designRateDiff.toString());
|
|
|
+ c.setSupervisionPayFee(multiply1.toString());
|
|
|
|
|
|
}
|
|
|
return getBootstrapData(page);
|
|
@@ -159,31 +213,15 @@ public class CapitalPlanController extends BaseController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 查看,增加,编辑表单表单页面
|
|
|
- */
|
|
|
- @RequestMapping(value = "capitalPlanForm")
|
|
|
- public String basicInformationForm(Project project, Model model) {
|
|
|
- model.addAttribute("project", project);
|
|
|
- return "modules/sg/capitalPlan/basicInformationForm";
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
* 保存表单
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
- @RequestMapping(value = "saveCapitalPlan")
|
|
|
- public AjaxJson savePlan(Project project, Model model) throws Exception {
|
|
|
+ @RequestMapping(value = "saveEdit")
|
|
|
+ public AjaxJson saveEdit(CapitalPlan capitalPlan, Model model) throws Exception {
|
|
|
AjaxJson j = new AjaxJson();
|
|
|
- Boolean flag = false;
|
|
|
-
|
|
|
- String str = "";
|
|
|
- /**
|
|
|
- * 后台hibernate-validation插件校验
|
|
|
- */
|
|
|
- j.setSuccess(false);
|
|
|
- j.setMsg("项目流程运行中不可修改信息");
|
|
|
+ capitalPlanService.saveEdit(capitalPlan);
|
|
|
+ j.setSuccess(true);
|
|
|
+ j.setMsg("修改费率成功");
|
|
|
return j;
|
|
|
}
|
|
|
|