Pārlūkot izejas kodu

导出增加当年累计

chenr 5 mēneši atpakaļ
vecāks
revīzija
ff67d2d841

+ 5 - 0
src/main/java/org/springblade/modules/project/mapper/ProjectInfoMapper.java

@@ -34,6 +34,7 @@ import org.springblade.modules.project.pojo.entity.ProjectInfo;
 import org.springblade.modules.project.pojo.vo.*;
 import org.springblade.modules.system.pojo.entity.ApiScope;
 
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.util.List;
 
@@ -71,4 +72,8 @@ public interface ProjectInfoMapper extends BaseMapper<ProjectInfo> {
     void deleteProgressByProjectId(@Param("projectId") Long id);
 
     ProjectInfo getProjectYear();
+
+    BigDecimal getAllYearlyInvestByProjectId(@Param("projectId")Long projectId);
+
+    void updateAllYearlyInvest(@Param("allYearlyInvest")BigDecimal allYearlyInvest, @Param("projectId")Long projectId);
 }

+ 8 - 0
src/main/java/org/springblade/modules/project/mapper/ProjectInfoMapper.xml

@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.springblade.modules.project.mapper.ProjectInfoMapper">
+    <update id="updateAllYearlyInvest">
+        update d_project_invest_plan set start_finish_invest=#{allYearlyInvest} where project_id=#{projectId} and is_deleted=0;
+    </update>
     <delete id="deleteWarning">
         delete from d_project_warning
     </delete>
@@ -125,5 +128,10 @@
         SELECT min(start_year) AS startYear, max(end_year) AS endYear
         FROM d_project_info;
     </select>
+    <select id="getAllYearlyInvestByProjectId" resultType="java.math.BigDecimal">
+        select ifnull(sum(yearly_invest),0)
+        from d_project_invest_plan
+        where is_deleted = 0 and project_id = #{projectId}
+    </select>
 
 </mapper>

+ 4 - 1
src/main/java/org/springblade/modules/project/pojo/excel/ProjectImportExcel.java

@@ -89,7 +89,10 @@ public class ProjectImportExcel {
     @Schema(description = "计划月份")
     private Integer planMonth;
 
-    @Schema(description = "投资完成")
+    @Schema(description="当年累计投资")
+    private BigDecimal investYear;
+
+    @Schema(description = "当月投资完成")
     private BigDecimal investMoney;
 
     @Schema(description = "工作进展情况")

+ 252 - 144
src/main/java/org/springblade/modules/project/service/impl/ProjectInfoServiceImpl.java

@@ -213,7 +213,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
             if (plan.getFourInvest() != null){
                 all = all.add(plan.getFourInvest());
             }
-                if ((plan.getYearlyInvest() == null && all.compareTo(BigDecimal.ZERO) != 0) || (plan.getYearlyInvest() != null && all.compareTo(plan.getYearlyInvest()) != 0)){
+                if ((plan.getYearlyInvest() == null && all.compareTo(BigDecimal.ZERO) != 0) || (plan.getYearlyInvest() != null&& all.compareTo(plan.getYearlyInvest()) != 0)){
                 throw new ServiceException(dto.getName() +"的"+plan.getPlanYear()+"年全年计划投资与每季度总和不对");
             }
             if (plan.getYearlyInvest() != null || StringUtils.isNotBlank(plan.getYearlyTarget()) || StringUtils.isNotBlank(plan.getOnePlan())
@@ -234,7 +234,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                 if (plan.getOneInvestFinish() != null){
                     investFinish = investFinish.add(plan.getOneInvestFinish());
                 }
-                if (plan.getOneInvestFinish() != null && (plan.getOneInvest() == null || plan.getOneInvest().equals(BigDecimal.ZERO))){
+                if (plan.getOneInvestFinish() != null&&plan.getOneInvestFinish().compareTo(BigDecimal.ZERO)!=0 && (plan.getOneInvest() == null || plan.getOneInvest().equals(BigDecimal.ZERO))){
                     throw new ServiceException(dto.getName() +"的"+plan.getPlanYear()+"年一季度已有投资金额,不能修改为0");
                 }
                 if (plan.getIsOneInvestFinish() == 1){
@@ -248,7 +248,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                 if (plan.getTwoInvestFinish() != null){
                     investFinish = investFinish.add(plan.getTwoInvestFinish());
                 }
-                if (plan.getTwoInvestFinish() != null && (plan.getTwoInvest() == null || plan.getTwoInvest().equals(BigDecimal.ZERO))){
+                if (plan.getTwoInvestFinish() != null&&plan.getTwoInvestFinish().compareTo(BigDecimal.ZERO)!=0 && (plan.getTwoInvest() == null || plan.getTwoInvest().equals(BigDecimal.ZERO))){
                     throw new ServiceException(dto.getName() +"的"+plan.getPlanYear()+"年二季度已有投资金额,不能修改为0");
                 }
                 if (plan.getIsTwoInvestFinish() == 1){
@@ -257,7 +257,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                 }
 
                 //校验三季度已有投资,则不能删除或改为0
-                if (plan.getThreeInvestFinish() != null && (plan.getThreeInvest() == null || plan.getThreeInvest().equals(BigDecimal.ZERO))){
+                if (plan.getThreeInvestFinish() != null&&plan.getThreeInvestFinish().compareTo(BigDecimal.ZERO)!=0 && (plan.getThreeInvest() == null || plan.getThreeInvest().equals(BigDecimal.ZERO))){
                     throw new ServiceException(dto.getName() +"的"+plan.getPlanYear()+"年三季度已有投资金额,不能修改为0");
                 }
                 if (plan.getIsThreeInvestFinish() == 1){
@@ -266,7 +266,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                 }
 
                 //校验四季度已有投资,则不能删除或改为0
-                if (plan.getFourInvestFinish() != null && (plan.getFourInvest() == null || plan.getFourInvest().equals(BigDecimal.ZERO))){
+                if (plan.getFourInvestFinish() != null&&plan.getFourInvestFinish().compareTo(BigDecimal.ZERO)!=0 && (plan.getFourInvest() == null || plan.getFourInvest().equals(BigDecimal.ZERO))){
                     throw new ServiceException(dto.getName() +"的"+plan.getPlanYear()+"年四季度已有投资金额,不能修改为0");
                 }
                 if (plan.getIsFourInvestFinish() == 1){
@@ -1216,7 +1216,11 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                     if (plan.getPlanYear().equals(project.getPlanYear())){
                         isExist = true;
                         plan.setProjectId(project.getProjectId());
-                        plan.setYearlyInvest(project.getYearlyInvest());
+                        if(project.getInvestYear()!=null){
+                            plan.setYearlyInvest(project.getInvestYear());
+                        }else {
+                            plan.setYearlyInvest(project.getYearlyInvest());
+                        }
                         plan.setOneInvest(project.getOneInvest());
                         plan.setTwoInvest(project.getTwoInvest());
                         plan.setThreeInvest(project.getThreeInvest());
@@ -1237,7 +1241,11 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                     ProjectInvestPlan plan = new ProjectInvestPlan();
                     plan.setProjectId(project.getProjectId());
                     plan.setPlanYear(project.getPlanYear());
-                    plan.setYearlyInvest(project.getYearlyInvest());
+                    if(project.getInvestYear()!=null){
+                        plan.setYearlyInvest(project.getInvestYear());
+                    }else {
+                        plan.setYearlyInvest(project.getYearlyInvest());
+                    }
                     plan.setOneInvest(project.getOneInvest());
                     plan.setTwoInvest(project.getTwoInvest());
                     plan.setThreeInvest(project.getThreeInvest());
@@ -1267,7 +1275,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                     ProjectInvestPlan plan = new ProjectInvestPlan();
                     if (i == project.getPlanYear()) {
                         plan.setPlanYear(project.getPlanYear());
-                        plan.setYearlyInvest(project.getYearlyInvest());
+                        plan.setYearlyInvest(project.getInvestYear());
                         plan.setOneInvest(project.getOneInvest());
                         plan.setTwoInvest(project.getTwoInvest());
                         plan.setThreeInvest(project.getThreeInvest());
@@ -1290,7 +1298,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                 if (project.getPlanYear() < project.getStartYear() || project.getPlanYear() > project.getEndYear()){
                     ProjectInvestPlan plan = new ProjectInvestPlan();
                     plan.setPlanYear(project.getPlanYear());
-                    plan.setYearlyInvest(project.getYearlyInvest());
+                    plan.setYearlyInvest(project.getInvestYear());
                     plan.setOneInvest(project.getOneInvest());
                     plan.setTwoInvest(project.getTwoInvest());
                     plan.setThreeInvest(project.getThreeInvest());
@@ -1323,6 +1331,10 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                 //调用修改接口保存
                 this.updateFinished(vo);
             }
+            //统计每个项目开工累计完成投资
+            BigDecimal allYearlyInvest=baseMapper.getAllYearlyInvestByProjectId(project.getProjectId());
+            baseMapper.updateAllYearlyInvest(allYearlyInvest,project.getProjectId());
+
         }
         long add = list.stream().filter(l -> !l.getIsExist()).count();
         long update = list.stream().filter(l -> l.getIsExist()).count();
@@ -1336,7 +1348,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
         String quarterZh = quarterValue[quarter];
         //文件地址
         String rootUrl = System.getProperty("user.dir")+ File.separator + "temporaryFile";
-        String tempFile = rootUrl + File.separator + "季度报告模板.docx";
+        String tempFile = rootUrl + File.separator + "template1.docx";
         System.out.println("模板地址:"+tempFile);
         String fileName = year+"年"+quarterZh+"季度报告"+".docx";
         String fileOutUrl = rootUrl+File.separator+fileName;
@@ -1400,19 +1412,36 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
         //市交通运输委
         List<ProjectInvestPlanVO2> traffics = projectList.stream().filter(l -> trafficType.contains(l.getProjectType()) && ObjectUtil.isNotEmpty(l.getYearlyInvest()))
                 .collect(Collectors.toList());
-        reportVOMap1.put("一、市交通运输委",this.calculateTableOne(traffics, quarter));
+        ReportVO1 reportVOSJTYSW = this.calculateTableOne(traffics, quarter);
+        if(reportVOSJTYSW!=null){
+            reportVOMap1.put("一、市交通运输委",reportVOSJTYSW);
+        }
         for (Integer i : trafficType) {
             reportVOMap1.put(typeValue[i], this.calculateTableOne(traffics.stream().filter(l->l.getProjectType()==i).collect(Collectors.toList()), quarter));
         }
         //市住房城乡建委
         List<ProjectInvestPlanVO2> houses = projectList.stream().filter(l -> houseType.contains(l.getProjectType()) && ObjectUtil.isNotEmpty(l.getYearlyInvest()))
                 .collect(Collectors.toList());
-        reportVOMap2.put("二、市住房城乡建委",this.calculateTableOne(houses, quarter));
+        ReportVO1 reportVO3SZFCXJW = this.calculateTableOne(houses, quarter);
+        if(reportVO3SZFCXJW!=null){
+            reportVOMap2.put("二、市住房城乡建委",reportVO3SZFCXJW);
+        }
+
         for (Integer i : houseType) {
-            reportVOMap2.put(typeValue[i], this.calculateTableOne(houses.stream().filter(l->l.getProjectType()==i).collect(Collectors.toList()), quarter));
+            ReportVO1 reportVO1 = this.calculateTableOne(houses.stream().filter(l -> l.getProjectType() == i).collect(Collectors.toList()), quarter);
+            if(reportVO1!=null){
+                reportVOMap2.put(typeValue[i], reportVO1);
+            }
         }
+        // 检查并修改键
+        if (reportVOMap1.containsKey("公路")) {
+            ReportVO1 reportVO1 = reportVOMap1.get("公路");
+            reportVOMap1.remove("公路");
+            reportVOMap1.put("高速公路建设", reportVO1);
+        };
         Set<String> heads1 = reportVOMap1.keySet();
         Set<String> heads2 = reportVOMap2.keySet();
+
         /** 各板块完成情况*/
         //获取系统中配置的投资进展比例
         ProjectWarning projectWarning = warningService.getOne(new LambdaQueryWrapper<ProjectWarning>()
@@ -1428,25 +1457,39 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
             //插值
             reportVO2Map.put(typeValue2[i], this.calculateTableProjectType(list, quarter));
             //表单
-            VO3listList.add(this.calculateTableSeven(list,projectWarning));
-        }
+            VO3listList.add(this.calculateTableSeven(list,projectWarning,quarter));
+        }
+        // 检查并修改键
+        if (reportVO2Map.containsKey("(一)公路")) {
+            ReportVO2 reportVO2 = reportVO2Map.get("(一)公路");
+            reportVO2Map.remove("(一)公路");
+            reportVO2Map.put("(一)高速公路建设", reportVO2);
+        };
         Set<String> heads3 = reportVO2Map.keySet();
         /** 存在问题*/
         List<String> question = new ArrayList<>();
-        List<ProjectInvestPlanVO2> questionList = projectList.stream().filter(l -> StringUtils.isNotBlank(l.getQuestionable())).collect(Collectors.toList());
+        List<ProjectInvestPlanVO2> questionList = projectList.stream().filter(l -> StringUtils.isNotBlank(l.getQuestionable())).filter(l->!l.getQuestionable().contains("无")).collect(Collectors.toList());
         if (questionList.size() > 0){
             for (int i = 1; i <= questionList.size(); i++) {
                 ProjectInvestPlanVO2 vo2 = questionList.get(i - 1);
-                question.add(i+"."+vo2.getName()+"存在"+vo2.getQuestionable()+"问题。");
+                String questionable = vo2.getQuestionable();
+                if(questionable.endsWith("。")){
+                    questionable=questionable.substring(0, questionable.length() - 1);
+                }
+                question.add(i+"."+vo2.getName()+"存在"+questionable+"问题。");
             }
         }
         /** 工作意见*/
         List<String> advice = new ArrayList<>();
-        List<ProjectInvestPlanVO2> adviceList = projectList.stream().filter(l -> StringUtils.isNotBlank(l.getWorkAdvise())).collect(Collectors.toList());
+        List<ProjectInvestPlanVO2> adviceList = projectList.stream().filter(l -> StringUtils.isNotBlank(l.getWorkAdvise())).filter(l->!l.getWorkAdvise().contains("无")).collect(Collectors.toList());
         if (adviceList.size() > 0){
             for (int i = 1; i <= adviceList.size(); i++) {
                 ProjectInvestPlanVO2 vo2 = adviceList.get(i - 1);
-                advice.add(i+".建议"+vo2.getName()+vo2.getWorkAdvise()+"。");
+                String workAdvise = vo2.getWorkAdvise();
+                if(workAdvise.endsWith("。")){
+                    workAdvise=workAdvise.substring(0,workAdvise.length()-1);
+                }
+                advice.add(i+".建议"+vo2.getName()+workAdvise+"。");
             }
         }
 
@@ -1480,120 +1523,154 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
             //单独处理第一张表单
             List<XWPFTableRow> tableRows = tables.get(0).getRows();
             List<XWPFTableCell> tableCellList = tableRows.get(0).getTableCells();
-            XWPFRun xwpfRun = tableCellList.get(1).getParagraphs().get(0).getRuns().get(0);
-            xwpfRun.setText(year+"",0);
             XWPFRun xwpfRun2 = tableCellList.get(2).getParagraphs().get(0).getRuns().get(0);
             xwpfRun2.setText(quarterZh,0);
             XWPFRun xwpfRun3 = tableCellList.get(3).getParagraphs().get(0).getRuns().get(1);
             xwpfRun3.setText(quarterZh,0);
             Integer tag = 0;
+            //tableRows代表的是表格的16行
             for (XWPFTableRow row : tableRows) {
+                //cells 代表一行的10个单元格
                 List<XWPFTableCell> cells = row.getTableCells();
+                //rowHead每一行的第一个值
                 String rowHead = cells.get(0).getText().replaceAll("\\s*", "");
                 ReportVO1 rowData = null;
-                if (rowHead.contains("一、市交通运输委")){
+                if (rowHead.contains("一、市交通运输委")&&reportVOMap2.containsKey("一、市交通运输委")){
                     rowData = reportVOMap1.get("一、市交通运输委");
+                    rowData.setYearProjectTotal(94);
+                    rowData.setYearPlanInvest(new BigDecimal("1155"));
                     tag = 1;
-                }else if (rowHead.contains("二、市住房城乡建委")){
-                    rowData = reportVOMap1.get("二、市住房城乡建委");
+                }else if (rowHead.contains("二、市住房城乡建委")&&reportVOMap2.containsKey("二、市住房城乡建委")){
+                    rowData = reportVOMap2.get("二、市住房城乡建委");
+                    rowData.setYearProjectTotal(42);
+                    rowData.setYearPlanInvest(new BigDecimal("690.3"));
                     tag = 2;
                 }
                 if (tag == 0 && "合计".equals(rowHead)){
                     rowData = vo1;
+                    rowData.setYearProjectTotal(136);
+                    rowData.setYearPlanInvest(new BigDecimal("1845.3"));
                 }
                 if (tag == 1 && heads1.contains(rowHead)){
                     rowData = reportVOMap1.get(rowHead);
+                    if(ObjectUtil.isEmpty(rowData)){
+                        rowData=new ReportVO1();
+                    }
+                    if(rowHead.equals("铁路")){
+                        rowData.setYearProjectTotal(16);
+                        rowData.setYearPlanInvest(new BigDecimal("480.00"));
+                    }
+                    if(rowHead.equals("高速公路建设")){
+                        rowData.setYearProjectTotal(1);
+                        rowData.setYearPlanInvest(new BigDecimal("8.5"));
+                    }
+                    if(rowHead.equals("水运")){
+                        rowData.setYearProjectTotal(20);
+                        rowData.setYearPlanInvest(new BigDecimal("37"));
+                    }
+                    if(rowHead.equals("明航")){
+                        rowData.setYearProjectTotal(4);
+                        rowData.setYearPlanInvest(new BigDecimal("70"));
+                    }
+                    if(rowHead.equals("枢纽")){
+                        rowData.setYearProjectTotal(16);
+                        rowData.setYearPlanInvest(new BigDecimal("7"));
+                    }
                 }
-                if (tag == 2 && heads2.contains(rowHead)){
+                if (tag == 2 && heads2.contains(rowHead)&&reportVOMap2.containsKey(rowHead)){
                     rowData = reportVOMap2.get(rowHead);
+                    if(ObjectUtil.isEmpty(rowData)){
+                        rowData=new ReportVO1();
+                    }
+                    if(rowHead.equals("城市轨道")){
+                        rowData.setYearProjectTotal(13);
+                        rowData.setYearPlanInvest(new BigDecimal("375"));
+                    }
+                    if(rowHead.equals("城市道路")){
+                        rowData.setYearProjectTotal(29);
+                        rowData.setYearPlanInvest(new BigDecimal("315.3"));
+                    }
+                }
+                if (rowData!= null) {
+                    if(rowData.getYearProjectTotal()!=null){
+                        cells.get(1).getParagraphs().get(0).getRuns().get(0).setText(rowData.getYearProjectTotal() + "", 0);
+                    }
+                    if(rowData.getYearPlanInvest()!=null){
+                        cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(rowData.getYearPlanInvest() + "", 0);
+                    }
+                    if(rowData.getQuarterPlanInvest()!=null){
+                        cells.get(3).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterPlanInvest() + "", 0);
+                    }
+                    if(rowData.getQuarterFinishedInvest()!=null){
+                        cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterFinishedInvest() + "", 0);
+                    }
+                    if(rowData.getQuarterFinishedRatio()!=null){
+                        cells.get(5).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterFinishedRatio() + "%", 0);
+                    }
+                    if(rowData.getQuarterCompare()!=null){
+                        cells.get(6).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterCompare() + "", 0);
+                    }
+                    if(rowData.getQuarterAddFinishedInvest()!=null){
+                        cells.get(7).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterAddFinishedInvest() + "", 0);
+                    }
+                    if(rowData.getQuarterAddRatioYearPlan()!=null){
+                        if(rowHead.equals("合计")){
+                            cells.get(8).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterAddRatioYearPlan() + "%", 0);
+                        }else {
+                            cells.get(8).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterAddRatioYearPlan() + "", 0);
+                        }
+
+                    }
+                    if(rowData.getLeadOrLag()!=null){
+                        cells.get(9).getParagraphs().get(0).getRuns().get(0).setText(rowData.getLeadOrLag() + "%", 0);
+                    }
                 }
-                if (rowData != null) {
-                    cells.get(1).getParagraphs().get(0).getRuns().get(0).setText(rowData.getYearProjectTotal() + "", 0);
-                    cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(rowData.getYearPlanInvest() + "", 0);
-                    cells.get(3).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterPlanInvest() + "", 0);
-                    cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterFinishedInvest() + "", 0);
-                    cells.get(5).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterFinishedRatio() + "%", 0);
-                    cells.get(6).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterCompare() + "", 0);
-                    cells.get(7).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterAddFinishedInvest() + "", 0);
-                    cells.get(8).getParagraphs().get(0).getRuns().get(0).setText(rowData.getQuarterAddRatioYearPlan() + "", 0);
-                    cells.get(9).getParagraphs().get(0).getRuns().get(0).setText(rowData.getLeadOrLag() + "%", 0);
+                if(rowHead.equals("高速公路养护")){
+                    cells.get(1).getParagraphs().get(0).getRuns().get(0).setText("1", 0);
+                    cells.get(2).getParagraphs().get(0).getRuns().get(0).setText("8.5", 0);
+                    cells.get(6).getParagraphs().get(0).getRuns().get(0).setText("/", 0);
+                }
+                if(rowHead.equals("普通公路建设及养护工程")){
+                    cells.get(1).getParagraphs().get(0).getRuns().get(0).setText("1", 0);
+                    cells.get(2).getParagraphs().get(0).getRuns().get(0).setText("120", 0);
+                    cells.get(6).getParagraphs().get(0).getRuns().get(0).setText("/", 0);
+                }
+                if(rowHead.equals("公交站场")){
+                    cells.get(1).getParagraphs().get(0).getRuns().get(0).setText("1", 0);
+                    cells.get(2).getParagraphs().get(0).getRuns().get(0).setText("1.5", 0);
+                    cells.get(6).getParagraphs().get(0).getRuns().get(0).setText("/", 0);
+                }
+                if(rowHead.equals("邮政")){
+                    cells.get(1).getParagraphs().get(0).getRuns().get(0).setText("1", 0);
+                    cells.get(2).getParagraphs().get(0).getRuns().get(0).setText("1.3", 0);
+                    cells.get(6).getParagraphs().get(0).getRuns().get(0).setText("/", 0);
                 }
             }
-            //批量处理后面7张相同格式表单
+            VO3listList.remove(4);
+            VO3listList.remove(4);
+            //批量处理后面5张相同格式表单
+            //判断季度,去设置不同的项目数。
             for (int i = 1; i < tables.size(); i++) {
                 List<ReportVO3> vo3List = VO3listList.get(i - 1);
                 XWPFTable table = tables.get(i);
                 List<XWPFTableRow> rows = table.getRows();
                 //小计
-                ReportVO3 v1 = vo3List.get(0);
-                List<XWPFTableCell> cells = rows.get(2).getTableCells();
-                cells.get(1).getParagraphs().get(0).getRuns().get(0).setText(v1.getOneInvestRatio().toString()+"%" , 0);
-                cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(v1.getOneProjectTotal().toString()  , 0);
-                cells.get(3).getParagraphs().get(0).getRuns().get(0).setText(v1.getTwoInvestRatio().toString() +"%", 0);
-                cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(v1.getTwoProjectTotal().toString() , 0);
-                cells.get(5).getParagraphs().get(0).getRuns().get(0).setText(v1.getTwoAggregateRatio().toString() +"%", 0);
-                cells.get(6).getParagraphs().get(0).getRuns().get(0).setText(v1.getThreeInvestRatio().toString() +"%", 0);
-                cells.get(7).getParagraphs().get(0).getRuns().get(0).setText(v1.getThreeProjectTotal().toString() , 0);
-                cells.get(8).getParagraphs().get(0).getRuns().get(0).setText(v1.getThreeAggregateRatio().toString() +"%", 0);
-                cells.get(9).getParagraphs().get(0).getRuns().get(0).setText(v1.getFourInvestRatio().toString() +"%", 0);
-                cells.get(10).getParagraphs().get(0).getRuns().get(0).setText(v1.getFourProjectTotal().toString() , 0);
-                cells.get(11).getParagraphs().get(0).getRuns().get(0).setText(v1.getFourAggregateRatio().toString() +"%", 0);
                 //正常
-                v1 = vo3List.get(1);
-                cells = rows.get(3).getTableCells();
-                cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(v1.getOneProjectTotal().toString()  , 0);
-                cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(v1.getTwoProjectTotal().toString() , 0);
-                cells.get(7).getParagraphs().get(0).getRuns().get(0).setText(v1.getThreeProjectTotal().toString() , 0);
-                cells.get(10).getParagraphs().get(0).getRuns().get(0).setText(v1.getFourProjectTotal().toString() , 0);
+                ReportVO3 v1 = vo3List.get(1);
                 //超前
-                v1 = vo3List.get(2);
-                cells = rows.get(4).getTableCells();
-                cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(v1.getOneProjectTotal().toString() , 0);
-                cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(v1.getTwoProjectTotal().toString() , 0);
-                cells.get(7).getParagraphs().get(0).getRuns().get(0).setText(v1.getThreeProjectTotal().toString() , 0);
-                cells.get(10).getParagraphs().get(0).getRuns().get(0).setText(v1.getFourProjectTotal().toString() , 0);
+                ReportVO3  v2 = vo3List.get(2);
                 //轻微滞后
-                v1 = vo3List.get(3);
-                cells = rows.get(5).getTableCells();
-                cells.get(1).getParagraphs().get(0).getRuns().get(1).setText(v1.getOneInvestRatio().toString() , 0);
-                cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(v1.getOneProjectTotal().toString() , 0);
-                cells.get(3).getParagraphs().get(0).getRuns().get(1).setText(v1.getTwoInvestRatio().toString() , 0);
-                cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(v1.getTwoProjectTotal().toString() , 0);
-                cells.get(5).getParagraphs().get(0).getRuns().get(1).setText(v1.getTwoAggregateRatio().toString() , 0);
-                cells.get(6).getParagraphs().get(0).getRuns().get(1).setText(v1.getThreeInvestRatio().toString() , 0);
-                cells.get(7).getParagraphs().get(0).getRuns().get(0).setText(v1.getThreeProjectTotal().toString() , 0);
-                cells.get(8).getParagraphs().get(0).getRuns().get(1).setText(v1.getThreeAggregateRatio().toString() , 0);
-                cells.get(9).getParagraphs().get(0).getRuns().get(1).setText(v1.getFourInvestRatio().toString() , 0);
-                cells.get(10).getParagraphs().get(0).getRuns().get(0).setText(v1.getFourProjectTotal().toString() , 0);
-                cells.get(11).getParagraphs().get(0).getRuns().get(1).setText(v1.getFourAggregateRatio().toString() , 0);
+                ReportVO3  v3 = vo3List.get(3);
                 //中度滞后
-                v1 = vo3List.get(4);
-                cells = rows.get(6).getTableCells();
-                cells.get(1).getParagraphs().get(0).getRuns().get(1).setText(v1.getOneInvestRatio().toString() , 0);
-                cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(v1.getOneProjectTotal().toString() , 0);
-                cells.get(3).getParagraphs().get(0).getRuns().get(1).setText(v1.getTwoInvestRatio().toString() , 0);
-                cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(v1.getTwoProjectTotal().toString() , 0);
-                cells.get(5).getParagraphs().get(0).getRuns().get(1).setText(v1.getTwoAggregateRatio().toString() , 0);
-                cells.get(6).getParagraphs().get(0).getRuns().get(1).setText(v1.getThreeInvestRatio().toString() , 0);
-                cells.get(7).getParagraphs().get(0).getRuns().get(0).setText(v1.getThreeProjectTotal().toString() , 0);
-                cells.get(8).getParagraphs().get(0).getRuns().get(1).setText(v1.getThreeAggregateRatio().toString() , 0);
-                cells.get(9).getParagraphs().get(0).getRuns().get(1).setText(v1.getFourInvestRatio().toString() , 0);
-                cells.get(10).getParagraphs().get(0).getRuns().get(0).setText(v1.getFourProjectTotal().toString() , 0);
-                cells.get(11).getParagraphs().get(0).getRuns().get(1).setText(v1.getFourAggregateRatio().toString() , 0);
+                ReportVO3  v4= vo3List.get(4);
                 //严重滞后
-                v1 = vo3List.get(5);
-                cells = rows.get(7).getTableCells();
-                cells.get(1).getParagraphs().get(0).getRuns().get(1).setText(v1.getOneInvestRatio().toString() , 0);
-                cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(v1.getOneProjectTotal().toString() , 0);
-                cells.get(3).getParagraphs().get(0).getRuns().get(1).setText(v1.getTwoInvestRatio().toString() , 0);
-                cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(v1.getTwoProjectTotal().toString() , 0);
-                cells.get(5).getParagraphs().get(0).getRuns().get(1).setText(v1.getTwoAggregateRatio().toString() , 0);
-                cells.get(6).getParagraphs().get(0).getRuns().get(1).setText(v1.getThreeInvestRatio().toString() , 0);
-                cells.get(7).getParagraphs().get(0).getRuns().get(0).setText(v1.getThreeProjectTotal().toString() , 0);
-                cells.get(8).getParagraphs().get(0).getRuns().get(1).setText(v1.getThreeAggregateRatio().toString() , 0);
-                cells.get(9).getParagraphs().get(0).getRuns().get(1).setText(v1.getFourInvestRatio().toString() , 0);
-                cells.get(10).getParagraphs().get(0).getRuns().get(0).setText(v1.getFourProjectTotal().toString() , 0);
-                cells.get(11).getParagraphs().get(0).getRuns().get(1).setText(v1.getFourAggregateRatio().toString() , 0);
+                ReportVO3  v5 = vo3List.get(5);
+                List<XWPFTableCell> cells = rows.get(2).getTableCells();
+                cells.get(1).getParagraphs().get(0).getRuns().get(0).setText(getProjectTotalByTime(v2,quarter), 0);
+                cells.get(2).getParagraphs().get(0).getRuns().get(0).setText(getProjectTotalByTime(v1,quarter) , 0);
+                cells.get(3).getParagraphs().get(0).getRuns().get(0).setText(getProjectTotalByTime(v3,quarter) , 0);
+                cells.get(4).getParagraphs().get(0).getRuns().get(0).setText(getProjectTotalByTime(v4,quarter) , 0);
+                cells.get(5).getParagraphs().get(0).getRuns().get(0).setText(getProjectTotalByTime(v5,quarter) , 0);
             }
 
             /** 文本插值*/
@@ -1737,6 +1814,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
             // 保存并关闭Word文件
             document.write(outputStream);
         } catch (Exception e) {
+            e.printStackTrace();
             throw new ServiceException("生成报告失败:"+e.getMessage());
         }
         //返回响应
@@ -1757,6 +1835,22 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
         }
     }
 
+    public String getProjectTotalByTime(ReportVO3 vo,Integer quarter){
+        if(quarter.equals(1)){
+            return vo.getOneProjectTotal().toString();
+        }
+        if(quarter.equals(2)){
+            return vo.getTwoProjectTotal()+"";
+        }
+        if(quarter.equals(3)){
+            return vo.getThreeProjectTotal()+"";
+        }
+        if(quarter.equals(4)){
+            return vo.getFourProjectTotal()+"";
+        }
+        return "";
+    }
+
     @Override
     public R<List<Integer>> getProjectYear() {
         ProjectInfo info = baseMapper.getProjectYear();
@@ -1768,7 +1862,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
     }
 
     //计算项目7个类型的表单部分
-    private List<ReportVO3> calculateTableSeven(List<ProjectInvestPlanVO2> projectList,ProjectWarning projectWarning) {
+    private List<ReportVO3> calculateTableSeven(List<ProjectInvestPlanVO2> projectList,ProjectWarning projectWarning,Integer quarter) {
         BigDecimal oneHundred = new BigDecimal(100);
         List<ReportVO3> list = new ArrayList<>();
         /** 计划投资*/
@@ -1835,25 +1929,41 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
         list.add(v1);
         //正常
         ReportVO3 v2 = new ReportVO3();
-        v2.setOneProjectTotal((int) projectList.stream().filter(l->l.getIsOneInvestFinish() == 1 &&
+        if(quarter.equals(1)){
+            v2.setOneProjectTotal((int) projectList.stream().filter(l->l.getIsOneInvestFinish() == 1 &&
                 l.getOneInvestRatio().compareTo(oneHundred) == 0).count());
-        v2.setTwoProjectTotal((int) projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 &&
-                l.getTwoInvestRatio().compareTo(oneHundred) == 0 && l.getTwoAggregateRatio().compareTo(oneHundred) == 0).count());
-        v2.setThreeProjectTotal((int) projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 &&
-                l.getThreeInvestRatio().compareTo(oneHundred) == 0 && l.getThreeAggregateRatio().compareTo(oneHundred) == 0).count());
-        v2.setFourProjectTotal((int) projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 &&
-                l.getFourInvestRatio().compareTo(oneHundred) == 0 && l.getFourAggregateRatio().compareTo(oneHundred) == 0).count());
+        }
+        if(quarter.equals(2)){
+            v2.setTwoProjectTotal((int) projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 &&
+                l.getTwoAggregateRatio().compareTo(oneHundred) == 0).count());
+        }
+        if(quarter.equals(3)){
+            v2.setThreeProjectTotal((int) projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 &&
+                l.getThreeAggregateRatio().compareTo(oneHundred) == 0).count());
+        }
+        if(quarter.equals(4)){
+            v2.setFourProjectTotal((int) projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 &&
+                l.getFourAggregateRatio().compareTo(oneHundred) == 0).count());
+        }
         list.add(v2);
         //超前
         ReportVO3 v3 = new ReportVO3();
-        v3.setOneProjectTotal((int) projectList.stream().filter(l->l.getIsOneInvestFinish() == 1 &&
+        if(quarter.equals(1)){
+            v3.setOneProjectTotal((int) projectList.stream().filter(l->l.getIsOneInvestFinish() == 1 &&
                 l.getOneInvestRatio().compareTo(oneHundred) > 0).count());
-        v3.setTwoProjectTotal((int) projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 &&
-                l.getTwoInvestRatio().compareTo(oneHundred) > 0 && l.getTwoAggregateRatio().compareTo(oneHundred)  > 0).count());
-        v3.setThreeProjectTotal((int) projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 &&
-                l.getThreeInvestRatio().compareTo(oneHundred) > 0 && l.getThreeAggregateRatio().compareTo(oneHundred)  > 0).count());
-        v3.setFourProjectTotal((int) projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 &&
-                l.getFourInvestRatio().compareTo(oneHundred) > 0 && l.getFourAggregateRatio().compareTo(oneHundred)  > 0).count());
+        }
+        if(quarter.equals(2)){
+            v3.setTwoProjectTotal((int) projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 &&
+                l.getTwoAggregateRatio().compareTo(oneHundred)  > 0).count());
+        }
+        if(quarter.equals(3)){
+            v3.setThreeProjectTotal((int) projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 &&
+                l.getThreeAggregateRatio().compareTo(oneHundred)  > 0).count());
+        }
+        if(quarter.equals(4)){
+            v3.setFourProjectTotal((int) projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 &&
+                l.getFourAggregateRatio().compareTo(oneHundred)  > 0).count());
+        }
         list.add(v3);
 
         //过滤每个季度已经统计过的
