diff --git a/src/main/java/cn/palmte/work/bean/FinalBean.java b/src/main/java/cn/palmte/work/bean/FinalBean.java index 9270c08..b3bc1a9 100644 --- a/src/main/java/cn/palmte/work/bean/FinalBean.java +++ b/src/main/java/cn/palmte/work/bean/FinalBean.java @@ -4,63 +4,18 @@ import java.math.BigDecimal; public class FinalBean { - //========================收入表================================ - /** - * 设备类概算总额 - */ - private BigDecimal incomeDeviceEstimateTotal; - - /** - * 设备类预算总额 - */ - private BigDecimal incomeDeviceBudgetTotal; - - /** - * 设备类结算总额 - */ - private BigDecimal incomeDeviceSettleTotal; /** * 设备类决算总额 */ private BigDecimal incomeDeviceFinalTotal; - /** - * 工程类概算总额 - */ - private BigDecimal incomeEngineerEstimateTotal; - - /** - * 工程类预算总额 - */ - private BigDecimal incomeEngineerBudgetTotal; - - /** - * 工程类结算总额 - */ - private BigDecimal incomeEngineerSettleTotal; - /** * 工程类决算总额 */ private BigDecimal incomeEngineerFinalTotal; - /** - * 服务类概算总额 - */ - private BigDecimal incomeServiceEstimateTotal; - - /** - * 服务类预算总额 - */ - private BigDecimal incomeServiceBudgetTotal; - - /** - * 服务类结算总额 - */ - private BigDecimal incomeServiceSettleTotal; - /** * 服务类决算总额 */ @@ -69,121 +24,31 @@ public class FinalBean { //========================成本表================================ - /** - *设备采购成本概算总额 - */ - private BigDecimal costPurchaseDeviceEstimateTotal; - - /** - *设备采购成本预算总额 - */ - private BigDecimal costPurchaseDeviceBudgetTotal; - - /** - *设备采购成本结算总额 - */ - private BigDecimal costPurchaseDeviceSettleTotal; - /** *设备采购成本决算总额 */ private BigDecimal costPurchaseDeviceFinalTotal; - /** - *施工采购成本概算总额 - */ - private BigDecimal costPurchaseBuildEstimateTotal; - - /** - *施工采购成本预算总额 - */ - private BigDecimal costPurchaseBuildBudgetTotal; - - /** - *施工采购成本结算总额 - */ - private BigDecimal costPurchaseBuildSettleTotal; - /** *施工采购成本决算总额 */ private BigDecimal costPurchaseBuildFinalTotal; - /** - *服务采购成本概算总额 - */ - private BigDecimal costPurchaseServiceEstimateTotal; - - /** - *服务采购成本预算总额 - */ - private BigDecimal costPurchaseServiceBudgetTotal; - - /** - *服务采购成本结算总额 - */ - private BigDecimal costPurchaseServiceSettleTotal; - /** *服务采购成本决算总额 */ private BigDecimal costPurchaseServiceFinalTotal; - /** - *其他采购成本概算总额 - */ - private BigDecimal costPurchaseOtherEstimateTotal; - - /** - *其他采购成本预算总额 - */ - private BigDecimal costPurchaseOtherBudgetTotal; - - /** - *其他采购成本结算总额 - */ - private BigDecimal costPurchaseOtherSettleTotal; - /** *其他采购成本决算总额 */ private BigDecimal costPurchaseOtherFinalTotal; - /** - * 项目管理成本概算总额 - */ - private BigDecimal costProjectManageEstimateTotal; - - /** - * 项目管理成本预算总额 - */ - private BigDecimal costProjectManageBudgetTotal; - - /** - * 项目管理成本结算总额 - */ - private BigDecimal costProjectManageSettleTotal; - /** * 项目管理成本决算总额 */ private BigDecimal costProjectManageFinalTotal; - /** - * 其他成本概算总额 - */ - private BigDecimal costOtherEstimateTotal; - - /** - * 其他成本预算总额 - */ - private BigDecimal costOtherBudgetTotal; - - /** - * 其他成本结算总额 - */ - private BigDecimal costOtherSettleTotal; - /** * 其他成本决算总额 */ @@ -192,51 +57,16 @@ public class FinalBean { //========================管理表================================ - /** - * 财务费用概算总额 - */ - private BigDecimal costExpropriationEstimateTotal; - - /** - * 财务费用预算总额 - */ - private BigDecimal costExpropriationBudgetTotal; - - /** - * 财务费用结算总额 - */ - private BigDecimal costExpropriationSettleTotal; - /** * 财务费用决算总额 */ private BigDecimal costExpropriationFinalTotal; - /** - * 公司管理费用概算总额 - */ - private BigDecimal costCompanyManageEstimateTotal; - - /** - * 公司管理费用预算总额 - */ - private BigDecimal costCompanyManageBudgetTotal; - - /** - * 公司管理费用结算总额 - */ - private BigDecimal costCompanyManageSettleTotal; - /** * 公司管理费用决算总额 */ private BigDecimal costCompanyManageFinalTotal; - /** - * 所得税费用结算总额 - */ - private BigDecimal costIncomeTaxSettleTotal; - /** * 所得税费用决算总额 */ @@ -245,21 +75,6 @@ public class FinalBean { //========================利润率计算表================================ - /** - * 项目毛利概算总额 - */ - private BigDecimal grossProfitEstimateTotal; - - /** - * 项目毛利预算总额 - */ - private BigDecimal grossProfitBudgetTotal; - - /** - * 项目毛利结算总额 - */ - private BigDecimal grossProfitSettleTotal; - /** * 项目毛利决算总额 */ @@ -270,21 +85,6 @@ public class FinalBean { */ private BigDecimal grossProfitProfitMargin; - /** - * 项目贡献利润概算总额 - */ - private BigDecimal contributionMarginEstimateTotal; - - /** - * 项目贡献利润预算总额 - */ - private BigDecimal contributionMarginBudgetTotal; - - /** - * 项目贡献利润结算总额 - */ - private BigDecimal contributionMarginSettleTotal; - /** * 项目贡献利润决算总额 */ @@ -295,21 +95,6 @@ public class FinalBean { */ private BigDecimal contributionMarginProfitMargin; - /** - * 项目净利润概算总额 - */ - private BigDecimal netMarginEstimateTotal; - - /** - * 项目净利润预算总额 - */ - private BigDecimal netMarginBudgetTotal; - - /** - * 项目净利润结算总额 - */ - private BigDecimal netMarginSettleTotal; - /** * 项目净利润决算总额 */ @@ -320,242 +105,67 @@ public class FinalBean { */ private BigDecimal netMarginProfitMargin; - //========================结算现金流量表================================ /** - * 销售商品、提供劳务收到的现金 预算总额 - */ - private BigDecimal type1BudgetTotal; - + * a销售商品、提供劳务收到的现金 + * */ + private BigDecimal saleIncomeCash; /** - * 销售商品、提供劳务收到的现金 结算总额 - */ - private BigDecimal type1SettleTotal; - + * b收到的税费返还 + * */ + private BigDecimal taxReturn; /** - * 销售商品、提供劳务收到的现金 决算总额 + * c其他与经营活动有关的现金【保证金收入】 */ - private BigDecimal type1FinalTotal; - + private BigDecimal earnestMoneyIncome; /** - * 收到的税费返还 预算总额 + * d购买商品、接受劳务支付的现金【设备支出+工程支出】 */ - private BigDecimal type2BudgetTotal; - + private BigDecimal purchaseCost; /** - * 收到的税费返还 结算总额 + * e支付的各项税费 */ - private BigDecimal type2SettleTotal; - + private BigDecimal taxCost; /** - * 收到的税费返还 决算总额 + *f支付其他与经营活动有关的现金 */ - private BigDecimal type2FinalTotal; - + private BigDecimal earnestMoneyCost; /** - * 收到其他与经营活动有关的现金 预算总额 + * g经营活动产生的现金流量净额 + * g=a+c+b-d-f-e */ - private BigDecimal type3BudgetTotal; - + private BigDecimal netCashFlow; /** - * 收到其他与经营活动有关的现金 结算总额 + * h投资活动现金流入 */ - private BigDecimal type3SettleTotal; - + private BigDecimal cashInflowFromInvestingActivities; /** - * 收到其他与经营活动有关的现金 决算总额 + * i投资活动现金流出 */ - private BigDecimal type3FinalTotal; - + private BigDecimal cashOutflowFromInvestingActivities; /** - * 购买商品、接受劳务支付的现金 预算总额 + * j投资活动产生的现金流量净额 */ - private BigDecimal type4BudgetTotal; - + private BigDecimal netCashFromInvestingActivities; /** - * 购买商品、接受劳务支付的现金 结算总额 + * k融资资金流入【垫资计划】 */ - private BigDecimal type4SettleTotal; - + private BigDecimal financingCapitalInflow; /** - * 购买商品、接受劳务支付的现金 决算总额 + * l融资资金流出【还款计划】 */ - private BigDecimal type4FinalTotal; - + private BigDecimal financingCapitalOutflow; /** - * 支付的各项税费 预算总额 + *m筹资活动产生的现金流量净额 + * m=k-l */ - private BigDecimal type5BudgetTotal; - + private BigDecimal financingCapitalCashflow; /** - * 支付的各项税费 结算总额 + * n货币资金净增加额 + * n=g+j+m */ - private BigDecimal type5SettleTotal; - - /** - * 支付的各项税费 决算总额 - */ - private BigDecimal type5FinalTotal; - - /** - * 支付其他与经营活动有关的现金 预算总额 - */ - private BigDecimal type6BudgetTotal; - - /** - * 支付其他与经营活动有关的现金 结算总额 - */ - private BigDecimal type6SettleTotal; - - /** - * 支付其他与经营活动有关的现金 决算总额 - */ - private BigDecimal type6FinalTotal; - - /** - * 经营活动产生的现金流量净额 预算总额 - */ - private BigDecimal type7BudgetTotal; - - /** - * 经营活动产生的现金流量净额 结算总额 - */ - private BigDecimal type7SettleTotal; - - /** - * 经营活动产生的现金流量净额 决算总额 - */ - private BigDecimal type7FinalTotal; - - /** - * 投资活动现金流入 预算总额 - */ - private BigDecimal type8BudgetTotal; - - /** - * 投资活动现金流入 结算总额 - */ - private BigDecimal type8SettleTotal; - - /** - * 投资活动现金流入 决算总额 - */ - private BigDecimal type8FinalTotal; - - /** - * 投资活动现金流出 预算总额 - */ - private BigDecimal type9BudgetTotal; - - /** - * 投资活动现金流出 结算总额 - */ - private BigDecimal type9SettleTotal; - - /** - * 投资活动现金流出 决算总额 - */ - private BigDecimal type9FinalTotal; - - /** - * 投资活动产生的现金流量净额 预算总额 - */ - private BigDecimal type10BudgetTotal; - - /** - * 投资活动产生的现金流量净额 结算总额 - */ - private BigDecimal type10SettleTotal; - - /** - * 投资活动产生的现金流量净额 决算总额 - */ - private BigDecimal type10FinalTotal; - - /** - * 融资资金流入 预算总额 - */ - private BigDecimal type11BudgetTotal; - - /** - * 融资资金流入 结算总额 - */ - private BigDecimal type11SettleTotal; - - /** - * 融资资金流入 决算总额 - */ - private BigDecimal type11FinalTotal; - - /** - * 还款资金流出 预算总额 - */ - private BigDecimal type12BudgetTotal; - - /** - * 还款资金流出 结算总额 - */ - private BigDecimal type12SettleTotal; - - /** - * 还款资金流出 决算总额 - */ - private BigDecimal type12FinalTotal; - - /** - * 筹资活动产生的现金流量净额 预算总额 - */ - private BigDecimal type13BudgetTotal; - - /** - * 筹资活动产生的现金流量净额 结算总额 - */ - private BigDecimal type13SettleTotal; - - /** - * 筹资活动产生的现金流量净额 决算总额 - */ - private BigDecimal type13FinalTotal; - - /** - * 货币资金净增加额 预算总额 - */ - private BigDecimal type14BudgetTotal; - - /** - * 货币资金净增加额 结算总额 - */ - private BigDecimal type14SettleTotal; - - /** - * 货币资金净增加额 决算总额 - */ - private BigDecimal type14FinalTotal; - - public BigDecimal getIncomeDeviceEstimateTotal() { - return incomeDeviceEstimateTotal; - } - - public void setIncomeDeviceEstimateTotal(BigDecimal incomeDeviceEstimateTotal) { - this.incomeDeviceEstimateTotal = incomeDeviceEstimateTotal; - } - - public BigDecimal getIncomeDeviceBudgetTotal() { - return incomeDeviceBudgetTotal; - } - - public void setIncomeDeviceBudgetTotal(BigDecimal incomeDeviceBudgetTotal) { - this.incomeDeviceBudgetTotal = incomeDeviceBudgetTotal; - } - - public BigDecimal getIncomeDeviceSettleTotal() { - return incomeDeviceSettleTotal; - } - - public void setIncomeDeviceSettleTotal(BigDecimal incomeDeviceSettleTotal) { - this.incomeDeviceSettleTotal = incomeDeviceSettleTotal; - } + private BigDecimal netIncreaseMonetaryFunds; public BigDecimal getIncomeDeviceFinalTotal() { return incomeDeviceFinalTotal; @@ -565,30 +175,6 @@ public class FinalBean { this.incomeDeviceFinalTotal = incomeDeviceFinalTotal; } - public BigDecimal getIncomeEngineerEstimateTotal() { - return incomeEngineerEstimateTotal; - } - - public void setIncomeEngineerEstimateTotal(BigDecimal incomeEngineerEstimateTotal) { - this.incomeEngineerEstimateTotal = incomeEngineerEstimateTotal; - } - - public BigDecimal getIncomeEngineerBudgetTotal() { - return incomeEngineerBudgetTotal; - } - - public void setIncomeEngineerBudgetTotal(BigDecimal incomeEngineerBudgetTotal) { - this.incomeEngineerBudgetTotal = incomeEngineerBudgetTotal; - } - - public BigDecimal getIncomeEngineerSettleTotal() { - return incomeEngineerSettleTotal; - } - - public void setIncomeEngineerSettleTotal(BigDecimal incomeEngineerSettleTotal) { - this.incomeEngineerSettleTotal = incomeEngineerSettleTotal; - } - public BigDecimal getIncomeEngineerFinalTotal() { return incomeEngineerFinalTotal; } @@ -597,30 +183,6 @@ public class FinalBean { this.incomeEngineerFinalTotal = incomeEngineerFinalTotal; } - public BigDecimal getIncomeServiceEstimateTotal() { - return incomeServiceEstimateTotal; - } - - public void setIncomeServiceEstimateTotal(BigDecimal incomeServiceEstimateTotal) { - this.incomeServiceEstimateTotal = incomeServiceEstimateTotal; - } - - public BigDecimal getIncomeServiceBudgetTotal() { - return incomeServiceBudgetTotal; - } - - public void setIncomeServiceBudgetTotal(BigDecimal incomeServiceBudgetTotal) { - this.incomeServiceBudgetTotal = incomeServiceBudgetTotal; - } - - public BigDecimal getIncomeServiceSettleTotal() { - return incomeServiceSettleTotal; - } - - public void setIncomeServiceSettleTotal(BigDecimal incomeServiceSettleTotal) { - this.incomeServiceSettleTotal = incomeServiceSettleTotal; - } - public BigDecimal getIncomeServiceFinalTotal() { return incomeServiceFinalTotal; } @@ -629,30 +191,6 @@ public class FinalBean { this.incomeServiceFinalTotal = incomeServiceFinalTotal; } - public BigDecimal getCostPurchaseDeviceEstimateTotal() { - return costPurchaseDeviceEstimateTotal; - } - - public void setCostPurchaseDeviceEstimateTotal(BigDecimal costPurchaseDeviceEstimateTotal) { - this.costPurchaseDeviceEstimateTotal = costPurchaseDeviceEstimateTotal; - } - - public BigDecimal getCostPurchaseDeviceBudgetTotal() { - return costPurchaseDeviceBudgetTotal; - } - - public void setCostPurchaseDeviceBudgetTotal(BigDecimal costPurchaseDeviceBudgetTotal) { - this.costPurchaseDeviceBudgetTotal = costPurchaseDeviceBudgetTotal; - } - - public BigDecimal getCostPurchaseDeviceSettleTotal() { - return costPurchaseDeviceSettleTotal; - } - - public void setCostPurchaseDeviceSettleTotal(BigDecimal costPurchaseDeviceSettleTotal) { - this.costPurchaseDeviceSettleTotal = costPurchaseDeviceSettleTotal; - } - public BigDecimal getCostPurchaseDeviceFinalTotal() { return costPurchaseDeviceFinalTotal; } @@ -661,30 +199,6 @@ public class FinalBean { this.costPurchaseDeviceFinalTotal = costPurchaseDeviceFinalTotal; } - public BigDecimal getCostPurchaseBuildEstimateTotal() { - return costPurchaseBuildEstimateTotal; - } - - public void setCostPurchaseBuildEstimateTotal(BigDecimal costPurchaseBuildEstimateTotal) { - this.costPurchaseBuildEstimateTotal = costPurchaseBuildEstimateTotal; - } - - public BigDecimal getCostPurchaseBuildBudgetTotal() { - return costPurchaseBuildBudgetTotal; - } - - public void setCostPurchaseBuildBudgetTotal(BigDecimal costPurchaseBuildBudgetTotal) { - this.costPurchaseBuildBudgetTotal = costPurchaseBuildBudgetTotal; - } - - public BigDecimal getCostPurchaseBuildSettleTotal() { - return costPurchaseBuildSettleTotal; - } - - public void setCostPurchaseBuildSettleTotal(BigDecimal costPurchaseBuildSettleTotal) { - this.costPurchaseBuildSettleTotal = costPurchaseBuildSettleTotal; - } - public BigDecimal getCostPurchaseBuildFinalTotal() { return costPurchaseBuildFinalTotal; } @@ -693,30 +207,6 @@ public class FinalBean { this.costPurchaseBuildFinalTotal = costPurchaseBuildFinalTotal; } - public BigDecimal getCostPurchaseServiceEstimateTotal() { - return costPurchaseServiceEstimateTotal; - } - - public void setCostPurchaseServiceEstimateTotal(BigDecimal costPurchaseServiceEstimateTotal) { - this.costPurchaseServiceEstimateTotal = costPurchaseServiceEstimateTotal; - } - - public BigDecimal getCostPurchaseServiceBudgetTotal() { - return costPurchaseServiceBudgetTotal; - } - - public void setCostPurchaseServiceBudgetTotal(BigDecimal costPurchaseServiceBudgetTotal) { - this.costPurchaseServiceBudgetTotal = costPurchaseServiceBudgetTotal; - } - - public BigDecimal getCostPurchaseServiceSettleTotal() { - return costPurchaseServiceSettleTotal; - } - - public void setCostPurchaseServiceSettleTotal(BigDecimal costPurchaseServiceSettleTotal) { - this.costPurchaseServiceSettleTotal = costPurchaseServiceSettleTotal; - } - public BigDecimal getCostPurchaseServiceFinalTotal() { return costPurchaseServiceFinalTotal; } @@ -725,30 +215,6 @@ public class FinalBean { this.costPurchaseServiceFinalTotal = costPurchaseServiceFinalTotal; } - public BigDecimal getCostPurchaseOtherEstimateTotal() { - return costPurchaseOtherEstimateTotal; - } - - public void setCostPurchaseOtherEstimateTotal(BigDecimal costPurchaseOtherEstimateTotal) { - this.costPurchaseOtherEstimateTotal = costPurchaseOtherEstimateTotal; - } - - public BigDecimal getCostPurchaseOtherBudgetTotal() { - return costPurchaseOtherBudgetTotal; - } - - public void setCostPurchaseOtherBudgetTotal(BigDecimal costPurchaseOtherBudgetTotal) { - this.costPurchaseOtherBudgetTotal = costPurchaseOtherBudgetTotal; - } - - public BigDecimal getCostPurchaseOtherSettleTotal() { - return costPurchaseOtherSettleTotal; - } - - public void setCostPurchaseOtherSettleTotal(BigDecimal costPurchaseOtherSettleTotal) { - this.costPurchaseOtherSettleTotal = costPurchaseOtherSettleTotal; - } - public BigDecimal getCostPurchaseOtherFinalTotal() { return costPurchaseOtherFinalTotal; } @@ -757,30 +223,6 @@ public class FinalBean { this.costPurchaseOtherFinalTotal = costPurchaseOtherFinalTotal; } - public BigDecimal getCostProjectManageEstimateTotal() { - return costProjectManageEstimateTotal; - } - - public void setCostProjectManageEstimateTotal(BigDecimal costProjectManageEstimateTotal) { - this.costProjectManageEstimateTotal = costProjectManageEstimateTotal; - } - - public BigDecimal getCostProjectManageBudgetTotal() { - return costProjectManageBudgetTotal; - } - - public void setCostProjectManageBudgetTotal(BigDecimal costProjectManageBudgetTotal) { - this.costProjectManageBudgetTotal = costProjectManageBudgetTotal; - } - - public BigDecimal getCostProjectManageSettleTotal() { - return costProjectManageSettleTotal; - } - - public void setCostProjectManageSettleTotal(BigDecimal costProjectManageSettleTotal) { - this.costProjectManageSettleTotal = costProjectManageSettleTotal; - } - public BigDecimal getCostProjectManageFinalTotal() { return costProjectManageFinalTotal; } @@ -789,30 +231,6 @@ public class FinalBean { this.costProjectManageFinalTotal = costProjectManageFinalTotal; } - public BigDecimal getCostOtherEstimateTotal() { - return costOtherEstimateTotal; - } - - public void setCostOtherEstimateTotal(BigDecimal costOtherEstimateTotal) { - this.costOtherEstimateTotal = costOtherEstimateTotal; - } - - public BigDecimal getCostOtherBudgetTotal() { - return costOtherBudgetTotal; - } - - public void setCostOtherBudgetTotal(BigDecimal costOtherBudgetTotal) { - this.costOtherBudgetTotal = costOtherBudgetTotal; - } - - public BigDecimal getCostOtherSettleTotal() { - return costOtherSettleTotal; - } - - public void setCostOtherSettleTotal(BigDecimal costOtherSettleTotal) { - this.costOtherSettleTotal = costOtherSettleTotal; - } - public BigDecimal getCostOtherFinalTotal() { return costOtherFinalTotal; } @@ -821,30 +239,6 @@ public class FinalBean { this.costOtherFinalTotal = costOtherFinalTotal; } - public BigDecimal getCostExpropriationEstimateTotal() { - return costExpropriationEstimateTotal; - } - - public void setCostExpropriationEstimateTotal(BigDecimal costExpropriationEstimateTotal) { - this.costExpropriationEstimateTotal = costExpropriationEstimateTotal; - } - - public BigDecimal getCostExpropriationBudgetTotal() { - return costExpropriationBudgetTotal; - } - - public void setCostExpropriationBudgetTotal(BigDecimal costExpropriationBudgetTotal) { - this.costExpropriationBudgetTotal = costExpropriationBudgetTotal; - } - - public BigDecimal getCostExpropriationSettleTotal() { - return costExpropriationSettleTotal; - } - - public void setCostExpropriationSettleTotal(BigDecimal costExpropriationSettleTotal) { - this.costExpropriationSettleTotal = costExpropriationSettleTotal; - } - public BigDecimal getCostExpropriationFinalTotal() { return costExpropriationFinalTotal; } @@ -853,30 +247,6 @@ public class FinalBean { this.costExpropriationFinalTotal = costExpropriationFinalTotal; } - public BigDecimal getCostCompanyManageEstimateTotal() { - return costCompanyManageEstimateTotal; - } - - public void setCostCompanyManageEstimateTotal(BigDecimal costCompanyManageEstimateTotal) { - this.costCompanyManageEstimateTotal = costCompanyManageEstimateTotal; - } - - public BigDecimal getCostCompanyManageBudgetTotal() { - return costCompanyManageBudgetTotal; - } - - public void setCostCompanyManageBudgetTotal(BigDecimal costCompanyManageBudgetTotal) { - this.costCompanyManageBudgetTotal = costCompanyManageBudgetTotal; - } - - public BigDecimal getCostCompanyManageSettleTotal() { - return costCompanyManageSettleTotal; - } - - public void setCostCompanyManageSettleTotal(BigDecimal costCompanyManageSettleTotal) { - this.costCompanyManageSettleTotal = costCompanyManageSettleTotal; - } - public BigDecimal getCostCompanyManageFinalTotal() { return costCompanyManageFinalTotal; } @@ -885,14 +255,6 @@ public class FinalBean { this.costCompanyManageFinalTotal = costCompanyManageFinalTotal; } - public BigDecimal getCostIncomeTaxSettleTotal() { - return costIncomeTaxSettleTotal; - } - - public void setCostIncomeTaxSettleTotal(BigDecimal costIncomeTaxSettleTotal) { - this.costIncomeTaxSettleTotal = costIncomeTaxSettleTotal; - } - public BigDecimal getCostIncomeTaxFinalTotal() { return costIncomeTaxFinalTotal; } @@ -901,30 +263,6 @@ public class FinalBean { this.costIncomeTaxFinalTotal = costIncomeTaxFinalTotal; } - public BigDecimal getGrossProfitEstimateTotal() { - return grossProfitEstimateTotal; - } - - public void setGrossProfitEstimateTotal(BigDecimal grossProfitEstimateTotal) { - this.grossProfitEstimateTotal = grossProfitEstimateTotal; - } - - public BigDecimal getGrossProfitBudgetTotal() { - return grossProfitBudgetTotal; - } - - public void setGrossProfitBudgetTotal(BigDecimal grossProfitBudgetTotal) { - this.grossProfitBudgetTotal = grossProfitBudgetTotal; - } - - public BigDecimal getGrossProfitSettleTotal() { - return grossProfitSettleTotal; - } - - public void setGrossProfitSettleTotal(BigDecimal grossProfitSettleTotal) { - this.grossProfitSettleTotal = grossProfitSettleTotal; - } - public BigDecimal getGrossProfitFinalTotal() { return grossProfitFinalTotal; } @@ -941,30 +279,6 @@ public class FinalBean { this.grossProfitProfitMargin = grossProfitProfitMargin; } - public BigDecimal getContributionMarginEstimateTotal() { - return contributionMarginEstimateTotal; - } - - public void setContributionMarginEstimateTotal(BigDecimal contributionMarginEstimateTotal) { - this.contributionMarginEstimateTotal = contributionMarginEstimateTotal; - } - - public BigDecimal getContributionMarginBudgetTotal() { - return contributionMarginBudgetTotal; - } - - public void setContributionMarginBudgetTotal(BigDecimal contributionMarginBudgetTotal) { - this.contributionMarginBudgetTotal = contributionMarginBudgetTotal; - } - - public BigDecimal getContributionMarginSettleTotal() { - return contributionMarginSettleTotal; - } - - public void setContributionMarginSettleTotal(BigDecimal contributionMarginSettleTotal) { - this.contributionMarginSettleTotal = contributionMarginSettleTotal; - } - public BigDecimal getContributionMarginFinalTotal() { return contributionMarginFinalTotal; } @@ -981,30 +295,6 @@ public class FinalBean { this.contributionMarginProfitMargin = contributionMarginProfitMargin; } - public BigDecimal getNetMarginEstimateTotal() { - return netMarginEstimateTotal; - } - - public void setNetMarginEstimateTotal(BigDecimal netMarginEstimateTotal) { - this.netMarginEstimateTotal = netMarginEstimateTotal; - } - - public BigDecimal getNetMarginBudgetTotal() { - return netMarginBudgetTotal; - } - - public void setNetMarginBudgetTotal(BigDecimal netMarginBudgetTotal) { - this.netMarginBudgetTotal = netMarginBudgetTotal; - } - - public BigDecimal getNetMarginSettleTotal() { - return netMarginSettleTotal; - } - - public void setNetMarginSettleTotal(BigDecimal netMarginSettleTotal) { - this.netMarginSettleTotal = netMarginSettleTotal; - } - public BigDecimal getNetMarginFinalTotal() { return netMarginFinalTotal; } @@ -1021,339 +311,115 @@ public class FinalBean { this.netMarginProfitMargin = netMarginProfitMargin; } - public BigDecimal getType1BudgetTotal() { - return type1BudgetTotal; + public BigDecimal getSaleIncomeCash() { + return saleIncomeCash; } - public void setType1BudgetTotal(BigDecimal type1BudgetTotal) { - this.type1BudgetTotal = type1BudgetTotal; + public void setSaleIncomeCash(BigDecimal saleIncomeCash) { + this.saleIncomeCash = saleIncomeCash; } - public BigDecimal getType1SettleTotal() { - return type1SettleTotal; + public BigDecimal getTaxReturn() { + return taxReturn; } - public void setType1SettleTotal(BigDecimal type1SettleTotal) { - this.type1SettleTotal = type1SettleTotal; + public void setTaxReturn(BigDecimal taxReturn) { + this.taxReturn = taxReturn; } - public BigDecimal getType1FinalTotal() { - return type1FinalTotal; + public BigDecimal getEarnestMoneyIncome() { + return earnestMoneyIncome; } - public void setType1FinalTotal(BigDecimal type1FinalTotal) { - this.type1FinalTotal = type1FinalTotal; + public void setEarnestMoneyIncome(BigDecimal earnestMoneyIncome) { + this.earnestMoneyIncome = earnestMoneyIncome; } - public BigDecimal getType2BudgetTotal() { - return type2BudgetTotal; + public BigDecimal getPurchaseCost() { + return purchaseCost; } - public void setType2BudgetTotal(BigDecimal type2BudgetTotal) { - this.type2BudgetTotal = type2BudgetTotal; + public void setPurchaseCost(BigDecimal purchaseCost) { + this.purchaseCost = purchaseCost; } - public BigDecimal getType2SettleTotal() { - return type2SettleTotal; + public BigDecimal getTaxCost() { + return taxCost; } - public void setType2SettleTotal(BigDecimal type2SettleTotal) { - this.type2SettleTotal = type2SettleTotal; + public void setTaxCost(BigDecimal taxCost) { + this.taxCost = taxCost; } - public BigDecimal getType2FinalTotal() { - return type2FinalTotal; + public BigDecimal getEarnestMoneyCost() { + return earnestMoneyCost; } - public void setType2FinalTotal(BigDecimal type2FinalTotal) { - this.type2FinalTotal = type2FinalTotal; + public void setEarnestMoneyCost(BigDecimal earnestMoneyCost) { + this.earnestMoneyCost = earnestMoneyCost; } - public BigDecimal getType3BudgetTotal() { - return type3BudgetTotal; + public BigDecimal getCashInflowFromInvestingActivities() { + return cashInflowFromInvestingActivities; } - public void setType3BudgetTotal(BigDecimal type3BudgetTotal) { - this.type3BudgetTotal = type3BudgetTotal; + public void setCashInflowFromInvestingActivities(BigDecimal cashInflowFromInvestingActivities) { + this.cashInflowFromInvestingActivities = cashInflowFromInvestingActivities; } - public BigDecimal getType3SettleTotal() { - return type3SettleTotal; + public BigDecimal getCashOutflowFromInvestingActivities() { + return cashOutflowFromInvestingActivities; } - public void setType3SettleTotal(BigDecimal type3SettleTotal) { - this.type3SettleTotal = type3SettleTotal; + public void setCashOutflowFromInvestingActivities(BigDecimal cashOutflowFromInvestingActivities) { + this.cashOutflowFromInvestingActivities = cashOutflowFromInvestingActivities; } - public BigDecimal getType3FinalTotal() { - return type3FinalTotal; + public BigDecimal getNetCashFromInvestingActivities() { + return netCashFromInvestingActivities; } - public void setType3FinalTotal(BigDecimal type3FinalTotal) { - this.type3FinalTotal = type3FinalTotal; + public void setNetCashFromInvestingActivities(BigDecimal netCashFromInvestingActivities) { + this.netCashFromInvestingActivities = netCashFromInvestingActivities; } - public BigDecimal getType4BudgetTotal() { - return type4BudgetTotal; + public BigDecimal getFinancingCapitalInflow() { + return financingCapitalInflow; } - public void setType4BudgetTotal(BigDecimal type4BudgetTotal) { - this.type4BudgetTotal = type4BudgetTotal; + public void setFinancingCapitalInflow(BigDecimal financingCapitalInflow) { + this.financingCapitalInflow = financingCapitalInflow; } - public BigDecimal getType4SettleTotal() { - return type4SettleTotal; + public BigDecimal getFinancingCapitalOutflow() { + return financingCapitalOutflow; } - public void setType4SettleTotal(BigDecimal type4SettleTotal) { - this.type4SettleTotal = type4SettleTotal; + public void setFinancingCapitalOutflow(BigDecimal financingCapitalOutflow) { + this.financingCapitalOutflow = financingCapitalOutflow; } - public BigDecimal getType4FinalTotal() { - return type4FinalTotal; + public BigDecimal getFinancingCapitalCashflow() { + return financingCapitalCashflow; } - public void setType4FinalTotal(BigDecimal type4FinalTotal) { - this.type4FinalTotal = type4FinalTotal; + public void setFinancingCapitalCashflow(BigDecimal financingCapitalCashflow) { + this.financingCapitalCashflow = financingCapitalCashflow; } - public BigDecimal getType5BudgetTotal() { - return type5BudgetTotal; + public BigDecimal getNetIncreaseMonetaryFunds() { + return netIncreaseMonetaryFunds; } - public void setType5BudgetTotal(BigDecimal type5BudgetTotal) { - this.type5BudgetTotal = type5BudgetTotal; + public void setNetIncreaseMonetaryFunds(BigDecimal netIncreaseMonetaryFunds) { + this.netIncreaseMonetaryFunds = netIncreaseMonetaryFunds; } - public BigDecimal getType5SettleTotal() { - return type5SettleTotal; + public BigDecimal getNetCashFlow() { + return netCashFlow; } - public void setType5SettleTotal(BigDecimal type5SettleTotal) { - this.type5SettleTotal = type5SettleTotal; - } - - public BigDecimal getType5FinalTotal() { - return type5FinalTotal; - } - - public void setType5FinalTotal(BigDecimal type5FinalTotal) { - this.type5FinalTotal = type5FinalTotal; - } - - public BigDecimal getType6BudgetTotal() { - return type6BudgetTotal; - } - - public void setType6BudgetTotal(BigDecimal type6BudgetTotal) { - this.type6BudgetTotal = type6BudgetTotal; - } - - public BigDecimal getType6SettleTotal() { - return type6SettleTotal; - } - - public void setType6SettleTotal(BigDecimal type6SettleTotal) { - this.type6SettleTotal = type6SettleTotal; - } - - public BigDecimal getType6FinalTotal() { - return type6FinalTotal; - } - - public void setType6FinalTotal(BigDecimal type6FinalTotal) { - this.type6FinalTotal = type6FinalTotal; - } - - public BigDecimal getType7BudgetTotal() { - return type7BudgetTotal; - } - - public void setType7BudgetTotal(BigDecimal type7BudgetTotal) { - this.type7BudgetTotal = type7BudgetTotal; - } - - public BigDecimal getType7SettleTotal() { - return type7SettleTotal; - } - - public void setType7SettleTotal(BigDecimal type7SettleTotal) { - this.type7SettleTotal = type7SettleTotal; - } - - public BigDecimal getType7FinalTotal() { - return type7FinalTotal; - } - - public void setType7FinalTotal(BigDecimal type7FinalTotal) { - this.type7FinalTotal = type7FinalTotal; - } - - public BigDecimal getType8BudgetTotal() { - return type8BudgetTotal; - } - - public void setType8BudgetTotal(BigDecimal type8BudgetTotal) { - this.type8BudgetTotal = type8BudgetTotal; - } - - public BigDecimal getType8SettleTotal() { - return type8SettleTotal; - } - - public void setType8SettleTotal(BigDecimal type8SettleTotal) { - this.type8SettleTotal = type8SettleTotal; - } - - public BigDecimal getType8FinalTotal() { - return type8FinalTotal; - } - - public void setType8FinalTotal(BigDecimal type8FinalTotal) { - this.type8FinalTotal = type8FinalTotal; - } - - public BigDecimal getType9BudgetTotal() { - return type9BudgetTotal; - } - - public void setType9BudgetTotal(BigDecimal type9BudgetTotal) { - this.type9BudgetTotal = type9BudgetTotal; - } - - public BigDecimal getType9SettleTotal() { - return type9SettleTotal; - } - - public void setType9SettleTotal(BigDecimal type9SettleTotal) { - this.type9SettleTotal = type9SettleTotal; - } - - public BigDecimal getType9FinalTotal() { - return type9FinalTotal; - } - - public void setType9FinalTotal(BigDecimal type9FinalTotal) { - this.type9FinalTotal = type9FinalTotal; - } - - public BigDecimal getType10BudgetTotal() { - return type10BudgetTotal; - } - - public void setType10BudgetTotal(BigDecimal type10BudgetTotal) { - this.type10BudgetTotal = type10BudgetTotal; - } - - public BigDecimal getType10SettleTotal() { - return type10SettleTotal; - } - - public void setType10SettleTotal(BigDecimal type10SettleTotal) { - this.type10SettleTotal = type10SettleTotal; - } - - public BigDecimal getType10FinalTotal() { - return type10FinalTotal; - } - - public void setType10FinalTotal(BigDecimal type10FinalTotal) { - this.type10FinalTotal = type10FinalTotal; - } - - public BigDecimal getType11BudgetTotal() { - return type11BudgetTotal; - } - - public void setType11BudgetTotal(BigDecimal type11BudgetTotal) { - this.type11BudgetTotal = type11BudgetTotal; - } - - public BigDecimal getType11SettleTotal() { - return type11SettleTotal; - } - - public void setType11SettleTotal(BigDecimal type11SettleTotal) { - this.type11SettleTotal = type11SettleTotal; - } - - public BigDecimal getType11FinalTotal() { - return type11FinalTotal; - } - - public void setType11FinalTotal(BigDecimal type11FinalTotal) { - this.type11FinalTotal = type11FinalTotal; - } - - public BigDecimal getType12BudgetTotal() { - return type12BudgetTotal; - } - - public void setType12BudgetTotal(BigDecimal type12BudgetTotal) { - this.type12BudgetTotal = type12BudgetTotal; - } - - public BigDecimal getType12SettleTotal() { - return type12SettleTotal; - } - - public void setType12SettleTotal(BigDecimal type12SettleTotal) { - this.type12SettleTotal = type12SettleTotal; - } - - public BigDecimal getType12FinalTotal() { - return type12FinalTotal; - } - - public void setType12FinalTotal(BigDecimal type12FinalTotal) { - this.type12FinalTotal = type12FinalTotal; - } - - public BigDecimal getType13BudgetTotal() { - return type13BudgetTotal; - } - - public void setType13BudgetTotal(BigDecimal type13BudgetTotal) { - this.type13BudgetTotal = type13BudgetTotal; - } - - public BigDecimal getType13SettleTotal() { - return type13SettleTotal; - } - - public void setType13SettleTotal(BigDecimal type13SettleTotal) { - this.type13SettleTotal = type13SettleTotal; - } - - public BigDecimal getType13FinalTotal() { - return type13FinalTotal; - } - - public void setType13FinalTotal(BigDecimal type13FinalTotal) { - this.type13FinalTotal = type13FinalTotal; - } - - public BigDecimal getType14BudgetTotal() { - return type14BudgetTotal; - } - - public void setType14BudgetTotal(BigDecimal type14BudgetTotal) { - this.type14BudgetTotal = type14BudgetTotal; - } - - public BigDecimal getType14SettleTotal() { - return type14SettleTotal; - } - - public void setType14SettleTotal(BigDecimal type14SettleTotal) { - this.type14SettleTotal = type14SettleTotal; - } - - public BigDecimal getType14FinalTotal() { - return type14FinalTotal; - } - - public void setType14FinalTotal(BigDecimal type14FinalTotal) { - this.type14FinalTotal = type14FinalTotal; + public void setNetCashFlow(BigDecimal netCashFlow) { + this.netCashFlow = netCashFlow; } } diff --git a/src/main/java/cn/palmte/work/config/activiti/ActConstant.java b/src/main/java/cn/palmte/work/config/activiti/ActConstant.java index c51e9b8..2fa77d7 100644 --- a/src/main/java/cn/palmte/work/config/activiti/ActConstant.java +++ b/src/main/java/cn/palmte/work/config/activiti/ActConstant.java @@ -9,21 +9,13 @@ public class ActConstant { public static final String PROC_INS_ID="procInsId"; + public static final String PROC_DEF_KEY="procDefKey"; /** * 第一个用户任务 即:发起申请任务 */ public static final int TASK_INDEX_FIRST_USER_TASK= 1; - /** - * 审批通过 - */ - public static final int TYPE_APPROVE= 1; - /** - * 审批驳回 - */ - public static final int TYPE_ROLLBACK= 2; - /** * 单实例 或签 diff --git a/src/main/java/cn/palmte/work/controller/backend/ProjectFinalController.java b/src/main/java/cn/palmte/work/controller/backend/ProjectFinalController.java index 3a04df7..a013930 100644 --- a/src/main/java/cn/palmte/work/controller/backend/ProjectFinalController.java +++ b/src/main/java/cn/palmte/work/controller/backend/ProjectFinalController.java @@ -1,14 +1,23 @@ package cn.palmte.work.controller.backend; +import cn.palmte.work.bean.ApproveStatusEnum; +import cn.palmte.work.bean.BudgetBean; +import cn.palmte.work.bean.EstimateBean; +import cn.palmte.work.bean.FinalBean; import cn.palmte.work.model.Project; +import cn.palmte.work.model.ProjectBudgetPlanDetail; +import cn.palmte.work.service.ProjectBudgetService; +import cn.palmte.work.service.ProjectEstimateService; import cn.palmte.work.service.ProjectFinalSevice; import cn.palmte.work.service.ProjectService; import cn.palmte.work.utils.FreeMarkerUtil; +import cn.palmte.work.utils.InterfaceUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.util.List; import java.util.Map; @Controller @@ -21,14 +30,31 @@ public class ProjectFinalController extends BaseController{ @Autowired private ProjectService projectService; + @Autowired + private ProjectEstimateService projectEstimateService; + + @Autowired + private ProjectBudgetService projectBudgetService; + @RequestMapping("/edit") public String budget(@RequestParam("id") int id, Map model) { Project project = projectService.getProject(id); + List projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project); model.put("project", project); - model.put("finalBean", projectFinalSevice.getFinal(project)); + model.put("estimateBean", projectEstimateService.getEstimate(project)); + model.put("budgetBean", projectBudgetService.getBudget(project)); + model.put("finalBean",new FinalBean()); + //现金表 + model.put("cashFlowBean", projectBudgetService.getCashFlowBean(project, projectBudgetPlanDetails)); //freemarker可以利用的静态方法 model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils")); return "admin/project_final_edit"; } + @RequestMapping("/save") + public void estimateAddSave(Project project, FinalBean finalBean, Map model) { + projectFinalSevice.save(project,finalBean); + + } + } diff --git a/src/main/java/cn/palmte/work/model/ProjectEstimateIncomeRepository.java b/src/main/java/cn/palmte/work/model/ProjectEstimateIncomeRepository.java index 8d87e8b..2b51c2b 100644 --- a/src/main/java/cn/palmte/work/model/ProjectEstimateIncomeRepository.java +++ b/src/main/java/cn/palmte/work/model/ProjectEstimateIncomeRepository.java @@ -6,6 +6,4 @@ import java.util.List; public interface ProjectEstimateIncomeRepository extends JpaRepository { List findAllByProjectIdEquals(int id); - - List findAllByProjectIdEqualsAndTypeEquals(int id,int type); } diff --git a/src/main/java/cn/palmte/work/model/ProjectFinalCostManage.java b/src/main/java/cn/palmte/work/model/ProjectFinalCostManage.java index c56f571..00c102e 100644 --- a/src/main/java/cn/palmte/work/model/ProjectFinalCostManage.java +++ b/src/main/java/cn/palmte/work/model/ProjectFinalCostManage.java @@ -9,7 +9,7 @@ import java.math.BigDecimal; * 项目决算管理成本表 */ @Entity -@Table(name = "project_estimate_cost_manage") +@Table(name = "project_final_cost_manage") public class ProjectFinalCostManage { public static final int TYPE_EXPROPRIATION = 1; public static final int TYPE_COMPANY_MANAGE = 2; diff --git a/src/main/java/cn/palmte/work/model/ProjectFinalIncome.java b/src/main/java/cn/palmte/work/model/ProjectFinalIncome.java index 82a2fcb..dbed234 100644 --- a/src/main/java/cn/palmte/work/model/ProjectFinalIncome.java +++ b/src/main/java/cn/palmte/work/model/ProjectFinalIncome.java @@ -9,7 +9,7 @@ import java.math.BigDecimal; * 项目决算收入表 */ @Entity -@Table(name = "project_budget_income") +@Table(name = "project_final_income") public class ProjectFinalIncome { public static final int TYPE_DEVICE = 1; public static final int TYPE_ENGINEER = 2; diff --git a/src/main/java/cn/palmte/work/model/ProjectTaskRecord.java b/src/main/java/cn/palmte/work/model/ProjectTaskRecord.java new file mode 100644 index 0000000..d20751d --- /dev/null +++ b/src/main/java/cn/palmte/work/model/ProjectTaskRecord.java @@ -0,0 +1,66 @@ +package cn.palmte.work.model; + +import lombok.Data; + +import javax.persistence.*; +import java.util.Date; +import java.util.List; + +/** + * 项目审批任务记录 + */ +@Data +@Entity +@Table(name = "project_task_record") +public class ProjectTaskRecord { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + + @Column(name = "project_id") + private int projectId; + + @Column(name = "proc_def_id") + private String procDefId; + + @Column(name = "proc_ins_id") + private String procInsId; + + @Column(name = "task_def_key") + private String taskDefKey; + + @Column(name = "task_name") + private String taskName; + + /** + * @see cn.palmte.work.bean.ApproveStatusEnum#approveStatus + */ + @Column(name = "task_status") + private int taskStatus; + + /** + * 审批人id + */ + @Column(name = "assignee_id") + private String assigneeId; + + /** + * 审批人姓名 + */ + @Column(name = "assignee_name") + private String assigneeName; + + /** + * 审批意见 + */ + @Column(name = "task_comment") + private String taskComment; + + @Column(name = "create_time") + private Date createTime; + + @Transient + private String roleName; + +} diff --git a/src/main/java/cn/palmte/work/model/ProjectTaskRecordRepository.java b/src/main/java/cn/palmte/work/model/ProjectTaskRecordRepository.java new file mode 100644 index 0000000..288b8b3 --- /dev/null +++ b/src/main/java/cn/palmte/work/model/ProjectTaskRecordRepository.java @@ -0,0 +1,8 @@ +package cn.palmte.work.model; + +import org.springframework.data.jpa.repository.JpaRepository; + + +public interface ProjectTaskRecordRepository extends JpaRepository { + +} diff --git a/src/main/java/cn/palmte/work/service/ActCallbackScript.java b/src/main/java/cn/palmte/work/service/ActCallbackScript.java index 9d23550..ed6d7bc 100644 --- a/src/main/java/cn/palmte/work/service/ActCallbackScript.java +++ b/src/main/java/cn/palmte/work/service/ActCallbackScript.java @@ -1,9 +1,13 @@ package cn.palmte.work.service; +import cn.palmte.work.bean.ApproveStatusEnum; import cn.palmte.work.config.activiti.ActConstant; +import cn.palmte.work.utils.ActUtil; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; @@ -15,21 +19,29 @@ import java.util.*; @Service public class ActCallbackScript { private static final Logger logger = LoggerFactory.getLogger(ActCallbackScript.class); + @Autowired + private ActUtil actUtil; + @Autowired + private ProjectInstanceService projectInstanceService; + /** + * 更新流程审批通过 + * + * @param map + */ + public void updateApproveStatus(Map map) { + logger.info("--- updateApproveStatus--- : {} ", map); + //String startUserId = (String) map.get(ActConstant.START_PROCESS_USERID); + String procInsId = (String) map.get(ActConstant.PROC_INS_ID); + String procDefKey = (String) map.get(ActConstant.PROC_DEF_KEY); + logger.info(" updateApproveStatus procInsId:{}, procDefKey:{}", procInsId, procDefKey); + + int projectId = actUtil.getProjectId(procInsId); + if (projectId > 0) { + projectInstanceService.updateApproveStatus(projectId, ApproveStatusEnum.APPROVAL_PASSED, procDefKey); + } - public void endScriptDemo(Map map) { - logger.info("--- endScriptDemo--- : {} ", map); - String startUserId = (String)map.get(ActConstant.START_PROCESS_USERID); - String procInsId = (String)map.get(ActConstant.START_PROCESS_USERID); - logger.info(" startUserId:{}, procInsId:{}", startUserId, procInsId); } - public void rollbackScriptDemo(Map map) { - logger.info("--- rollbackScriptDemo--- : {} ", map); - String startUserId = (String)map.get(ActConstant.START_PROCESS_USERID); - String procInsId = (String)map.get(ActConstant.START_PROCESS_USERID); - logger.info(" startUserId:{}, procInsId:{}", startUserId, procInsId); - } - } diff --git a/src/main/java/cn/palmte/work/service/ActListenerService.java b/src/main/java/cn/palmte/work/service/ActListenerService.java index 938c30b..1b35b6c 100644 --- a/src/main/java/cn/palmte/work/service/ActListenerService.java +++ b/src/main/java/cn/palmte/work/service/ActListenerService.java @@ -1,6 +1,7 @@ package cn.palmte.work.service; +import cn.palmte.work.config.activiti.ActConstant; import com.alibaba.fastjson.JSONObject; import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.DelegateTask; @@ -10,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Iterator; import java.util.List; import java.util.Set; @@ -25,6 +27,9 @@ public class ActListenerService { @Autowired private ActTaskDefService actTaskDefService; + @Autowired + private ProjectInstanceService projectInstanceService; + /** * 节点创建监听 动态设置审批人 * @@ -37,8 +42,22 @@ public class ActListenerService { String procDefId = delegateTask.getProcessDefinitionId(); String procInsId = delegateTask.getProcessInstanceId(); String taskDefKey = delegateTask.getTaskDefinitionKey(); - Set candidateUsers = actTaskDefService.findCandidateUsers(procDefId, procInsId, taskDefKey); + List candidateUsers = actTaskDefService.findCandidateUsers(procDefId, procInsId, taskDefKey); logger.info("addCandidateUsers : {}", candidateUsers); + + + Object projectIdObj = delegateTask.getVariable(ActConstant.KEY_PROJECT_ID); + logger.info("projectIdObj : {}", projectIdObj); + + if (candidateUsers != null && !candidateUsers.isEmpty() && projectIdObj != null) { + try { + int adminId = Integer.parseInt(candidateUsers.get(0)); + projectInstanceService.updateApprover((Integer) projectIdObj, adminId); + } catch (Exception e) { + logger.error("", e); + } + } + delegateTask.addCandidateUsers(candidateUsers); } @@ -55,7 +74,7 @@ public class ActListenerService { }*/ - public Set multipleInstanceTask(DelegateExecution delegateExecution) throws Exception { + public List multipleInstanceTask(DelegateExecution delegateExecution) throws Exception { String procInsId = delegateExecution.getProcessInstanceId(); String procDefId = delegateExecution.getProcessDefinitionId(); String taskDefKey = delegateExecution.getCurrentActivityId(); diff --git a/src/main/java/cn/palmte/work/service/ActProcInsService.java b/src/main/java/cn/palmte/work/service/ActProcInsService.java index f90e188..6ac7e85 100644 --- a/src/main/java/cn/palmte/work/service/ActProcInsService.java +++ b/src/main/java/cn/palmte/work/service/ActProcInsService.java @@ -1,6 +1,7 @@ package cn.palmte.work.service; +import cn.palmte.work.bean.ApproveStatusEnum; import cn.palmte.work.model.ActTaskDefRepository; import cn.palmte.work.pojo.ActProcIns; import cn.palmte.work.utils.ActUtil; @@ -14,6 +15,7 @@ import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.history.HistoricActivityInstance; import org.activiti.engine.history.HistoricProcessInstance; +import org.activiti.engine.impl.identity.Authentication; import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; @@ -50,7 +52,7 @@ public class ActProcInsService { Pagination pagination; @Autowired - private ActTaskDefService actTaskDefService; + private ProjectTaskRecordService projectTaskRecordService; @Autowired private HistoryService historyService; //历史管理(执行完的数据的管理) @@ -91,16 +93,19 @@ public class ActProcInsService { String assignee = InterfaceUtil.getAdminId() + ""; task.setAssignee(assignee); String taskId = task.getId(); - taskService.addComment(taskId, procInsId, "提交审批"); + String comment = "提交" + processDefinition.getName(); + Authentication.setAuthenticatedUserId(assignee); + taskService.addComment(taskId, procInsId, comment); taskService.complete(taskId); actTaskDefRepository.updateHiTaskAssign(assignee, procInsId, taskId); actTaskDefRepository.updateHiActAssign(assignee, procInsId, taskId); + projectTaskRecordService.saveTaskRecord(task, ApproveStatusEnum.APPROVAL_PENDING.getApproveStatus(), comment); + return processInstance.getId(); } - /** * 流程实列列表 * diff --git a/src/main/java/cn/palmte/work/service/ActTaskDefService.java b/src/main/java/cn/palmte/work/service/ActTaskDefService.java index 4fdda65..d55c265 100644 --- a/src/main/java/cn/palmte/work/service/ActTaskDefService.java +++ b/src/main/java/cn/palmte/work/service/ActTaskDefService.java @@ -1,5 +1,6 @@ package cn.palmte.work.service; +import cn.palmte.work.bean.ApproveStatusEnum; import cn.palmte.work.config.activiti.ActConstant; import cn.palmte.work.model.*; @@ -8,6 +9,7 @@ import cn.palmte.work.utils.ActUtil; import cn.palmte.work.utils.InterfaceUtil; import com.alibaba.fastjson.JSONObject; import org.activiti.engine.*; +import org.activiti.engine.impl.identity.Authentication; import org.activiti.engine.impl.persistence.entity.TaskEntity; import org.activiti.engine.task.Task; import org.apache.commons.lang.StringUtils; @@ -25,9 +27,9 @@ import java.util.*; public class ActTaskDefService { private static final Logger logger = LoggerFactory.getLogger(ActTaskDefService.class); @Autowired - private RepositoryService repositoryService; //管理流程定义 与流程定义和部署对象相关的Service + private ProjectTaskRecordService projectTaskRecordService; @Autowired - private ProcessEngine processEngine; //流程引擎对象 + private RepositoryService repositoryService; @Autowired private TaskService taskService; //任务管理 与正在执行的任务管理相关的Service @Autowired @@ -38,6 +40,8 @@ public class ActTaskDefService { Pagination pagination; @Autowired private ActUtil actUtil; + @Autowired + private ProjectInstanceService projectInstanceService; /** @@ -56,6 +60,7 @@ public class ActTaskDefService { private void completeTask(String taskId, String procInsId, String message, int type) { String userId = InterfaceUtil.getAdminId() + ""; + Authentication.setAuthenticatedUserId(userId); taskService.addComment(taskId, procInsId, message); actTaskDefRepository.updateHiTaskAssign(userId, procInsId, taskId); @@ -71,6 +76,9 @@ public class ActTaskDefService { //会签处理 handleMulti(taskId, procInsId, type, userId, actTaskDef); } + + //保存审批记录 + projectTaskRecordService.saveTaskRecord(currentTask, type, message); } @@ -107,7 +115,7 @@ public class ActTaskDefService { Double instanceActiveCount = Double.parseDouble(ActUtil.filterNullToZero(taskService.getVariable(taskId, ActConstant.NUMBER_OF_ACTIVE_INSTANCES))); //活动的会签任务数 Double instanceCompleteCount = Double.parseDouble(ActUtil.filterNullToZero(taskService.getVariable(taskId, ActConstant.NUMBER_OF_COMPLETED_INSTANCES))); //完成会签任务数*/ - if (ActConstant.TYPE_ROLLBACK == type) { + if (ApproveStatusEnum.APPROVAL_UNPASS.getApproveStatus() == type) { //一个人驳回 整个任务节点驳回 List taskList = taskService.createTaskQuery().processInstanceId(procInsId).list(); for (int i = 0; i < taskList.size(); i++) { @@ -139,7 +147,7 @@ public class ActTaskDefService { * @param actTaskDef */ private void handleSinge(String taskId, String procInsId, int type, String userId, ActTaskDef actTaskDef) { - if (ActConstant.TYPE_APPROVE == type) { + if (ApproveStatusEnum.APPROVAL_PASSED.getApproveStatus() == type) { //审批通过 taskService.setAssignee(taskId, userId); taskService.complete(taskId); @@ -147,12 +155,12 @@ public class ActTaskDefService { //执行配置的审批通过脚本 int endScript = actTaskDef.getEndScript(); if (endScript != 0) { - actUtil.invokeEventScript(endScript, procInsId); + actUtil.invokeEventScript(endScript, procInsId, actTaskDef); } else { logger.info("未配置审批通过脚本 task:{}", actTaskDef.getTaskName()); } - } else if (ActConstant.TYPE_ROLLBACK == type) { + } else if (ApproveStatusEnum.APPROVAL_UNPASS.getApproveStatus() == type) { //驳回 String rollbackTaskKey = actTaskDef.getRollbackTaskKey(); actUtil.jumpToTargetTask(taskId, rollbackTaskKey); @@ -160,10 +168,16 @@ public class ActTaskDefService { //执行配置的驳回脚本 int rollbackScript = actTaskDef.getRollbackScript(); if (rollbackScript != 0) { - actUtil.invokeEventScript(rollbackScript, procInsId); + actUtil.invokeEventScript(rollbackScript, procInsId, actTaskDef); } else { logger.info("未配置驳回脚本 task:{}", actTaskDef.getTaskName()); } + + + int projectId = actUtil.getProjectId(procInsId); + if (projectId > 0) { + projectInstanceService.updateApproveStatus(projectId, ApproveStatusEnum.APPROVAL_UNPASS, actTaskDef.getProcDefKey()); + } } } @@ -264,24 +278,25 @@ public class ActTaskDefService { * @param taskDefKey * @return */ - public Set findCandidateUsers(String procDefId, String procInsId, String taskDefKey) { + public List findCandidateUsers(String procDefId, String procInsId, String taskDefKey) { ActTaskDef taskDef = findFirstByProcDefIdAndTaskKey(procDefId, taskDefKey); if (taskDef.getTaskIndex() == ActConstant.TASK_INDEX_FIRST_USER_TASK) { //任务驳回到发起节点 审批人设置为发起人 String startUserId = actUtil.getStartUserId(procInsId); - Set res = new HashSet<>(1); + List res = new ArrayList<>(1); logger.info("findCandidateUsers-0-task:{}, startUserId:{}", taskDef.getTaskName(), startUserId); res.add(startUserId); return res; } - List resList = new ArrayList<>(); + //去重 + Set res = new HashSet<>(); //通过人员id查询 List candidateUserList = taskDef.getCandidateUserList(); logger.info("findCandidateUsers-1-task:{}, userList:{}", taskDef.getTaskName(), candidateUserList); if (!candidateUserList.isEmpty()) { - resList.addAll(candidateUserList); + res.addAll(candidateUserList); } //通过角色id查询 @@ -290,13 +305,12 @@ public class ActTaskDefService { List list = accountService.getUserIsByRole(candidateRoleList); logger.info("findCandidateUsers-3-task:{}, userIdListByRole:{}", taskDef.getTaskName(), list); if (!list.isEmpty()) { - resList.addAll(list); + res.addAll(list); } - //去重 - Set res = new HashSet<>(resList); - logger.info("findCandidateUsers-4-task:{}, resIds:{}", taskDef.getTaskName(), res); - return res; + List resList = new ArrayList<>(res); + logger.info("findCandidateUsers-4-task:{}, resIds:{}", taskDef.getTaskName(), resList); + return resList; } diff --git a/src/main/java/cn/palmte/work/service/ProjectFinalSevice.java b/src/main/java/cn/palmte/work/service/ProjectFinalSevice.java index 714115a..85980b6 100644 --- a/src/main/java/cn/palmte/work/service/ProjectFinalSevice.java +++ b/src/main/java/cn/palmte/work/service/ProjectFinalSevice.java @@ -1,10 +1,17 @@ package cn.palmte.work.service; +import cn.palmte.work.bean.BudgetBean; +import cn.palmte.work.bean.CashFlowBean; +import cn.palmte.work.bean.EstimateBean; import cn.palmte.work.bean.FinalBean; import cn.palmte.work.model.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + @Service public class ProjectFinalSevice { @@ -21,25 +28,271 @@ public class ProjectFinalSevice { private ProjectFinalIncomeReposiry projectFinalIncomeReposiry; @Autowired - private ProjectEstimateIncomeRepository projectEstimateIncomeRepository; + private ProjectEstimateService projectEstimateService; @Autowired - private ProjectBudgetCostRepository projectBudgetCostRepository; + private ProjectBudgetService projectBudgetService; - @Autowired - private ProjectBudgetIncomeRepository projectBudgetIncomeRepository; + public void save(Project project, FinalBean finalBean) { + //预算表数据 + EstimateBean estimate = projectEstimateService.getEstimate(project); + //概算表数据 + BudgetBean budget = projectBudgetService.getBudget(project); + //现金流量表数据 + List projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project); + CashFlowBean cashFlowBean = projectBudgetService.getCashFlowBean(project, projectBudgetPlanDetails); + //保存项目决算收入信息 + saveProjectFinalIncome(project,finalBean,estimate,budget); - public FinalBean getFinal(Project project) { - FinalBean finalBean = new FinalBean(); - //收入设备类总额 + //保存项目决算成本信息 + saveProjectFinalCost(project,finalBean,estimate,budget); - //工程类总额 + //保存项目结算管理成本信息 + saveProjectFinalCostManage(project,finalBean,estimate,budget); + //保存项目结算现金流量信息 + saveProjectFinalCashFlux(project,finalBean,cashFlowBean); - //服务类总额 - - - return finalBean; } + + public void saveProjectFinalCostManage(Project project, FinalBean finalBean,EstimateBean estimate,BudgetBean budget){ + ProjectFinalCostManage expropriationManage = new ProjectFinalCostManage(); + expropriationManage.setProjectId(project.getId()); + expropriationManage.setType(ProjectFinalCostManage.TYPE_EXPROPRIATION); + expropriationManage.setEstimateTotalManageCost(estimate.getCostExpropriationTaxExclude()); + expropriationManage.setBudgetTotalManageCost(budget.getCostExpropriationTaxExclude()); + expropriationManage.setSettleTotalManageCost(new BigDecimal(0)); + expropriationManage.setFinalTotalManageCost(finalBean.getCostExpropriationFinalTotal()); + projectFinalCostManageRepository.saveAndFlush(expropriationManage); + + ProjectFinalCostManage companyManage = new ProjectFinalCostManage(); + companyManage.setProjectId(project.getId()); + companyManage.setType(ProjectFinalCostManage.TYPE_COMPANY_MANAGE); + companyManage.setEstimateTotalManageCost(estimate.getCostCompanyManageTaxExclude()); + companyManage.setBudgetTotalManageCost(budget.getCostCompanyManageTaxExclude()); + companyManage.setSettleTotalManageCost(new BigDecimal(0)); + companyManage.setFinalTotalManageCost(finalBean.getCostCompanyManageFinalTotal()); + projectFinalCostManageRepository.saveAndFlush(companyManage); + + ProjectFinalCostManage incomeTax = new ProjectFinalCostManage(); + incomeTax.setProjectId(project.getId()); + incomeTax.setType(ProjectFinalCostManage.TYPE_INCOME_TAX); + incomeTax.setSettleTotalManageCost(new BigDecimal(0)); + incomeTax.setFinalTotalManageCost(finalBean.getCostIncomeTaxFinalTotal()); + projectFinalCostManageRepository.saveAndFlush(incomeTax); + + } + + private void saveProjectFinalIncome(Project project, FinalBean finalBean,EstimateBean estimate,BudgetBean budget) { + ProjectFinalIncome projectFinalIncomeDevice = new ProjectFinalIncome(); + projectFinalIncomeDevice.setProjectId(project.getId()); + projectFinalIncomeDevice.setType(ProjectFinalIncome.TYPE_DEVICE); + projectFinalIncomeDevice.setEstimateTotalIncome(estimate.getIncomeDeviceTaxExclude()); + projectFinalIncomeDevice.setBudgetTotalIncome(budget.getIncomeDeviceTaxExclude()); + projectFinalIncomeDevice.setSettleTotalIncome(new BigDecimal(0)); + projectFinalIncomeDevice.setFinalTotalIncome(finalBean.getIncomeDeviceFinalTotal()); + projectFinalIncomeReposiry.saveAndFlush(projectFinalIncomeDevice); + + ProjectFinalIncome projectFinalIncomeEngineer = new ProjectFinalIncome(); + projectFinalIncomeEngineer.setProjectId(project.getId()); + projectFinalIncomeEngineer.setType(ProjectFinalIncome.TYPE_ENGINEER); + projectFinalIncomeEngineer.setEstimateTotalIncome(estimate.getIncomeEngineerTaxExclude()); + projectFinalIncomeEngineer.setBudgetTotalIncome(budget.getIncomeEngineerTaxExclude()); + projectFinalIncomeEngineer.setSettleTotalIncome(new BigDecimal(0)); + projectFinalIncomeEngineer.setFinalTotalIncome(finalBean.getIncomeEngineerFinalTotal()); + projectFinalIncomeReposiry.saveAndFlush(projectFinalIncomeEngineer); + + ProjectFinalIncome projectFinalIncomeService = new ProjectFinalIncome(); + projectFinalIncomeService.setProjectId(project.getId()); + projectFinalIncomeService.setType(ProjectFinalIncome.TYPE_SERVICE); + projectFinalIncomeService.setEstimateTotalIncome(estimate.getIncomeServiceTaxExclude()); + projectFinalIncomeService.setBudgetTotalIncome(budget.getIncomeServiceTaxExclude()); + projectFinalIncomeService.setSettleTotalIncome(new BigDecimal(0)); + projectFinalIncomeService.setFinalTotalIncome(finalBean.getIncomeServiceFinalTotal()); + projectFinalIncomeReposiry.saveAndFlush(projectFinalIncomeService); + } + + public void saveProjectFinalCost(Project project, FinalBean finalBean,EstimateBean estimate,BudgetBean budget){ + ProjectFinalCost projectFinalCostDevice = new ProjectFinalCost(); + projectFinalCostDevice.setProjectId(project.getId()); + projectFinalCostDevice.setFee(ProjectFinalCost.FEE_PURCHASE); + projectFinalCostDevice.setType(ProjectFinalCost.TYPE_DEVICE); + projectFinalCostDevice.setEstimateTotalCost(estimate.getCostPurchaseDeviceTaxExclude()); + projectFinalCostDevice.setBudgetTotalCost(budget.getCostPurchaseDeviceTaxExclude()); + projectFinalCostDevice.setSettleTotalCost(new BigDecimal(0)); + projectFinalCostDevice.setFinalTotalCost(finalBean.getCostPurchaseDeviceFinalTotal()); + projectFinalCostRepository.saveAndFlush(projectFinalCostDevice); + + + ProjectFinalCost projectFinalCostBuild = new ProjectFinalCost(); + projectFinalCostBuild.setProjectId(project.getId()); + projectFinalCostBuild.setFee(ProjectFinalCost.FEE_PURCHASE); + projectFinalCostBuild.setType(ProjectFinalCost.TYPE_BUILDING); + projectFinalCostBuild.setEstimateTotalCost(estimate.getCostPurchaseBuildTaxExclude()); + projectFinalCostBuild.setBudgetTotalCost(budget.getCostPurchaseBuildTaxExclude()); + projectFinalCostBuild.setSettleTotalCost(new BigDecimal(0)); + projectFinalCostBuild.setFinalTotalCost(finalBean.getCostPurchaseBuildFinalTotal()); + projectFinalCostRepository.saveAndFlush(projectFinalCostBuild); + + ProjectFinalCost projectFinalCostService = new ProjectFinalCost(); + projectFinalCostService.setProjectId(project.getId()); + projectFinalCostService.setFee(ProjectFinalCost.FEE_PURCHASE); + projectFinalCostService.setType(ProjectFinalCost.TYPE_SERVICE); + projectFinalCostService.setEstimateTotalCost(estimate.getCostPurchaseServiceTaxExclude()); + projectFinalCostService.setBudgetTotalCost(budget.getCostPurchaseServiceTaxExclude()); + projectFinalCostService.setSettleTotalCost(new BigDecimal(0)); + projectFinalCostService.setFinalTotalCost(finalBean.getCostPurchaseServiceFinalTotal()); + projectFinalCostRepository.saveAndFlush(projectFinalCostService); + + ProjectFinalCost projectFinalCostOther = new ProjectFinalCost(); + projectFinalCostOther.setProjectId(project.getId()); + projectFinalCostOther.setFee(ProjectFinalCost.FEE_PURCHASE); + projectFinalCostOther.setType(ProjectFinalCost.TYPE_OTHER); + projectFinalCostOther.setEstimateTotalCost(estimate.getCostPurchaseOtherTaxExclude()); + projectFinalCostOther.setBudgetTotalCost(budget.getCostPurchaseOtherTaxExclude()); + projectFinalCostOther.setSettleTotalCost(new BigDecimal(0)); + projectFinalCostOther.setFinalTotalCost(finalBean.getCostPurchaseOtherFinalTotal()); + projectFinalCostRepository.saveAndFlush(projectFinalCostOther); + + ProjectFinalCost projectFinalCostProject = new ProjectFinalCost(); + projectFinalCostProject.setProjectId(project.getId()); + projectFinalCostProject.setFee(ProjectFinalCost.FEE_PROJECT_MANAGE); + projectFinalCostProject.setType(ProjectFinalCost.TYPE_PROJECT_MANAGE); + projectFinalCostProject.setEstimateTotalCost(estimate.getCostProjectManageTaxExclude()); + projectFinalCostProject.setBudgetTotalCost(budget.getCostProjectManageTaxExclude()); + projectFinalCostProject.setSettleTotalCost(new BigDecimal(0)); + projectFinalCostProject.setFinalTotalCost(finalBean.getCostProjectManageFinalTotal()); + projectFinalCostRepository.saveAndFlush(projectFinalCostProject); + + ProjectFinalCost projectFinalCostOtherOther = new ProjectFinalCost(); + projectFinalCostOtherOther.setProjectId(project.getId()); + projectFinalCostOtherOther.setFee(ProjectFinalCost.FEE_OTHER); + projectFinalCostOtherOther.setType(ProjectFinalCost.TYPE_OTHER_OTHER); + projectFinalCostOtherOther.setEstimateTotalCost(estimate.getCostOtherOtherTaxExclude()); + projectFinalCostOtherOther.setBudgetTotalCost(budget.getCostOtherOtherTaxExclude()); + projectFinalCostOtherOther.setSettleTotalCost(new BigDecimal(0)); + projectFinalCostOtherOther.setFinalTotalCost(finalBean.getCostOtherFinalTotal()); + projectFinalCostRepository.saveAndFlush(projectFinalCostOtherOther); + } + + public void saveProjectFinalCashFlux(Project project, FinalBean finalBean, CashFlowBean cashFlowBean) { + List list = new ArrayList<>(); + + ProjectFinalCashFlux projectFinalCashFlux1 = new ProjectFinalCashFlux(); + projectFinalCashFlux1.setProjectId(project.getId()); + projectFinalCashFlux1.setType(ProjectFinalCashFlux.TYPE1); + projectFinalCashFlux1.setBudgetTotalCashFlux(cashFlowBean.getSaleIncomeCash()); + projectFinalCashFlux1.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux1.setFinalTotalCashFlux(finalBean.getSaleIncomeCash()); + list.add(projectFinalCashFlux1); + + ProjectFinalCashFlux projectFinalCashFlux2 = new ProjectFinalCashFlux(); + projectFinalCashFlux2.setProjectId(project.getId()); + projectFinalCashFlux2.setType(ProjectFinalCashFlux.TYPE2); + projectFinalCashFlux2.setBudgetTotalCashFlux(cashFlowBean.getTaxReturn()); + projectFinalCashFlux2.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux2.setFinalTotalCashFlux(finalBean.getTaxReturn()); + list.add(projectFinalCashFlux2); + + ProjectFinalCashFlux projectFinalCashFlux3 = new ProjectFinalCashFlux(); + projectFinalCashFlux3.setProjectId(project.getId()); + projectFinalCashFlux3.setType(ProjectFinalCashFlux.TYPE3); + projectFinalCashFlux3.setBudgetTotalCashFlux(cashFlowBean.getEarnestMoneyIncome()); + projectFinalCashFlux3.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux3.setFinalTotalCashFlux(finalBean.getEarnestMoneyIncome()); + list.add(projectFinalCashFlux3); + + ProjectFinalCashFlux projectFinalCashFlux4 = new ProjectFinalCashFlux(); + projectFinalCashFlux4.setProjectId(project.getId()); + projectFinalCashFlux4.setType(ProjectFinalCashFlux.TYPE4); + projectFinalCashFlux4.setBudgetTotalCashFlux(cashFlowBean.getPurchaseCost()); + projectFinalCashFlux4.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux4.setFinalTotalCashFlux(finalBean.getPurchaseCost()); + list.add(projectFinalCashFlux4); + + ProjectFinalCashFlux projectFinalCashFlux5 = new ProjectFinalCashFlux(); + projectFinalCashFlux5.setProjectId(project.getId()); + projectFinalCashFlux5.setType(ProjectFinalCashFlux.TYPE5); + projectFinalCashFlux5.setBudgetTotalCashFlux(cashFlowBean.getTaxCost()); + projectFinalCashFlux5.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux5.setFinalTotalCashFlux(finalBean.getTaxCost()); + list.add(projectFinalCashFlux5); + + ProjectFinalCashFlux projectFinalCashFlux6 = new ProjectFinalCashFlux(); + projectFinalCashFlux6.setProjectId(project.getId()); + projectFinalCashFlux6.setType(ProjectFinalCashFlux.TYPE6); + projectFinalCashFlux6.setBudgetTotalCashFlux(cashFlowBean.getEarnestMoneyCost()); + projectFinalCashFlux6.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux6.setFinalTotalCashFlux(finalBean.getEarnestMoneyCost()); + list.add(projectFinalCashFlux6); + + ProjectFinalCashFlux projectFinalCashFlux7 = new ProjectFinalCashFlux(); + projectFinalCashFlux7.setProjectId(project.getId()); + projectFinalCashFlux7.setType(ProjectFinalCashFlux.TYPE7); + projectFinalCashFlux7.setBudgetTotalCashFlux(cashFlowBean.getNetCashFlow()); + projectFinalCashFlux7.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux7.setFinalTotalCashFlux(finalBean.getNetCashFlow()); + list.add(projectFinalCashFlux7); + + ProjectFinalCashFlux projectFinalCashFlux8 = new ProjectFinalCashFlux(); + projectFinalCashFlux8.setProjectId(project.getId()); + projectFinalCashFlux8.setType(ProjectFinalCashFlux.TYPE8); + projectFinalCashFlux8.setBudgetTotalCashFlux(cashFlowBean.getCashInflowFromInvestingActivities()); + projectFinalCashFlux8.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux8.setFinalTotalCashFlux(finalBean.getCashInflowFromInvestingActivities()); + list.add(projectFinalCashFlux8); + + ProjectFinalCashFlux projectFinalCashFlux9 = new ProjectFinalCashFlux(); + projectFinalCashFlux9.setProjectId(project.getId()); + projectFinalCashFlux9.setType(ProjectFinalCashFlux.TYPE9); + projectFinalCashFlux9.setBudgetTotalCashFlux(cashFlowBean.getCashOutflowFromInvestingActivities()); + projectFinalCashFlux9.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux9.setFinalTotalCashFlux(finalBean.getCashOutflowFromInvestingActivities()); + list.add(projectFinalCashFlux9); + + ProjectFinalCashFlux projectFinalCashFlux10 = new ProjectFinalCashFlux(); + projectFinalCashFlux10.setProjectId(project.getId()); + projectFinalCashFlux10.setType(ProjectFinalCashFlux.TYPE10); + projectFinalCashFlux10.setBudgetTotalCashFlux(cashFlowBean.getNetCashFromInvestingActivities()); + projectFinalCashFlux10.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux10.setFinalTotalCashFlux(finalBean.getNetCashFromInvestingActivities()); + list.add(projectFinalCashFlux10); + + ProjectFinalCashFlux projectFinalCashFlux11 = new ProjectFinalCashFlux(); + projectFinalCashFlux11.setProjectId(project.getId()); + projectFinalCashFlux11.setType(ProjectFinalCashFlux.TYPE11); + projectFinalCashFlux11.setBudgetTotalCashFlux(cashFlowBean.getFinancingCapitalInflow()); + projectFinalCashFlux11.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux11.setFinalTotalCashFlux(finalBean.getFinancingCapitalInflow()); + list.add(projectFinalCashFlux11); + + ProjectFinalCashFlux projectFinalCashFlux12 = new ProjectFinalCashFlux(); + projectFinalCashFlux12.setProjectId(project.getId()); + projectFinalCashFlux12.setType(ProjectFinalCashFlux.TYPE12); + projectFinalCashFlux12.setBudgetTotalCashFlux(cashFlowBean.getFinancingCapitalOutflow()); + projectFinalCashFlux12.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux12.setFinalTotalCashFlux(finalBean.getFinancingCapitalOutflow()); + list.add(projectFinalCashFlux12); + + ProjectFinalCashFlux projectFinalCashFlux13 = new ProjectFinalCashFlux(); + projectFinalCashFlux13.setProjectId(project.getId()); + projectFinalCashFlux13.setType(ProjectFinalCashFlux.TYPE13); + projectFinalCashFlux13.setBudgetTotalCashFlux(cashFlowBean.getFinancingCapitalCashflow()); + projectFinalCashFlux13.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux13.setFinalTotalCashFlux(finalBean.getFinancingCapitalCashflow()); + list.add(projectFinalCashFlux13); + + ProjectFinalCashFlux projectFinalCashFlux14 = new ProjectFinalCashFlux(); + projectFinalCashFlux14.setProjectId(project.getId()); + projectFinalCashFlux14.setType(ProjectFinalCashFlux.TYPE14); + projectFinalCashFlux14.setBudgetTotalCashFlux(cashFlowBean.getNetIncreaseMonetaryFunds()); + projectFinalCashFlux14.setFinalTotalCashFlux(new BigDecimal(0)); + projectFinalCashFlux14.setFinalTotalCashFlux(finalBean.getNetIncreaseMonetaryFunds()); + list.add(projectFinalCashFlux14); + + projectFinalCashFluxRepository.save(list); + } + + } diff --git a/src/main/java/cn/palmte/work/service/ProjectTaskRecordService.java b/src/main/java/cn/palmte/work/service/ProjectTaskRecordService.java new file mode 100644 index 0000000..4b34640 --- /dev/null +++ b/src/main/java/cn/palmte/work/service/ProjectTaskRecordService.java @@ -0,0 +1,79 @@ +package cn.palmte.work.service; + +import cn.palmte.work.model.ProjectTaskRecord; +import cn.palmte.work.model.ProjectTaskRecordRepository; +import cn.palmte.work.utils.ActUtil; +import cn.palmte.work.utils.InterfaceUtil; +import org.activiti.engine.task.Task; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import top.jfunc.common.db.QueryHelper; +import top.jfunc.common.db.utils.Pagination; + +import java.util.Date; +import java.util.List; + + +@Service +public class ProjectTaskRecordService { + private static final Logger logger = LoggerFactory.getLogger(ProjectTaskRecordService.class); + @Autowired + private ProjectTaskRecordRepository projectTaskRecordRepository; + + @Autowired + Pagination pagination; + + @Autowired + private ActUtil actUtil; + + + /** + * 保存审批任务记录 + * + * @param task + * @param status + * @param comment + */ + public void saveTaskRecord(Task task, int status, String comment) { + int projectId = actUtil.getProjectId(task.getProcessInstanceId()); + if (projectId == 0) { + return; + } + task.getProcessDefinitionId(); + ProjectTaskRecord record = new ProjectTaskRecord(); + record.setProjectId(projectId); + record.setProcDefId(task.getProcessDefinitionId()); + record.setProcInsId(task.getProcessInstanceId()); + record.setTaskDefKey(task.getTaskDefinitionKey()); + record.setTaskName(task.getName()); + record.setTaskComment(comment); + record.setTaskStatus(status); + record.setAssigneeId(InterfaceUtil.getAdminId() + ""); + record.setAssigneeName(InterfaceUtil.getAdmin().getRealName()); + record.setCreateTime(new Date()); + try { + projectTaskRecordRepository.save(record); + } catch (Exception e) { + logger.error("", e); + } + } + + + /** + * 根据项目id查询审批任务记录 + * + * @param projectId + * @return + */ + public List list(int projectId) { + String select = "tr.*, su.role_name"; + QueryHelper queryHelper = new QueryHelper(select, " project_task_record tr LEFT JOIN sys_user su on su.id=tr.assignee_id "); + queryHelper.addCondition("tr.project_id=?", projectId); + queryHelper.addOrderProperty("tr.create_time", true); + return pagination.find(queryHelper.getSql(), ProjectTaskRecord.class); + } + + +} diff --git a/src/main/java/cn/palmte/work/utils/ActUtil.java b/src/main/java/cn/palmte/work/utils/ActUtil.java index dfb06eb..6e84c00 100644 --- a/src/main/java/cn/palmte/work/utils/ActUtil.java +++ b/src/main/java/cn/palmte/work/utils/ActUtil.java @@ -5,6 +5,7 @@ import cn.palmte.work.config.activiti.DeleteTaskCommand; import cn.palmte.work.config.activiti.JumpCommand; import cn.palmte.work.model.ActScript; import cn.palmte.work.model.ActScriptRepository; +import cn.palmte.work.model.ActTaskDef; import cn.palmte.work.service.AccountService; import org.activiti.bpmn.model.BpmnModel; import org.activiti.bpmn.model.FlowNode; @@ -74,6 +75,14 @@ public class ActUtil { return "0"; } + public int getProjectId(String procInsId) { + Record record = getVariable(ActConstant.KEY_PROJECT_ID, procInsId); + if (record != null) { + return Integer.valueOf(record.get("text")); + } + return 0; + } + /** * 获取流程实列里的所有变量 @@ -93,7 +102,7 @@ public class ActUtil { * @param scriptId * @param procInsId */ - public void invokeEventScript(int scriptId, String procInsId) { + public void invokeEventScript(int scriptId, String procInsId, ActTaskDef actTaskDef) { ActScript actScript = actScriptRepository.findOne(scriptId); if (actScript == null) { logger.info("脚本配置错误"); @@ -102,6 +111,7 @@ public class ActUtil { Map map = new HashMap<>(); map.put(ActConstant.PROC_INS_ID, procInsId); + map.put(ActConstant.PROC_DEF_KEY, actTaskDef.getProcDefKey()); List variables = getVariables(procInsId); for (Record variable : variables) { map.put(variable.getStr("name"), variable.get("text")); diff --git a/src/main/resources/static/assets/js/project_final.js b/src/main/resources/static/assets/js/project_final.js new file mode 100644 index 0000000..7499e5a --- /dev/null +++ b/src/main/resources/static/assets/js/project_final.js @@ -0,0 +1,188 @@ +function calculateFinal() { + + $("input[name='incomeDeviceFinalTotal']").change(function () { + calIncomeFinalTotal(); + }); + $("input[name='incomeEngineerFinalTotal']").change(function () { + calIncomeFinalTotal(); + }); + $("input[name='incomeServiceFinalTotal']").change(function () { + calIncomeFinalTotal(); + }); + + + $("input[name='costPurchaseDeviceFinalTotal']").change(function () { + calCostFinalTotal(); + }); + $("input[name='costPurchaseBuildFinalTotal']").change(function () { + calCostFinalTotal(); + }); + $("input[name='costPurchaseServiceFinalTotal']").change(function () { + calCostFinalTotal(); + }); + $("input[name='costPurchaseOtherFinalTotal']").change(function () { + calCostFinalTotal(); + }); + $("input[name='costProjectManageFinalTotal']").change(function () { + calCostFinalTotal(); + }); + $("input[name='costOtherFinalTotal']").change(function () { + calCostFinalTotal(); + }); + + + $("input[name='costExpropriationFinalTotal']").change(function () { + calManageFinalTotal(); + }); + $("input[name='costCompanyManageFinalTotal']").change(function () { + calManageFinalTotal(); + }); + $("input[name='costIncomeTaxFinalTotal']").change(function () { + calManageFinalTotal(); + }); + + + + $("input[name='saleIncomeCash']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='taxReturn']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='earnestMoneyIncome']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='purchaseCost']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='taxCost']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='earnestMoneyCost']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='netCashFlow']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='cashInflowFromInvestingActivities']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='cashOutflowFromInvestingActivities']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='netCashFromInvestingActivities']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='financingCapitalInflow']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='financingCapitalOutflow']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='financingCapitalCashflow']").change(function () { + calCashFluxFinalTotal(); + }); + $("input[name='netIncreaseMonetaryFunds']").change(function () { + calCashFluxFinalTotal(); + }); + +} + +/** + * 收入决算总额(不含税),有一项没填就置空 + */ +function calIncomeFinalTotal() { + var incomeDeviceFinalTotal = $("input[name='incomeDeviceFinalTotal']").val(); + var incomeEngineerFinalTotal = $("input[name='incomeEngineerFinalTotal']").val(); + var incomeServiceFinalTotal = $("input[name='incomeServiceFinalTotal']").val(); + + var incomeFinalTotal = $("input[name='incomeFinalTotal']"); + + if(incomeDeviceFinalTotal && incomeEngineerFinalTotal && incomeServiceFinalTotal){ + incomeFinalTotal.val(parseFloat(incomeDeviceFinalTotal)+parseFloat(incomeEngineerFinalTotal)+parseFloat(incomeServiceFinalTotal)); + }else { + incomeFinalTotal.val(""); + } +} + +/** + * 成本决算总额(不含税),有一项没填就置空 + */ +function calCostFinalTotal() { + var costPurchaseDeviceFinalTotal = $("input[name='costPurchaseDeviceFinalTotal']").val(); + var costPurchaseBuildFinalTotal = $("input[name='costPurchaseBuildFinalTotal']").val(); + var costPurchaseServiceFinalTotal = $("input[name='costPurchaseServiceFinalTotal']").val(); + var costPurchaseOtherFinalTotal = $("input[name='costPurchaseOtherFinalTotal']").val(); + var costProjectManageFinalTotal = $("input[name='costProjectManageFinalTotal']").val(); + var costOtherFinalTotal = $("input[name='costOtherFinalTotal']").val(); + + var costFinalTotal = $("input[name='costFinalTotal']"); + + if(costPurchaseDeviceFinalTotal && costPurchaseBuildFinalTotal && costPurchaseServiceFinalTotal && + costPurchaseOtherFinalTotal && costProjectManageFinalTotal && costOtherFinalTotal){ + costFinalTotal.val(parseFloat(costPurchaseBuildFinalTotal)+parseFloat(costPurchaseBuildFinalTotal)+parseFloat(costPurchaseServiceFinalTotal)+ + parseFloat(costPurchaseOtherFinalTotal)+parseFloat(costProjectManageFinalTotal)+parseFloat(costOtherFinalTotal)); + }else { + costFinalTotal.val(""); + } +} + + +/** + * 管理成本总额(不含税),有一项没填就置空 + */ +function calManageFinalTotal() { + var costExpropriationFinalTotal = $("input[name='costExpropriationFinalTotal']").val(); + var costCompanyManageFinalTotal = $("input[name='costCompanyManageFinalTotal']").val(); + var costIncomeTaxFinalTotal = $("input[name='costIncomeTaxFinalTotal']").val(); + + var manageFinalTotal = $("input[name='manageFinalTotal']"); + + if(costExpropriationFinalTotal && costCompanyManageFinalTotal && costIncomeTaxFinalTotal){ + manageFinalTotal.val(parseFloat(costExpropriationFinalTotal)+parseFloat(costCompanyManageFinalTotal)+parseFloat(costIncomeTaxFinalTotal)); + }else { + manageFinalTotal.val(""); + } +} + +/** + * 现金流量表总额(不含税),有一项没填就置空 + */ +function calCashFluxFinalTotal() { + var saleIncomeCash = $("input[name='saleIncomeCash']").val(); + var taxReturn = $("input[name='taxReturn']").val(); + var earnestMoneyIncome = $("input[name='earnestMoneyIncome']").val(); + var purchaseCost = $("input[name='purchaseCost']").val(); + var taxCost = $("input[name='taxCost']").val(); + var earnestMoneyCost = $("input[name='earnestMoneyCost']").val(); + var netCashFlow = $("input[name='netCashFlow']").val(); + var cashInflowFromInvestingActivities = $("input[name='cashInflowFromInvestingActivities']").val(); + var cashOutflowFromInvestingActivities = $("input[name='cashOutflowFromInvestingActivities']").val(); + var netCashFromInvestingActivities = $("input[name='netCashFromInvestingActivities']").val(); + var financingCapitalInflow = $("input[name='financingCapitalInflow']").val(); + var financingCapitalOutflow = $("input[name='financingCapitalOutflow']").val(); + var financingCapitalCashflow = $("input[name='financingCapitalCashflow']").val(); + var netIncreaseMonetaryFunds = $("input[name='netIncreaseMonetaryFunds']").val(); + + var cashFluxFinalTotal = $("input[name='cashFluxFinalTotal']"); + + if(saleIncomeCash && taxReturn && earnestMoneyIncome && + purchaseCost && taxCost && earnestMoneyCost&& + netCashFlow && cashInflowFromInvestingActivities && cashOutflowFromInvestingActivities && + netCashFromInvestingActivities && financingCapitalInflow && financingCapitalOutflow + && financingCapitalCashflow && netIncreaseMonetaryFunds){ + cashFluxFinalTotal.val(parseFloat(saleIncomeCash)+parseFloat(taxReturn)+parseFloat(earnestMoneyIncome)+ + parseFloat(purchaseCost)+parseFloat(taxCost)+parseFloat(earnestMoneyCost)+ + parseFloat(netCashFlow)+parseFloat(cashInflowFromInvestingActivities)+parseFloat(cashOutflowFromInvestingActivities)+ + parseFloat(netCashFromInvestingActivities)+parseFloat(financingCapitalInflow)+parseFloat(financingCapitalOutflow)+ + parseFloat(financingCapitalCashflow)+parseFloat(netIncreaseMonetaryFunds)); + }else { + cashFluxFinalTotal.val(""); + } +} + + + + + + diff --git a/src/main/resources/templates/admin/act_his_task_list.ftl b/src/main/resources/templates/admin/act_his_task_list.ftl index 023d339..c63137d 100644 --- a/src/main/resources/templates/admin/act_his_task_list.ftl +++ b/src/main/resources/templates/admin/act_his_task_list.ftl @@ -46,14 +46,14 @@ <#if !list.endTime??> diff --git a/src/main/resources/templates/admin/act_task_def.ftl b/src/main/resources/templates/admin/act_task_def.ftl index a4a32a9..3520039 100644 --- a/src/main/resources/templates/admin/act_task_def.ftl +++ b/src/main/resources/templates/admin/act_task_def.ftl @@ -6,7 +6,7 @@
${procDefName!} / - 任务设置 + 任务配置
@@ -18,7 +18,7 @@ 序号 任务名称 - 任务类型 + <#--任务类型--> 回退任务 审批人 审批角色 @@ -33,7 +33,7 @@ ${list_index+1} ${list.taskName!} - + <#-- <#if list.taskIndex != 1> <#if list.taskType == 0> 或签 @@ -41,11 +41,11 @@ 会签 - + --> <#if list.taskIndex != 1> - <#list adminList as l> <#list scriptList as l> @@ -95,7 +95,7 @@ <#if list.taskIndex != 1> - 收入 @@ -47,34 +48,34 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + +
收入 设备类
收入 工程类
收入 服务类
合计
@@ -94,64 +95,64 @@ 成本 采购成本 设备 - - - - + + + + 成本 采购成本 施工 - - - - + + + + 成本 采购成本 服务 - - - - + + + + 成本 采购成本 其他 - - - - + + + + 成本 项目管理成本 项目管理成本 - - - - + + + + 成本 其他 其他 - - - - + + + + 合计 - - - - + + + + @@ -169,34 +170,34 @@ 财务费用 资金占用成本 - - - - + + + + 公司管理费用 - - - - + + + + 所得税费用 / / - - + + 合计 - - - - + + + + @@ -214,27 +215,27 @@ 项目毛利 - - - - - + + + + + 项目贡献利润 - - - - - + + + + + 项目净利润 - - - - - + + + + + @@ -250,93 +251,93 @@ 销售商品、提供劳务收到的现金 - - - + + + 收到的税费返还 / - - + + 收到其他与经营活动有关的现金 - - - + + + - 购买商品、接受劳务支付的现 - - - + 购买商品、接受劳务支付的现金 + + + 支付的各项税费 / - - + + 支付其他与经营活动有关的现金 - - - + + + 经营活动产生的现金流量净额 - - - + + + 投资活动现金流入 / - - + + 投资活动现金流出 / - - + + 投资活动产生的现金流量净额 / - - + + 融资资金流入 - - - + + + 还款资金流出 - - - + + + 筹资活动产生的现金流量净额 - - - + + + 货币资金净增加额 - - - + + + 合计 - - - + + + @@ -358,11 +359,17 @@ var base = "${base}"; - - - - - + + diff --git a/src/main/resources/templates/admin/project_list.ftl b/src/main/resources/templates/admin/project_list.ftl index 2bd115e..298d1b6 100644 --- a/src/main/resources/templates/admin/project_list.ftl +++ b/src/main/resources/templates/admin/project_list.ftl @@ -200,20 +200,20 @@
- <@shiro.hasPermission name="PROJECT_EDIT"> + <#--<@shiro.hasPermission name="PROJECT_EDIT">--> - - <@shiro.hasPermission name="PROJECT_EDIT"> + <#-- + <@shiro.hasPermission name="PROJECT_EDIT">--> - + <#-- -->