qianxb 1 vuosi sitten
vanhempi
commit
2d5956571b

+ 5 - 2
src/main/java/org/springblade/modules/project/service/impl/ProjectInfoServiceImpl.java

@@ -388,6 +388,8 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
         //删除所有年的详情
         baseMapper.deleteProgressByProjectId(dto.getId());
         List<ProjectInvestPlan> updateYearPlan = new ArrayList<>();
+        //整年累计完成投资
+        BigDecimal projectInvestFinished = BigDecimal.ZERO;
         for (ProjectInvestPlanVO year : years) {
             //如果此年不能填写,则直接跳过
             if (year.getIsCanFill() == 0){
@@ -643,7 +645,8 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
             }
             planProgressService.saveBatch(progresses);
             //添加要修改年计划
-            yearPlan.setYearFinishInvest(allInvestFinished);
+            projectInvestFinished = projectInvestFinished.add(allInvestFinished);
+            yearPlan.setYearFinishInvest(projectInvestFinished);
             yearPlan.setYearUnfinishedInvest(year.getYearlyInvest().subtract(allInvestFinished));
             updateYearPlan.add(yearPlan);
         }
@@ -1397,7 +1400,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                         BigDecimal twoInvest = StringChangeBigdecimal(dataFormatter.formatCellValue(row.getCell(10,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)));
                         BigDecimal threeInvest = StringChangeBigdecimal(dataFormatter.formatCellValue(row.getCell(11,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)));
                         BigDecimal fourInvest = StringChangeBigdecimal(dataFormatter.formatCellValue(row.getCell(12,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)));
-                        String yearlyTarget = dataFormatter.formatCellValue(row.getCell(12, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        String yearlyTarget = dataFormatter.formatCellValue(row.getCell(13, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
                         String onePlan = dataFormatter.formatCellValue(row.getCell(14, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
                         String twoPlan = dataFormatter.formatCellValue(row.getCell(15, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
                         String threePlan = dataFormatter.formatCellValue(row.getCell(16, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));