refactor(budget): 调整预算统计逻辑

- 移除 IncomeCostBean 中的成本项目管理税金相关计算
- 在 ProjectBudgetPlanDetail 中添加服务支出和其他支出的 transient 字段
- 更新 ProjectBudgetService 中的月度预算统计逻辑,增加项目管理成本和定金成本的计算
dev_1.0.0
chenhao 2024-10-28 11:30:42 +08:00
parent acf0b64c96
commit c8169c5093
3 changed files with 12 additions and 3 deletions

View File

@ -425,13 +425,13 @@ public abstract class IncomeCostBean {
BigDecimal costPurchaseBuildTaxInclude = getCostPurchaseBuildTaxInclude();
BigDecimal costPurchaseServiceTaxInclude = getCostPurchaseServiceTaxInclude();
BigDecimal costPurchaseOtherTaxInclude = getCostPurchaseOtherTaxInclude();
BigDecimal costProjectManageTaxInclude = getCostProjectManageTaxInclude();
// BigDecimal costProjectManageTaxInclude = getCostProjectManageTaxInclude();
BigDecimal costOtherOtherTaxInclude = getCostOtherOtherTaxInclude();
if (null == costPurchaseDeviceTaxInclude
|| null == costPurchaseBuildTaxInclude
|| null == costPurchaseServiceTaxInclude
|| null == costPurchaseOtherTaxInclude
|| null == costProjectManageTaxInclude
// || null == costProjectManageTaxInclude
|| null == costOtherOtherTaxInclude) {
return handleSpecial(null);
}
@ -439,7 +439,7 @@ public abstract class IncomeCostBean {
.add(costPurchaseBuildTaxInclude)
.add(costPurchaseServiceTaxInclude)
.add(costPurchaseOtherTaxInclude)
.add(costProjectManageTaxInclude)
// .add(costProjectManageTaxInclude)
.add(costOtherOtherTaxInclude);
}

View File

@ -12,12 +12,15 @@ import java.math.BigDecimal;
@Table(name = "project_budget_plan_detail")
@Data
public class ProjectBudgetPlanDetail extends ProjectBudgetPlanDetailBase{
//服务支出
@Transient
private BigDecimal serviceCost;
// private BigDecimal deviceCost;
// private BigDecimal projectCost;
//其它支出
@Transient
private BigDecimal otherCost;
}

View File

@ -674,6 +674,8 @@ public class ProjectBudgetService {
)
)
));
BigDecimal projectManageCost = new BigDecimal(0);
BigDecimal earnestMoneyCost = new BigDecimal(0);
BigDecimal deviceCost = new BigDecimal(0);
BigDecimal engineerCost = new BigDecimal(0);
BigDecimal serviceCost = new BigDecimal(0);
@ -694,6 +696,8 @@ public class ProjectBudgetService {
Map<String, BigDecimal> projectPayments = monthlyProjectPaymentSum.getOrDefault(month, Collections.emptyMap());
projectManageCost = projectManageCost.add(budgetPlan.getProjectManageCost());
earnestMoneyCost = earnestMoneyCost.add(budgetPlan.getEarnestMoneyCost());
deviceCost = deviceCost.add(projectPayments.getOrDefault("设备成本", BigDecimal.ZERO));
engineerCost = engineerCost.add(projectPayments.getOrDefault("工程成本", BigDecimal.ZERO));
serviceCost = serviceCost.add(projectPayments.getOrDefault("服务成本", BigDecimal.ZERO));
@ -719,6 +723,8 @@ public class ProjectBudgetService {
projectBudgetPlanDetail.setEngineerCost(engineerCost);
projectBudgetPlanDetail.setServiceCost(serviceCost); // 设置服务成本
projectBudgetPlanDetail.setOtherCost(otherCost); // 设置其他成本
projectBudgetPlanDetail.setProjectManageCost(projectManageCost);
projectBudgetPlanDetail.setEarnestMoneyCost(earnestMoneyCost);
projectBudgetPlanDetail.setTotalCost(totalCost);
projectBudgetPlanDetail.setSaleIncome(saleIncome);
projectBudgetPlanDetail.setEarnestMoneyIncome(earnestMoneyIncome);