预算格式化和空判断
parent
bdb3064ce8
commit
2afa992665
|
@ -117,6 +117,8 @@ public class ProjectController extends BaseController{
|
|||
model.put("project", project);
|
||||
EstimateBean estimateBean = projectEstimateService.getEstimate(project);
|
||||
model.put("estimateBean", estimateBean);
|
||||
//freemarker可以利用的静态方法
|
||||
model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils"));
|
||||
return "admin/project_estimate_edit";
|
||||
}
|
||||
@RequestMapping("/estimateEditSave")
|
||||
|
|
|
@ -142,49 +142,58 @@ public class ProjectEstimateService {
|
|||
EstimateBean estimateBean = new EstimateBean();
|
||||
List<ProjectEstimateIncome> incomes = projectEstimateIncomeRepository.findAllByProjectIdEquals(project.getId());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeDevice = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_DEVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeDeviceTaxInclude(projectEstimateIncomeDevice.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeDeviceTaxExclude(projectEstimateIncomeDevice.getIncomeTaxExclude());
|
||||
if(CollectionUtil.isNotEmpty(incomes)){
|
||||
ProjectEstimateIncome projectEstimateIncomeDevice = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_DEVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeDeviceTaxInclude(projectEstimateIncomeDevice.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeDeviceTaxExclude(projectEstimateIncomeDevice.getIncomeTaxExclude());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeEngineer = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_ENGINEER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeEngineerTaxInclude(projectEstimateIncomeEngineer.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeEngineerTaxExclude(projectEstimateIncomeEngineer.getIncomeTaxExclude());
|
||||
ProjectEstimateIncome projectEstimateIncomeEngineer = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_ENGINEER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeEngineerTaxInclude(projectEstimateIncomeEngineer.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeEngineerTaxExclude(projectEstimateIncomeEngineer.getIncomeTaxExclude());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeService = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_SERVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeServiceTaxInclude(projectEstimateIncomeService.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeServiceTaxExclude(projectEstimateIncomeService.getIncomeTaxExclude());
|
||||
}
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeService = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_SERVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeServiceTaxInclude(projectEstimateIncomeService.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeServiceTaxExclude(projectEstimateIncomeService.getIncomeTaxExclude());
|
||||
|
||||
List<ProjectEstimateCost> costs = projectEstimateCostRepository.findAllByProjectIdEquals(project.getId());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostDevice = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_DEVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseDeviceTaxInclude(projectEstimateCostDevice.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseDeviceTaxExclude(projectEstimateCostDevice.getCostTaxExclude());
|
||||
if(CollectionUtil.isNotEmpty(costs)){
|
||||
ProjectEstimateCost projectEstimateCostDevice = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_DEVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseDeviceTaxInclude(projectEstimateCostDevice.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseDeviceTaxExclude(projectEstimateCostDevice.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostBuild = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_BUILDING).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseBuildTaxInclude(projectEstimateCostBuild.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseBuildTaxExclude(projectEstimateCostBuild.getCostTaxExclude());
|
||||
ProjectEstimateCost projectEstimateCostBuild = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_BUILDING).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseBuildTaxInclude(projectEstimateCostBuild.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseBuildTaxExclude(projectEstimateCostBuild.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostService = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_SERVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseServiceTaxInclude(projectEstimateCostService.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseServiceTaxExclude(projectEstimateCostService.getCostTaxExclude());
|
||||
ProjectEstimateCost projectEstimateCostService = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_SERVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseServiceTaxInclude(projectEstimateCostService.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseServiceTaxExclude(projectEstimateCostService.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOther = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_OTHER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseOtherTaxInclude(projectEstimateCostOther.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseOtherTaxExclude(projectEstimateCostOther.getCostTaxExclude());
|
||||
ProjectEstimateCost projectEstimateCostOther = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_OTHER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseOtherTaxInclude(projectEstimateCostOther.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseOtherTaxExclude(projectEstimateCostOther.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostProjectManage = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_PROJECT_MANAGE).collect(Collectors.toList()).get(0);
|
||||
ProjectEstimateCost projectEstimateCostProjectManage = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_PROJECT_MANAGE).collect(Collectors.toList()).get(0);
|
||||
/*estimateBean.setCostProjectManageTaxInclude(projectEstimateCostProjectManage.getCostTaxInclude());*/
|
||||
estimateBean.setCostProjectManageTaxExclude(projectEstimateCostProjectManage.getCostTaxExclude());
|
||||
estimateBean.setCostProjectManageTaxExclude(projectEstimateCostProjectManage.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOtherOther = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_OTHER_OTHER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostOtherOtherTaxInclude(projectEstimateCostOtherOther.getCostTaxInclude());
|
||||
estimateBean.setCostOtherOtherTaxExclude(projectEstimateCostOtherOther.getCostTaxExclude());
|
||||
|
||||
}
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOtherOther = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_OTHER_OTHER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostOtherOtherTaxInclude(projectEstimateCostOtherOther.getCostTaxInclude());
|
||||
estimateBean.setCostOtherOtherTaxExclude(projectEstimateCostOtherOther.getCostTaxExclude());
|
||||
|
||||
List<ProjectEstimateCostManage> manages = projectEstimateCostManageRepository.findAllByProjectIdEquals(project.getId());
|
||||
ProjectEstimateCostManage costManageExpropriation = manages.stream().filter(d -> d.getType() == ProjectEstimateCostManage.TYPE_EXPROPRIATION).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostExpropriationTaxExclude(costManageExpropriation.getCostTaxExclude());
|
||||
ProjectEstimateCostManage costManageCompany = manages.stream().filter(d -> d.getType() == ProjectEstimateCostManage.TYPE_COMPANY_MANAGE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostCompanyManageTaxExclude(costManageCompany.getCostTaxExclude());
|
||||
if(CollectionUtil.isNotEmpty(manages)){
|
||||
ProjectEstimateCostManage costManageExpropriation = manages.stream().filter(d -> d.getType() == ProjectEstimateCostManage.TYPE_EXPROPRIATION).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostExpropriationTaxExclude(costManageExpropriation.getCostTaxExclude());
|
||||
ProjectEstimateCostManage costManageCompany = manages.stream().filter(d -> d.getType() == ProjectEstimateCostManage.TYPE_COMPANY_MANAGE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostCompanyManageTaxExclude(costManageCompany.getCostTaxExclude());
|
||||
}
|
||||
|
||||
return estimateBean;
|
||||
}
|
||||
|
|
|
@ -190,26 +190,26 @@
|
|||
<tr>
|
||||
<td>收入</td>
|
||||
<td>设备类</td>
|
||||
<td><input name="incomeDeviceTaxInclude" value="${estimateBean.incomeDeviceTaxInclude}" required></td>
|
||||
<td><input name="incomeDeviceTaxExclude" value="${estimateBean.incomeDeviceTaxExclude}" required></td>
|
||||
<td><input name="incomeDeviceTaxInclude" value="${Utils.format(estimateBean.incomeDeviceTaxInclude)}" required></td>
|
||||
<td><input name="incomeDeviceTaxExclude" value="${Utils.format(estimateBean.incomeDeviceTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收入</td>
|
||||
<td>工程类</td>
|
||||
<td><input name="incomeEngineerTaxInclude" value="${estimateBean.incomeEngineerTaxInclude}" required></td>
|
||||
<td><input name="incomeEngineerTaxExclude" value="${estimateBean.incomeEngineerTaxExclude}" required></td>
|
||||
<td><input name="incomeEngineerTaxInclude" value="${Utils.format(estimateBean.incomeEngineerTaxInclude)}" required></td>
|
||||
<td><input name="incomeEngineerTaxExclude" value="${Utils.format(estimateBean.incomeEngineerTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收入</td>
|
||||
<td>服务类</td>
|
||||
<td><input name="incomeServiceTaxInclude" value="${estimateBean.incomeServiceTaxInclude}" required></td>
|
||||
<td><input name="incomeServiceTaxExclude" value="${estimateBean.incomeServiceTaxExclude}" required></td>
|
||||
<td><input name="incomeServiceTaxInclude" value="${Utils.format(estimateBean.incomeServiceTaxInclude)}" required></td>
|
||||
<td><input name="incomeServiceTaxExclude" value="${Utils.format(estimateBean.incomeServiceTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>合计</td>
|
||||
<td></td>
|
||||
<td><input name="incomeTotalTaxInclude" value="${estimateBean.incomeTotalTaxInclude}" readonly title="此列累计"></td>
|
||||
<td><input name="incomeTotalTaxExclude" value="${estimateBean.incomeTotalTaxExclude}" readonly title="此列累计"></td>
|
||||
<td><input name="incomeTotalTaxInclude" value="${Utils.format(estimateBean.incomeTotalTaxInclude)}" readonly title="此列累计"></td>
|
||||
<td><input name="incomeTotalTaxExclude" value="${Utils.format(estimateBean.incomeTotalTaxExclude)}" readonly title="此列累计"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -227,50 +227,50 @@
|
|||
<td>成本</td>
|
||||
<td>采购成本</td>
|
||||
<td>设备</td>
|
||||
<td><input name="costPurchaseDeviceTaxInclude" value="${estimateBean.costPurchaseDeviceTaxInclude}" required></td>
|
||||
<td><input name="costPurchaseDeviceTaxExclude" value="${estimateBean.costPurchaseDeviceTaxExclude}" required></td>
|
||||
<td><input name="costPurchaseDeviceTaxInclude" value="${Utils.format(estimateBean.costPurchaseDeviceTaxInclude)}" required></td>
|
||||
<td><input name="costPurchaseDeviceTaxExclude" value="${Utils.format(estimateBean.costPurchaseDeviceTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>采购成本</td>
|
||||
<td>施工</td>
|
||||
<td><input name="costPurchaseBuildTaxInclude" value="${estimateBean.costPurchaseBuildTaxInclude}" required></td>
|
||||
<td><input name="costPurchaseBuildTaxExclude" value="${estimateBean.costPurchaseBuildTaxExclude}" required></td>
|
||||
<td><input name="costPurchaseBuildTaxInclude" value="${Utils.format(estimateBean.costPurchaseBuildTaxInclude)}" required></td>
|
||||
<td><input name="costPurchaseBuildTaxExclude" value="${Utils.format(estimateBean.costPurchaseBuildTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>采购成本</td>
|
||||
<td>服务</td>
|
||||
<td><input name="costPurchaseServiceTaxInclude" value="${estimateBean.costPurchaseServiceTaxInclude}" required></td>
|
||||
<td><input name="costPurchaseServiceTaxExclude" value="${estimateBean.costPurchaseServiceTaxExclude}" required></td>
|
||||
<td><input name="costPurchaseServiceTaxInclude" value="${Utils.format(estimateBean.costPurchaseServiceTaxInclude)}" required></td>
|
||||
<td><input name="costPurchaseServiceTaxExclude" value="${Utils.format(estimateBean.costPurchaseServiceTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>采购成本</td>
|
||||
<td>其他</td>
|
||||
<td><input name="costPurchaseOtherTaxInclude" value="${estimateBean.costPurchaseOtherTaxInclude}" required></td>
|
||||
<td><input name="costPurchaseOtherTaxExclude" value="${estimateBean.costPurchaseOtherTaxExclude}" required></td>
|
||||
<td><input name="costPurchaseOtherTaxInclude" value="${Utils.format(estimateBean.costPurchaseOtherTaxInclude)}" required></td>
|
||||
<td><input name="costPurchaseOtherTaxExclude" value="${Utils.format(estimateBean.costPurchaseOtherTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>项目管理成本</td>
|
||||
<td>项目管理成本</td>
|
||||
<td><#--<input name="costProjectManageTaxInclude" value="${estimateBean.costProjectManageTaxInclude}" required>-->/</td>
|
||||
<td><input name="costProjectManageTaxExclude" value="${estimateBean.costProjectManageTaxExclude}" required></td>
|
||||
<td><input name="costProjectManageTaxExclude" value="${Utils.format(estimateBean.costProjectManageTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>其他</td>
|
||||
<td>其他</td>
|
||||
<td><input name="costOtherOtherTaxInclude" value="${estimateBean.costOtherOtherTaxInclude}" required></td>
|
||||
<td><input name="costOtherOtherTaxExclude" value="${estimateBean.costOtherOtherTaxExclude}" required></td>
|
||||
<td><input name="costOtherOtherTaxInclude" value="${Utils.format(estimateBean.costOtherOtherTaxInclude)}" required></td>
|
||||
<td><input name="costOtherOtherTaxExclude" value="${Utils.format(estimateBean.costOtherOtherTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>合计</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><input name="costTotalTaxInclude" value="${estimateBean.costTotalTaxInclude}" readonly title="此列累计"></td>
|
||||
<td><input name="costTotalTaxExclude" value="${estimateBean.costTotalTaxExclude}" readonly title="此列累计"></td>
|
||||
<td><input name="costTotalTaxInclude" value="${Utils.format(estimateBean.costTotalTaxInclude)}" readonly title="此列累计"></td>
|
||||
<td><input name="costTotalTaxExclude" value="${Utils.format(estimateBean.costTotalTaxExclude)}" readonly title="此列累计"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -285,12 +285,12 @@
|
|||
<tr>
|
||||
<td>财务费用</td>
|
||||
<td>资金占用成本</td>
|
||||
<td><input name="costExpropriationTaxExclude" value="${estimateBean.costExpropriationTaxExclude}" required></td>
|
||||
<td><input name="costExpropriationTaxExclude" value="${Utils.format(estimateBean.costExpropriationTaxExclude)}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>公司管理费用</td>
|
||||
<td></td>
|
||||
<td><input name="costCompanyManageTaxExclude" value="${estimateBean.costCompanyManageTaxExclude}" required></td>
|
||||
<td><input name="costCompanyManageTaxExclude" value="${Utils.format(estimateBean.costCompanyManageTaxExclude)}" required></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -305,13 +305,13 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>项目毛利</td>
|
||||
<td><input name="projectGrossProfit" value="${estimateBean.projectGrossProfit}" readonly title="收入总计(不含税)-成本总计(不含税)-财务费用总计(不含税)"></td>
|
||||
<td><input name="projectGrossProfitRate" value="${estimateBean.projectGrossProfitRate}" readonly title="毛利(不含税)/收入总计(不含税)"></td>
|
||||
<td><input name="projectGrossProfit" value="${Utils.format(estimateBean.projectGrossProfit)}" readonly title="收入总计(不含税)-成本总计(不含税)-财务费用总计(不含税)"></td>
|
||||
<td><input name="projectGrossProfitRate" value="${Utils.format(estimateBean.projectGrossProfitRate)}" readonly title="毛利(不含税)/收入总计(不含税)"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>项目贡献利润率</td>
|
||||
<td><input name="projectContributionProfit" value="${estimateBean.projectContributionProfit}" readonly title="项目毛利(不含税)-公司管理费用总计(不含税)"></td>
|
||||
<td><input name="projectContributionProfitRate" value="${estimateBean.projectContributionProfitRate}" readonly title="贡献利润(不含税)/收入总计(不含税)"></td>
|
||||
<td><input name="projectContributionProfit" value="${Utils.format(estimateBean.projectContributionProfit)}" readonly title="项目毛利(不含税)-公司管理费用总计(不含税)"></td>
|
||||
<td><input name="projectContributionProfitRate" value="${Utils.format(estimateBean.projectContributionProfitRate)}" readonly title="贡献利润(不含税)/收入总计(不含税)"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue