|
@@ -549,8 +549,25 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
BigDecimal big = new BigDecimal(0);
|
|
|
if (budgets != null && budgets.size() > 0) {
|
|
|
for (ProjectCostBudget budget : budgets) {
|
|
|
- if (budget.getPracticalFinishTime().getMonthValue() == i) {
|
|
|
- big = big.add(budget.getActualTotalMoney());
|
|
|
+ //计算人工支出
|
|
|
+ if (budget.getRealPlanStartTime().getYear() != y || budget.getPracticalFinishTime().getYear() != y){
|
|
|
+ if (budget.getIsTwoMonth() != 1){
|
|
|
+ throw new ServiceException("计划年份异常2");
|
|
|
+ }
|
|
|
+ if (budget.getPracticalFinishTime().getYear() != y){
|
|
|
+ //如果结束时间不是今年,则使用开始金额
|
|
|
+ if (budget.getRealPlanStartTime().getMonthValue() == i) {
|
|
|
+ big = big.add(budget.getPracticalStartMoney());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (budget.getPracticalFinishTime().getMonthValue() == i) {
|
|
|
+ big = big.add(budget.getPracticalEndMoney());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (budget.getPracticalFinishTime().getMonthValue() == i) {
|
|
|
+ big = big.add(budget.getActualTotalMoney());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -713,6 +730,7 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
*/
|
|
|
@Override
|
|
|
public List<ProjectIncomeCostRatioVO> portalProjectCostRatio(String date) {
|
|
|
+ int y = Integer.parseInt(date.substring(0,4));
|
|
|
// if ("汇总所有".equals(date)){
|
|
|
// date = "";
|
|
|
// }
|
|
@@ -735,7 +753,7 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
}
|
|
|
List<ProjectIncomeCostRatioVO> vos = new ArrayList<>();
|
|
|
//按年获取闭环任务,根据项目分组
|
|
|
- List<ProjectCostBudget> costByMonth = budgetService.getPlanPracticalCostByMonth(date.substring(0,4));
|
|
|
+ List<ProjectCostBudget> costByMonth = budgetService.getBudgetByYear(y);
|
|
|
if (costByMonth == null || costByMonth.size() <= 0){
|
|
|
//没有闭环任务,为每个项目设置为0
|
|
|
for (ControlProjectInfo info : list) {
|
|
@@ -763,7 +781,21 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
List<ProjectCostBudget> budgets = map.get(info.getId());
|
|
|
if (budgets != null && budgets.size() > 0){
|
|
|
for (ProjectCostBudget budget : budgets) {
|
|
|
- big = big.add(budget.getActualTotalMoney());
|
|
|
+// big = big.add(budget.getActualTotalMoney());
|
|
|
+ if (budget.getRealPlanStartTime().getYear() != y || budget.getPracticalFinishTime().getYear() != y){
|
|
|
+ if (budget.getIsTwoMonth() != 1){
|
|
|
+ throw new ServiceException("计划年份异常3");
|
|
|
+ }
|
|
|
+ if (budget.getPracticalFinishTime().getYear() != y){
|
|
|
+ //如果结束时间不是今年,则使用开始金额
|
|
|
+ big = big.add(budget.getPracticalStartMoney());
|
|
|
+ }else {
|
|
|
+ big = big.add(budget.getPracticalEndMoney());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ big = big.add(budget.getActualTotalMoney());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
//维护支出
|
|
@@ -845,7 +877,7 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
}else {
|
|
|
isPlan2 = false;
|
|
|
}
|
|
|
- //获取项目所有已经闭环的计划
|
|
|
+ //获取项目所有已经闭环的固定计划
|
|
|
List<ProjectCostBudget> finishedTask = budgetService.getProjectAllFinishedTask(projectId, null);
|
|
|
Map<Long, List<ProjectCostBudget>> collect = new HashMap<>();
|
|
|
boolean isPlan = true ;
|