@@ -1873,19 +1983,19 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
         v6.setOneProjectTotal(one.size());
         v6.setTwoInvestRatio(projectWarning.getTwoOne());
         two = projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1
-                && (l.getTwoInvestRatio().compareTo(projectWarning.getTwoOne()) < 0 || l.getTwoAggregateRatio().compareTo(projectWarning.getTwoOneAll()) < 0))
+                && l.getTwoAggregateRatio().compareTo(projectWarning.getTwoOneAll()) < 0)
                 .map(ProjectInvestPlanVO2::getId).collect(Collectors.toList());
         v6.setTwoProjectTotal(two.size());
         v6.setTwoAggregateRatio(projectWarning.getTwoOneAll());
         v6.setThreeInvestRatio(projectWarning.getThreeOne());
         three = projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1
-                && (l.getThreeInvestRatio().compareTo(projectWarning.getThreeOne()) < 0 || l.getThreeAggregateRatio().compareTo(projectWarning.getThreeOneAll()) < 0))
+                && l.getThreeAggregateRatio().compareTo(projectWarning.getThreeOneAll()) < 0)
                 .map(ProjectInvestPlanVO2::getId).collect(Collectors.toList());
         v6.setThreeProjectTotal(three.size());
         v6.setThreeAggregateRatio(projectWarning.getThreeOneAll());
         v6.setFourInvestRatio(projectWarning.getFourOne());
         four = projectList.stream().filter(l->l.getIsFourInvestFinish() == 1
-                && (l.getFourInvestRatio().compareTo(projectWarning.getFourOne()) < 0 || l.getFourAggregateRatio().compareTo(projectWarning.getFourOneAll()) < 0))
+                && l.getFourAggregateRatio().compareTo(projectWarning.getFourOneAll()) < 0)
                 .map(ProjectInvestPlanVO2::getId).collect(Collectors.toList());
         v6.setFourProjectTotal(four.size());
         v6.setFourAggregateRatio(projectWarning.getFourOneAll());
