Browse Source

会员进度导出修改

anderx 1 year ago
parent
commit
e1dea3cabe

+ 171 - 133
src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java

@@ -8,6 +8,7 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.Excel.ColumnType;
 import com.goafanti.common.utils.excel.Excel.Type;
 import com.goafanti.techproject.bo.OutTaskDetailsBo;
+import com.goafanti.techproject.bo.TaskDetailsBo;
 import org.apache.poi.POIXMLDocumentPart;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
@@ -1905,7 +1906,7 @@ public class NewExcelUtil<T> {
 	}
 
 
-	public Result exportTaskDetailsExcel(OutTaskDetailsBo byTid, String sheetName, String uploadPath) {
+	public Result exportTaskDetailsExcel(TaskDetailsBo byTid, String sheetName, String uploadPath) {
 		OutputStream out = null;
 		String filename="";
 		downloadPath=uploadPath;
@@ -1915,8 +1916,7 @@ public class NewExcelUtil<T> {
 			wb = new HSSFWorkbook(fileInputStream);
 			styles=createStyles(wb);
 			sheet = wb.getSheetAt(0);
-			Row row = sheet.createRow(5);
-
+			Row row = sheet.createRow(6);
 			filename = encodingFilename(sheetName);
 			out = Files.newOutputStream(Paths.get(getAbsoluteFile(filename)));
 			addCell( row,byTid);
@@ -1943,112 +1943,153 @@ public class NewExcelUtil<T> {
 		}
     }
 
-	private void addCell(Row row,OutTaskDetailsBo o) {
-		for (int i = 0; i < 51; i++) {
+	private void addObjectCell(Row row, OutTaskDetailsBo byTid) {
+		Class<?> clazz = byTid.getClass();
+		int i = 0;
+
+		for (Field field :clazz.getDeclaredFields()){
+			field.setAccessible(true);
 			Cell cell = row.createCell(i);
 			cell.setCellStyle(styles.get("data4"));
-			if (i==0)cell.setCellValue(1);
-			else if(i==1)cell.setCellValue(o.getUserName());
-			else if(i==2)cell.setCellValue(o.getServiceProject());
-			else if(i==3)cell.setCellValue(o.getServiceyear());
-			else if(i==4)cell.setCellValue("");
-			else if(i==5)cell.setCellValue(o.getMemberLvl());
-			else if(i==6){
-				if (o.getBeforeLastSalesAmount()!=null){
-					cell.setCellValue(o.getBeforeLastSalesAmount().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
-			}
-			else if(i==7){
-				if (o.getBeforeLastRdBudget()!=null){
-					cell.setCellValue(o.getBeforeLastRdBudget().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
-			}
-			else if(i==8){
-				if(o.getLastSalesAmount()!=null){
-					cell.setCellValue(o.getLastSalesAmount().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
-			}
-			else if(i==9){
-				if(o.getLastRdBudget()!=null){
-					cell.setCellValue(o.getLastRdBudget().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
-			}
-			else if(i==10){
-				addParam(cell,o.getCloseMeetingStatus(),o.getCloseMeetingOther());
-			}else if(i==11){
-				cell.setCellValue(o.getProjectApprovalNumber());
-			}else if(i==12){
-				if (o.getRdBudget() !=null){
-					cell.setCellValue(o.getRdBudget().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
-			}
-			else if(i==13){
-				if (o.getRdSalesAmount() !=null){
-					cell.setCellValue(o.getRdSalesAmount().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
-			}
-			else if(i==14)cell.setCellValue(o.getRdBudgetRate());
-			else if(i==15)cell.setCellValue(o.getThreeYearsRdBudgetRate());
-			else if(i==16){
-				switch (o.getDataCycle())
-				{
-					case "0":
-						cell.setCellValue("第一季度");
-						break;
-					case "1": cell.setCellValue("上半年"); break;
-					case "2": cell.setCellValue("前三季度"); break;
-					case "3": cell.setCellValue("全年"); break;
+			try {
+//				System.out.println(String.format("name=%s,value=%s",field.getName(),field.get(byTid)));
+				Object o = field.get(byTid);
+			} catch (IllegalAccessException e) {
+				throw new RuntimeException(e);
+			}
+		}
+	}
+
+	private void addCell(Row row,TaskDetailsBo o) {
+		for (int i = 0; i < 70; i++) {
+			Cell cell = row.createCell(i);
+			cell.setCellStyle(styles.get("data4"));
+			if (i==0)cell.setCellValue(1);//序号
+			else if(i==1)cell.setCellValue(o.getUserName());//客户名称
+			else if(i==2)cell.setCellValue(o.getContractNo());//合同编号
+			else if(i==3)cell.setCellValue(o.getServiceProject());//服务内容
+			else if(i==4){//服务年限
+				cell.setCellValue(o.getServiceYear());
+			}
+			else if(i==5)cell.setCellValue(o.getMemberLvl());//会员级别
+			else if(i==6)cell.setCellValue(o.getTaskName());		//业务负责人
+			else if(i==7)cell.setCellValue(o.getProjectName());		//项目负责人
+			else if(i==8)cell.setCellValue(o.getTechnologyName());		//技术咨询师
+			else if(i==9)cell.setCellValue(o.getFinanceTaxationName());	//财税咨询师
+			else if(i==10)cell.setCellValue(getBigDecimal(o.getBeforeLastRdSalesAmount()));  //上上年度销售收入
+			else if(i==11)cell.setCellValue(getBigDecimal(o.getBeforeLastRdBudget()));  //上上年度研发费用
+			else if(i==12)cell.setCellValue(getBigDecimal(o.getLastRdSalesAmount())); //上年度销售收入
+			else if(i==13)cell.setCellValue(getBigDecimal(o.getRdSalesAmount())); //上年度研发费用
+			else if(i==14)cell.setCellValue(o.getWorkersNumber());//职工人数
+			else if(i==15)cell.setCellValue(o.getTechnologyNumber());//科技人员
+			else if(i==16)cell.setCellValue(o.getWorkersRate()+"%");//人员占比
+			else if(i==17)cell.setCellValue(o.getProjectApprovalNumber());//研发立项数
+			else if(i==18)cell.setCellValue(getBigDecimal(o.getRdBudget()));//年度研发预算总额
+			else if(i==19)cell.setCellValue(getBigDecimal(o.getRdSalesAmount()));//年度销售预计收入
+			else if(i==20)cell.setCellValue(o.getRdBudgetRate()+"%");//年度研发费用预算占比
+			else if(i==21)cell.setCellValue(o.getThreeYearsActualRdRate()+"%");//三年度研发费用占比
+			else if(i==22){//数据周期
+				if (o.getDataCycle()==null){
+					cell.setCellValue("");
+				}else {
+					switch (o.getDataCycle())
+					{
+						case 0:
+							cell.setCellValue("第一季度");
+							break;
+						case 1: cell.setCellValue("上半年"); break;
+						case 2: cell.setCellValue("前三季度"); break;
+						case 3: cell.setCellValue("全年"); break;
 
+					}
 				}
+			}else if(i==23){//已立项RD数
+				cell.setCellValue(o.getActualRdNumber());
+			}else if(i==24){//委外项目数
+				cell.setCellValue(o.getActualOutsourcingNumber());
+			}
+			else if(i==25){//合作项目数
+				cell.setCellValue(o.getActualCooperateNumber());
+			}
+			else if(i==26){//已归集研发费用总额
+				cell.setCellValue(o.getActualRdAmount().stripTrailingZeros().toPlainString());
+			}
+			else if(i==27){//研发预算完成度
+				cell.setCellValue(o.getRdCompletionProgress()+"%");
+			}
+			else if(i==28){//年度实际销售额
+				cell.setCellValue(getBigDecimal(o.getActualSalesAmount()));
 			}
-			else if(i==17)cell.setCellValue(o.getActualRdNumber());
-			else if(i==18){
-				if (o.getActualRdAmount() !=null){
-					cell.setCellValue(o.getActualRdAmount().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
+			else if(i==29){//年度研发费用占比
+				cell.setCellValue(o.getActualRdRate()+"%");
 			}
-			else if(i==19){
-				if (o.getActualSalesAmount() !=null){
-					cell.setCellValue(o.getActualSalesAmount().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
+			else if(i==30){//三年研发费用占比
+				cell.setCellValue(o.getThreeYearsActualRdRate()+"%");
 			}
-			else if(i==20)cell.setCellValue(o.getActualRdRate());
-			else if(i==21)cell.setCellValue(o.getThreeYearsActualRdRate());
-			else if(i==22) {
+			else if(i==31){//火炬统计
 				addParam(cell,o.getTorchStatus(),o.getTorchOther());
 			}
-			else if(i==23){
+			else if(i==32){//统计年报
 				addParam(cell,o.getStatisticsStatus(),o.getStatisticsOther());
 			}
-			else if(i==24){
+			else if(i==33){//高企年报
 				addParam(cell,o.getChStatus(),o.getChOther());
 			}
-			else if(i==25){
+			else if(i==34){//汇算清缴-是否完成
 				addParam(cell,o.getFinalSettlementStatus(),o.getFinalSettlementOther());
 			}
-			else if(i==26){
-				if (o.getReportRdAmount() !=null){
-					cell.setCellValue(o.getReportRdAmount().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
+			else if(i==35){//汇算清缴-加扣RD数
+				cell.setCellValue(o.getReportFormsRdNumber());
 			}
-			else if(i==27){
+			else if(i==36){//汇算清缴-知识产权加扣费用
+				cell.setCellValue(getBigDecimal(o.getIntellectualPropertyAmount()));
+			}
+			else if(i==37){//汇算清缴-加扣研发费用金额
+				cell.setCellValue(getBigDecimal(o.getReportRdAmount()));
+			}
+			else if(i==38){//研发准备金备案
 				addParam(cell,o.getRdReservesStatus(),o.getRdReservesOther());
 			}
-			else if(i==28){
+			else if(i==39){//研发奖补申请-是否完成
 				addParam(cell,o.getRdAwardCompensationStatus(),o.getRdAwardCompensationOther());
 			}
-			else if(i==29){
-				if (o.getRdAnnouncementAmount() !=null){
-					cell.setCellValue(o.getRdAnnouncementAmount().stripTrailingZeros().toPlainString());
-				}else cell.setCellValue("");
+			else if(i==40){//研发奖补申请-申请金额
+				cell.setCellValue(getBigDecimal(o.getRdApplicationFee()));
+			}
+			else if(i==41){//研发奖补申请-公示金额
+				cell.setCellValue(getBigDecimal(o.getRdAnnouncementAmount()));
+			}
+			else if(i==42){//研发奖补申请-其他
+				cell.setCellValue(o.getRdAnnouncementOther());
 			}
-			else if(i==30){
+			else if(i==43){//加扣备查交付
 				addParam(cell,o.getAdDeliverStatus(),o.getAdDeliverOther());
 			}
-			else if(i==31){
+			else if(i==44){//加扣是否归档
+				if(o.getAdDeliverFinish()==null){
+					cell.setCellValue("");
+				}else if(o.getAdDeliverFinish()==1){
+					cell.setCellValue("是");
+				}else if(o.getAdDeliverFinish()==0){
+					cell.setCellValue("否");
+				}
+			}
+			else if(i==45){//高新备查交付
 				addParam(cell,o.getHtDeliverStatus(),o.getHtDeliverOther());
 			}
-			else if(i==32){
+			else if(i==46){//高新是否归档
+				if (o.getHtDeliverFinish()==null){
+					cell.setCellValue("");
+				}else if(o.getHtDeliverFinish()==1){
+					cell.setCellValue("是");
+				}else if(o.getHtDeliverFinish()==0){
+					cell.setCellValue("否");
+				}
+			}
+			else if(i==47){//召开上年度会议于本年度工作计划
+				addParam(cell,o.getCloseMeetingStatus(),o.getCloseMeetingOther());
+			}
+			else if(i==48){//阶段性汇报
 				StringBuilder res= new StringBuilder();
 				if (o.getPhasedType()==1){
 					res.append("月度- ");
@@ -2056,68 +2097,57 @@ public class NewExcelUtil<T> {
 					res.append("季度- ");
 				}
 				String[] split = o.getPhasedContent().split(",");
-                for (String s : split) {
-                    res.append(s).append("月 ,");
-                }
+				for (String s : split) {
+					res.append(s).append("月 ,");
+				}
 				if(res.toString().contains(",")){
 					cell.setCellValue(res.substring(0,res.length()-1));
 				}else {
 					cell.setCellValue("");
 				}
 			}
-			else if(i==33){
+			else if(i==49){//立项资料编制-完成数
 				cell.setCellValue(o.getProjectApprovalWriteNumber());
-			}
-			else if(i==34){
-				cell.setCellValue(o.getProjectApprovalWriteRate());
-			}
-			else if(i==35){
+			}else if(i==50){//立项资料编制-完成率
+				cell.setCellValue(o.getProjectApprovalWriteRate()+"%");
+			}else if(i==51){//加扣预计申报7月
 				addParam(cell,o.getAdPrepareJulyStatus(),o.getAdPrepareJulyOther());
-			}
-			else if(i==36){
+			}else if(i==52){//加扣预计申报10月
 				addParam(cell,o.getAdPrepareOctoberStatus(),o.getAdPrepareOctoberOther());
-			}
-			else if(i==37){
-				cell.setCellValue(o.getIpDeclare());
-			}
-			else if(i==38){
-				cell.setCellValue(o.getIpAuthorize());
-			}
-			else if(i==39){
+			}else if(i==53){//知识产权-发明专利-申报数
+				cell.setCellValue(o.getIpInventionPatentDeclare());
+			}else if(i==54){//知识产权-发明专利-授权数
+				cell.setCellValue(o.getIpInventionPatentAuthorize());
+			}else if(i==55){///知识产权-发明专利-累计授权数
+				cell.setCellValue(o.getIpInventionPatentAuthorizeCount());
+			}else if(i==56){//实用新型-申报数
+				cell.setCellValue(o.getIpUtilityModelDeclare());
+			}else if(i==57){//实用新型-授权数
+				cell.setCellValue(o.getIpUtilityModelAuthorize());
+			}else if(i==58){//实用新型-累计授权数
+				cell.setCellValue(o.getIpUtilityModelAuthorizeCount());
+			}else if(i==59){//软著-申报数
+				cell.setCellValue(o.getIpSoftwareWorksDeclare());
+			}else if(i==60){//软著-授权数
+				cell.setCellValue(o.getIpSoftwareWorksAuthorize());
+			}else if(i==61){//软著-累计授权数
+				cell.setCellValue(o.getIpSoftwareWorksAuthorizeCount());
+			}else if(i==62){//软著-截止本年末可用于下次高新认定数量
+				cell.setCellValue(o.getIpHt());
+			}else if(i==63){//软著-I类数量
+				cell.setCellValue(o.getIpHtI());
+			}else if(i==64){//软著-II类数量
+				cell.setCellValue(o.getIpHtIi());
+			}else if(i==65){//公出指标-合同约定次数
 				cell.setCellValue(o.getPublicReleaseStipulation());
-			}
-			else if(i==40){
+			}else if(i==66){//公出指标-实际次数
 				cell.setCellValue(o.getPublicReleaseActual());
-			}
-			else if(i==41){
+			}else if(i==67){//培训指标(本年度)-合同约定次数
 				cell.setCellValue(o.getTrainingStipulation());
-			}
-			else if(i==42){
+			}else if(i==68){//培训指标(本年度)-实际次数
 				cell.setCellValue(o.getTrainingActual());
-			}
-			else if(i==43){
-				cell.setCellValue(o.getSpecialInspect());
-			}
-			else if(i==44){
-				cell.setCellValue(o.getSimulatedAudit());
-			}
-			else if(i==45){
-				cell.setCellValue(o.getFeaturedWorkOther());
-			}
-			else if(i==46){
-				addParam(cell,o.getWebSubmit(),o.getWebSubmitOther());
-			}
-			else if(i==47){
-				addParam(cell,o.getPaperSubmit(),o.getPaperSubmitOther());
-			}
-			else if(i==48){
-				cell.setCellValue(o.getReviewProvinceNumber());
-			}
-			else if(i==49){
-				cell.setCellValue(o.getReviewCountryNumber());
-			}
-			else if(i==50){
-				cell.setCellValue(DateUtils.formatDateYYYYMMddHHmm(o.getUpdateTime()));
+			}else if(i==69){//培训指标(本年度)-其他
+				cell.setCellValue(o.getTrainingOther());
 			}else {
 				cell.setCellValue("");
 			}
@@ -2126,6 +2156,14 @@ public class NewExcelUtil<T> {
 
 	}
 
+	private String getBigDecimal(BigDecimal bigDecimal) {
+		if (bigDecimal==null){
+			return "";
+		}else {
+			return bigDecimal.stripTrailingZeros().toPlainString();
+		}
+	}
+
 	private void addParam(Cell cell, Integer code, String desc) {
 		switch (code)
 		{

+ 159 - 26
src/main/java/com/goafanti/techproject/bo/OutTaskDetailsBo.java

@@ -17,7 +17,7 @@ public class OutTaskDetailsBo {
      */
     private Integer memberStatus;
     private String serviceProject;
-    private String serviceyear;
+    private String serviceYear;
     /**
      * 会员等级
      */
@@ -104,11 +104,28 @@ public class OutTaskDetailsBo {
      * 实际立项RD数
      */
     private Integer actualRdNumber;
+
+    /**
+     * 实际委外数
+     */
+    private Integer actualOutsourcingNumber;
+    /**
+     * 实际合作项目数
+     */
+    private Integer actualCooperateNumber;
+    /**
+     * 实际技术合同登记数
+     */
+    private Integer actualRegistrationNumber;
     /**
      * 实际归集研发费用
      */
     private BigDecimal actualRdAmount;
     /**
+     * 研发预算完成进度
+     */
+    private Double rdCompletionProgress;
+    /**
      * 年度研发预算占比
      */
     private Double actualRdRate;
@@ -253,13 +270,41 @@ public class OutTaskDetailsBo {
      */
     private String adPrepareOctoberOther;
     /**
-     * 知识产权申报数
+        * 知识产权发明专利申报数
+     */
+    private Integer ipInventionPatentDeclare;
+    /**
+     * 当年知识产权发明专利授权数
      */
-    private Integer ipDeclare;
+    private Integer ipInventionPatentAuthorize;
     /**
-     * 知识产权授权数
+     * 累计知识产权发明专利授权数
      */
-    private Integer ipAuthorize;
+    private Integer ipInventionPatentAuthorizeCount;
+    /**
+     * 知识产权实用新型申报数
+     */
+    private Integer ipUtilityModelDeclare;
+    /**
+     * 当年知识产权实用新型授权数
+     */
+    private Integer ipUtilityModelAuthorize;
+    /**
+     * 累计知识产权实用新型授权数
+     */
+    private Integer ipUtilityModelAuthorizeCount;
+    /**
+     * 知识产权软著申报数
+     */
+    private Integer ipSoftwareWorksDeclare;
+    /**
+     * 当年知识产权软著授权数
+     */
+    private Integer ipSoftwareWorksAuthorize;
+    /**
+     * 累计知识产权软著授权数
+     */
+    private Integer ipSoftwareWorksAuthorizeCount;
     /**
      * 知识产权高新数
      */
@@ -373,7 +418,93 @@ public class OutTaskDetailsBo {
      */
     private Date createTime;
 
+    public Integer getIpInventionPatentDeclare() {
+        return ipInventionPatentDeclare;
+    }
+
+    public void setIpInventionPatentDeclare(Integer ipInventionPatentDeclare) {
+        this.ipInventionPatentDeclare = ipInventionPatentDeclare;
+    }
+
+    public Integer getIpInventionPatentAuthorize() {
+        return ipInventionPatentAuthorize;
+    }
 
+    public void setIpInventionPatentAuthorize(Integer ipInventionPatentAuthorize) {
+        this.ipInventionPatentAuthorize = ipInventionPatentAuthorize;
+    }
+
+    public Integer getIpInventionPatentAuthorizeCount() {
+        return ipInventionPatentAuthorizeCount;
+    }
+
+    public void setIpInventionPatentAuthorizeCount(Integer ipInventionPatentAuthorizeCount) {
+        this.ipInventionPatentAuthorizeCount = ipInventionPatentAuthorizeCount;
+    }
+
+    public Integer getIpUtilityModelDeclare() {
+        return ipUtilityModelDeclare;
+    }
+
+    public void setIpUtilityModelDeclare(Integer ipUtilityModelDeclare) {
+        this.ipUtilityModelDeclare = ipUtilityModelDeclare;
+    }
+
+    public Integer getIpUtilityModelAuthorize() {
+        return ipUtilityModelAuthorize;
+    }
+
+    public void setIpUtilityModelAuthorize(Integer ipUtilityModelAuthorize) {
+        this.ipUtilityModelAuthorize = ipUtilityModelAuthorize;
+    }
+
+    public Integer getIpUtilityModelAuthorizeCount() {
+        return ipUtilityModelAuthorizeCount;
+    }
+
+    public void setIpUtilityModelAuthorizeCount(Integer ipUtilityModelAuthorizeCount) {
+        this.ipUtilityModelAuthorizeCount = ipUtilityModelAuthorizeCount;
+    }
+
+    public Integer getIpSoftwareWorksDeclare() {
+        return ipSoftwareWorksDeclare;
+    }
+
+    public void setIpSoftwareWorksDeclare(Integer ipSoftwareWorksDeclare) {
+        this.ipSoftwareWorksDeclare = ipSoftwareWorksDeclare;
+    }
+
+    public Integer getIpSoftwareWorksAuthorize() {
+        return ipSoftwareWorksAuthorize;
+    }
+
+    public void setIpSoftwareWorksAuthorize(Integer ipSoftwareWorksAuthorize) {
+        this.ipSoftwareWorksAuthorize = ipSoftwareWorksAuthorize;
+    }
+
+    public Integer getIpSoftwareWorksAuthorizeCount() {
+        return ipSoftwareWorksAuthorizeCount;
+    }
+
+    public void setIpSoftwareWorksAuthorizeCount(Integer ipSoftwareWorksAuthorizeCount) {
+        this.ipSoftwareWorksAuthorizeCount = ipSoftwareWorksAuthorizeCount;
+    }
+
+    public Double getRdCompletionProgress() {
+        return rdCompletionProgress;
+    }
+
+    public void setRdCompletionProgress(Double rdCompletionProgress) {
+        this.rdCompletionProgress = rdCompletionProgress;
+    }
+
+    public String getServiceYear() {
+        return serviceYear;
+    }
+
+    public void setServiceYear(String serviceYear) {
+        this.serviceYear = serviceYear;
+    }
 
     public String getUserName() {
         return userName;
@@ -391,13 +522,6 @@ public class OutTaskDetailsBo {
         this.serviceProject = serviceProject;
     }
 
-    public String getServiceyear() {
-        return serviceyear;
-    }
-
-    public void setServiceyear(String serviceyear) {
-        this.serviceyear = serviceyear;
-    }
 
     public String getLastYear() {
         return lastYear;
@@ -927,21 +1051,7 @@ public class OutTaskDetailsBo {
         this.adPrepareOctoberOther = adPrepareOctoberOther;
     }
 
-    public Integer getIpDeclare() {
-        return ipDeclare;
-    }
 
-    public void setIpDeclare(Integer ipDeclare) {
-        this.ipDeclare = ipDeclare;
-    }
-
-    public Integer getIpAuthorize() {
-        return ipAuthorize;
-    }
-
-    public void setIpAuthorize(Integer ipAuthorize) {
-        this.ipAuthorize = ipAuthorize;
-    }
 
     public Integer getIpHt() {
         return ipHt;
@@ -1168,4 +1278,27 @@ public class OutTaskDetailsBo {
         this.createTime = createTime;
     }
 
+    public Integer getActualOutsourcingNumber() {
+        return actualOutsourcingNumber;
+    }
+
+    public void setActualOutsourcingNumber(Integer actualOutsourcingNumber) {
+        this.actualOutsourcingNumber = actualOutsourcingNumber;
+    }
+
+    public Integer getActualCooperateNumber() {
+        return actualCooperateNumber;
+    }
+
+    public void setActualCooperateNumber(Integer actualCooperateNumber) {
+        this.actualCooperateNumber = actualCooperateNumber;
+    }
+
+    public Integer getActualRegistrationNumber() {
+        return actualRegistrationNumber;
+    }
+
+    public void setActualRegistrationNumber(Integer actualRegistrationNumber) {
+        this.actualRegistrationNumber = actualRegistrationNumber;
+    }
 }

+ 18 - 0
src/main/java/com/goafanti/techproject/bo/TaskDetailsBo.java

@@ -11,6 +11,9 @@ public class TaskDetailsBo extends TaskDetails {
     private String contractNo;
 
     private String userName;
+
+    private String ServiceYear;
+    private String ServiceProject;
     /**
      * 会员  0否 1是
      */
@@ -25,6 +28,21 @@ public class TaskDetailsBo extends TaskDetails {
     List<Map<String,Object >> taskList;
     List<TaskFeature> featureList;
 
+    public String getServiceProject() {
+        return ServiceProject;
+    }
+
+    public void setServiceProject(String serviceProject) {
+        ServiceProject = serviceProject;
+    }
+
+    public String getServiceYear() {
+        return ServiceYear;
+    }
+
+    public void setServiceYear(String serviceYear) {
+        ServiceYear = serviceYear;
+    }
 
     public List<TaskFeature> getFeatureList() {
         return featureList;

+ 49 - 22
src/main/java/com/goafanti/techproject/service/impl/TaskDetailsServiceImpl.java

@@ -11,14 +11,14 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.techproject.bo.InputTaskFeature;
-import com.goafanti.techproject.bo.OutTaskDetailsBo;
 import com.goafanti.techproject.bo.TaskDetailsBo;
 import com.goafanti.techproject.service.TaskDetailsService;
-import org.springframework.beans.BeanUtils;
+import org.apache.commons.beanutils.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.*;
@@ -92,6 +92,7 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
                 }
             }
             String serviceYear = getServiceYer(thisTask.getServiceYear());
+
             Integer tid=null;
             for (TOrderTaskBo e : collect2) {
                 //添加判定去掉赠字比对
@@ -113,12 +114,17 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
                 }
             }
             if (taskDetails !=null){
-                BeanUtils.copyProperties(taskDetails, res);
+                try {
+                    BeanUtils.copyProperties(res, taskDetails);
+                } catch (IllegalAccessException | InvocationTargetException e) {
+                    throw new RuntimeException(e);
+                }
             }
             res.setUserName(mid.getBuyerName());
             res.setOrderNo(tOrderNew.getOrderNo());
             res.setContractNo(tOrderNew.getContractNo());
             res.setMemberStatus(mid.getProjectType());
+            res.setServiceYear(serviceYear);
             res.setTaskList(list);
             BigDecimal totalAmount = tOrderNew.getTotalAmount().divide(new BigDecimal(yearSum), 2, RoundingMode.HALF_UP);
             String lvl=getOrderLvl(totalAmount);
@@ -142,14 +148,18 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
                 }
             }
             String serviceYear = getServiceYer(thisTask.getServiceYear());
-            Integer tid=null;
             list=addOrderList(collect2,serviceYear);
             if (taskDetails !=null){
-                BeanUtils.copyProperties(taskDetails, res);
+                try {
+                    BeanUtils.copyProperties( res,taskDetails);
+                } catch (IllegalAccessException | InvocationTargetException e) {
+                    throw new RuntimeException(e);
+                }
             }
             res.setUserName(mid.getBuyerName());
             res.setOrderNo(tOrderNew.getOrderNo());
             res.setContractNo(tOrderNew.getContractNo());
+            res.setServiceYear(serviceYear);
             res.setMemberStatus(mid.getProjectType());
             res.setTaskList(list);
             BigDecimal totalAmount = tOrderNew.getTotalAmount().divide(new BigDecimal(yearSum), 2, RoundingMode.HALF_UP);
@@ -225,7 +235,11 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
         this.taskDetailsMapper.insert(taskDetails);
         //新增日志数据
         if (type==1){
-            addTaskDetailsLog(taskDetails);
+            try {
+                addTaskDetailsLog(taskDetails);
+            } catch (InvocationTargetException | IllegalAccessException e) {
+                throw new RuntimeException(e);
+            }
         }
         return taskDetails;
     }
@@ -236,10 +250,10 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
      * @param taskDetails 项目进度数据
      *
      */
-    private void addTaskDetailsLog(TaskDetails taskDetails) {
+    private void addTaskDetailsLog(TaskDetails taskDetails) throws InvocationTargetException, IllegalAccessException {
         Admin adminToken = TokenManager.getAdminToken();
         TaskDetailsLog log=new TaskDetailsLog();
-        BeanUtils.copyProperties(taskDetails, log);
+        BeanUtils.copyProperties(log, taskDetails);
         log.setTdid(taskDetails.getId());
         log.setId(null);
         log.setAid(adminToken.getId());
@@ -249,7 +263,7 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
         List<TaskFeature> list = taskFeatureMapper.selectByTdId(taskDetails.getId());
         for (TaskFeature feature : list) {
             TaskFeatureLog tfLog = new TaskFeatureLog();
-            BeanUtils.copyProperties(feature, tfLog);
+            BeanUtils.copyProperties(tfLog, feature);
             tfLog.setTdlId(log.getId());
             tfLog.setId(null);
             tfLog.setAid(adminToken.getId());
@@ -332,7 +346,11 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
         TaskDetails res = this.queryById(taskDetails.getId());
         //调用就保存,不需要区分不保存
 //        if (type !=null&&type==1){
+        try {
             addTaskDetailsLog(res);
+        } catch (InvocationTargetException | IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
 //        }
         return res;
     }
@@ -360,20 +378,25 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
 
 
     @Override
-    public Result exportById(Integer id) {
-        OutTaskDetailsBo res = new OutTaskDetailsBo();
-        NewExcelUtil<OutTaskDetailsBo> excel=new NewExcelUtil<>(OutTaskDetailsBo.class);
+    public Result exportById(Integer id)  {
+        NewExcelUtil<TaskDetailsBo> excel=new NewExcelUtil<>(TaskDetailsBo.class);
         TaskDetailsBo byTid = pushByTid(id);
-        BeanUtils.copyProperties(byTid,res);
-        StringBuffer sb = new StringBuffer();
-        byTid.getTaskList().forEach(e->{
-            if (res.getServiceyear()==null){
-                res.setServiceyear((String) e.get("serviceYear"));
+        pushGetServiceProject(byTid);
+        return excel.exportTaskDetailsExcel(byTid,"项目进度表",uploadPath);
+    }
+
+    private void pushGetServiceProject( TaskDetailsBo res) {
+        List<Map<String, Object>> taskList = res.getTaskList();
+        String serviceYear = null;
+        if (taskList!=null){
+            StringBuffer sb = new StringBuffer();
+            for (Map<String, Object> map : taskList) {
+                sb.append(map.get("taskName")).append("-").append(map.get("serviceYear")).append(",");
+                if (serviceYear==null)serviceYear = (String) map.get("serviceYear");
             }
-            sb.append(e.get("taskName")).append("; ");
-        });
-        res.setServiceProject(sb.toString());
-        return excel.exportTaskDetailsExcel(res,"项目进度表",uploadPath);
+            res.setServiceYear(serviceYear);
+            res.setServiceProject(sb.substring(0,sb.length()-1));
+        }
     }
 
     @Override
@@ -429,7 +452,11 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
         String serviceYear = getServiceYer(thisTask.getServiceYear());
         list=addOrderList(tOrderTaskBos, serviceYear);
         if (taskDetails !=null){
-            BeanUtils.copyProperties(log, res);
+            try {
+                BeanUtils.copyProperties(res, log);
+            } catch (IllegalAccessException | InvocationTargetException e) {
+                throw new RuntimeException(e);
+            }
         }
         res.setUserName(mid.getBuyerName());
         res.setOrderNo(tOrderNew.getOrderNo());