@@ -1905,22 +2015,19 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
         v5.setOneProjectTotal(one.size());
         v5.setTwoInvestRatio(projectWarning.getTwoTwo());
         two = projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 && !twoIds.contains(l.getId())
-                && ((l.getTwoInvestRatio().compareTo(projectWarning.getTwoOne()) > 0 && l.getTwoInvestRatio().compareTo(projectWarning.getTwoTwo()) < 0)
-                || (l.getTwoAggregateRatio().compareTo(projectWarning.getTwoOneAll()) > 0 && l.getTwoAggregateRatio().compareTo(projectWarning.getTwoTwoAll()) < 0)))
+                && (l.getTwoAggregateRatio().compareTo(projectWarning.getTwoOneAll()) > 0 && l.getTwoAggregateRatio().compareTo(projectWarning.getTwoTwoAll()) < 0))
                 .map(ProjectInvestPlanVO2::getId).collect(Collectors.toList());
         v5.setTwoProjectTotal(two.size());
         v5.setTwoAggregateRatio(projectWarning.getTwoTwoAll());
         v5.setThreeInvestRatio(projectWarning.getThreeTwo());
         three = projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 && !threeIds.contains(l.getId())
-                && ((l.getThreeInvestRatio().compareTo(projectWarning.getThreeOne()) > 0 && l.getThreeInvestRatio().compareTo(projectWarning.getThreeTwo()) < 0)
-                        || (l.getThreeAggregateRatio().compareTo(projectWarning.getThreeOneAll()) > 0 && l.getThreeAggregateRatio().compareTo(projectWarning.getThreeTwoAll()) < 0)))
+                && (l.getThreeAggregateRatio().compareTo(projectWarning.getThreeOneAll()) > 0 && l.getThreeAggregateRatio().compareTo(projectWarning.getThreeTwoAll()) < 0))
                 .map(ProjectInvestPlanVO2::getId).collect(Collectors.toList());
         v5.setThreeProjectTotal(three.size());
         v5.setThreeAggregateRatio(projectWarning.getThreeTwoAll());
         v5.setFourInvestRatio(projectWarning.getFourTwo());
         four = projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 && !fourIds.contains(l.getId())
-                && ((l.getFourInvestRatio().compareTo(projectWarning.getFourOne()) > 0 && l.getFourInvestRatio().compareTo(projectWarning.getFourTwo()) < 0)
-                || (l.getFourAggregateRatio().compareTo(projectWarning.getFourOneAll()) > 0 && l.getFourAggregateRatio().compareTo(projectWarning.getFourTwoAll()) < 0)))
+                && (l.getFourAggregateRatio().compareTo(projectWarning.getFourOneAll()) > 0 && l.getFourAggregateRatio().compareTo(projectWarning.getFourTwoAll()) < 0))
                 .map(ProjectInvestPlanVO2::getId).collect(Collectors.toList());
         v5.setFourProjectTotal(four.size());
         v5.setFourAggregateRatio(projectWarning.getFourTwoAll());
@@ -1937,18 +2044,15 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                 && l.getOneInvestRatio().compareTo(projectWarning.getOneTwo()) > 0 && l.getOneInvestRatio().compareTo(projectWarning.getOneThree()) < 0).count());
         v4.setTwoInvestRatio(projectWarning.getTwoThree());
         v4.setTwoProjectTotal((int) projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 && !twoIds.contains(l.getId())
-                && ((l.getTwoInvestRatio().compareTo(projectWarning.getTwoTwo()) > 0 && l.getTwoInvestRatio().compareTo(projectWarning.getTwoThree()) < 0)
-                || (l.getTwoAggregateRatio().compareTo(projectWarning.getTwoTwoAll()) > 0 && l.getTwoAggregateRatio().compareTo(projectWarning.getTwoThreeAll()) < 0))).count());
+                && (l.getTwoAggregateRatio().compareTo(projectWarning.getTwoTwoAll()) > 0 && l.getTwoAggregateRatio().compareTo(projectWarning.getTwoThreeAll()) < 0)).count());
         v4.setTwoAggregateRatio(projectWarning.getTwoThreeAll());
         v4.setThreeInvestRatio(projectWarning.getThreeThree());
         v4.setThreeProjectTotal((int) projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 && !threeIds.contains(l.getId())
-                && ((l.getThreeInvestRatio().compareTo(projectWarning.getThreeTwo()) > 0 && l.getThreeInvestRatio().compareTo(projectWarning.getThreeThree()) < 0)
-                || (l.getTwoAggregateRatio().compareTo(projectWarning.getThreeTwoAll()) > 0 && l.getTwoAggregateRatio().compareTo(projectWarning.getThreeThreeAll()) < 0))).count());
+                && (l.getThreeAggregateRatio().compareTo(projectWarning.getThreeTwoAll()) > 0 && l.getThreeAggregateRatio().compareTo(projectWarning.getThreeThreeAll()) < 0)).count());
         v4.setThreeAggregateRatio(projectWarning.getThreeThreeAll());
         v4.setFourInvestRatio(projectWarning.getFourThree());
         v4.setFourProjectTotal((int) projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 && !fourIds.contains(l.getId())
-                && ((l.getFourInvestRatio().compareTo(projectWarning.getFourTwo()) > 0 && l.getFourInvestRatio().compareTo(projectWarning.getFourThree()) < 0)
-                || (l.getTwoAggregateRatio().compareTo(projectWarning.getFourTwoAll()) > 0 && l.getTwoAggregateRatio().compareTo(projectWarning.getFourThreeAll()) < 0))).count());
+                && (l.getFourAggregateRatio().compareTo(projectWarning.getFourTwoAll()) > 0 && l.getFourAggregateRatio().compareTo(projectWarning.getFourThreeAll()) < 0)).count());
         v4.setFourAggregateRatio(projectWarning.getFourThreeAll());
         list.add(v4);
         list.add(v5);
@@ -2017,25 +2121,25 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
             case 2 : currentQuarterFinished = twoInvestFinish;
                 frontQuarterFinished = oneInvestFinish.add(twoInvestFinish);
                 currentQuarterPlanInvest = twoInvest;
-                advanceProjects = projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 && l.getTwoAggregateRatio().compareTo(new BigDecimal(100)) > 0)
+                advanceProjects = projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 && l.getTwoInvestRatio().compareTo(new BigDecimal(100)) > 0)
                         .collect(Collectors.toList());
-                lagProjects = projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 && l.getTwoAggregateRatio().compareTo(new BigDecimal(100)) < 0)
+                lagProjects = projectList.stream().filter(l->l.getIsTwoInvestFinish() == 1 && l.getTwoInvestRatio().compareTo(new BigDecimal(100)) < 0)
                         .collect(Collectors.toList());
                 break;
             case 3 : currentQuarterFinished = threeInvestFinish;
                 frontQuarterFinished = oneInvestFinish.add(threeInvestFinish).add(twoInvestFinish);
                 currentQuarterPlanInvest = threeInvest;
-                advanceProjects = projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 && l.getThreeAggregateRatio().compareTo(new BigDecimal(100)) > 0)
+                advanceProjects = projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 && l.getThreeInvestRatio().compareTo(new BigDecimal(100)) > 0)
                         .collect(Collectors.toList());
-                lagProjects = projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 && l.getThreeAggregateRatio().compareTo(new BigDecimal(100)) < 0)
+                lagProjects = projectList.stream().filter(l->l.getIsThreeInvestFinish() == 1 && l.getThreeInvestRatio().compareTo(new BigDecimal(100)) < 0)
                         .collect(Collectors.toList());
                 break;
             case 4 : currentQuarterFinished = fourInvestFinish;
                 frontQuarterFinished = oneInvestFinish.add(twoInvestFinish).add(threeInvestFinish).add(fourInvestFinish);
                 currentQuarterPlanInvest = fourInvest;
-                advanceProjects = projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 && l.getFourAggregateRatio().compareTo(new BigDecimal(100)) > 0)
+                advanceProjects = projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 && l.getFourInvestRatio().compareTo(new BigDecimal(100)) > 0)
                         .collect(Collectors.toList());
-                lagProjects = projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 && l.getFourAggregateRatio().compareTo(new BigDecimal(100)) < 0)
+                lagProjects = projectList.stream().filter(l->l.getIsFourInvestFinish() == 1 && l.getFourInvestRatio().compareTo(new BigDecimal(100)) < 0)
                         .collect(Collectors.toList());
                 break;
             default : throw new ServiceException("季度不在规定范围内");
@@ -2328,21 +2432,24 @@ 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)));
+                        BigDecimal  investYear= StringChangeBigdecimal(dataFormatter.formatCellValue(row.getCell(18,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));
                         String fourPlan = dataFormatter.formatCellValue(row.getCell(17, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
-                        String questionable = dataFormatter.formatCellValue(row.getCell(22, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
-                        String workAdvise = dataFormatter.formatCellValue(row.getCell(23, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
-                        String linkman = dataFormatter.formatCellValue(row.getCell(24, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
-                        String phone = dataFormatter.formatCellValue(row.getCell(25, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        String questionable = dataFormatter.formatCellValue(row.getCell(23, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        String workAdvise = dataFormatter.formatCellValue(row.getCell(24, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        String linkman = dataFormatter.formatCellValue(row.getCell(25, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        String phone = dataFormatter.formatCellValue(row.getCell(26, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+
                         /*月度信息行*/
-                        BigDecimal investMoney = StringChangeBigdecimal(dataFormatter.formatCellValue(row.getCell(18,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)));
-                        String workProgress = dataFormatter.formatCellValue(row.getCell(19, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
-                        String workProgressAll = dataFormatter.formatCellValue(row.getCell(20, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
-                        String planRatioString = dataFormatter.formatCellValue(row.getCell(21, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        BigDecimal investMoney = StringChangeBigdecimal(dataFormatter.formatCellValue(row.getCell(19,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)));
+                        String workProgress = dataFormatter.formatCellValue(row.getCell(20, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        String workProgressAll = dataFormatter.formatCellValue(row.getCell(21, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        String planRatioString = dataFormatter.formatCellValue(row.getCell(22, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
                         BigDecimal planRatio = StringChangeBigdecimal(planRatioString.contains("%")?planRatioString.substring(0,planRatioString.length()-1):planRatioString);
+
                         if (planRatio != null && (planRatio.compareTo(BigDecimal.ZERO) == -1 || planRatio.compareTo(new BigDecimal(100)) == 1)){
                             throw new ServiceException("工程整体形象进度要在0-100之间");
                         }
@@ -2373,6 +2480,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                         pro.setWorkAdvise(workAdvise);
                         pro.setLinkman(linkman);
                         pro.setPhone(phone);
+                        pro.setInvestYear(investYear);
                         pro.setInvestMoney(investMoney);
                         pro.setWorkProgress(workProgress);
                         pro.setWorkProgressAll(workProgressAll);