Browse Source

项目进度详情开发

anderx 1 year ago
parent
commit
851b4db043
1 changed files with 53 additions and 177 deletions
  1. 53 177
      src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java

+ 53 - 177
src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java

@@ -1944,7 +1944,7 @@ public class NewExcelUtil<T> {
     }
 
 	private void addCell(Row row,OutTaskDetailsBo o) {
-		for (int i = 0; i < 53; i++) {
+		for (int i = 0; i < 51; i++) {
 			Cell cell = row.createCell(i);
 			cell.setCellStyle(styles.get("data4"));
 			if (i==0)cell.setCellValue(1);
@@ -1974,17 +1974,7 @@ public class NewExcelUtil<T> {
 				}else cell.setCellValue("");
 			}
 			else if(i==10){
-				switch (o.getCloseMeetingStatus())
-					{
-						case 0:
-							String res="其他:"+o.getCloseMeetingOther();
-							cell.setCellValue(res);
-							break;
-						case 1: cell.setCellValue("待完成"); break;
-						case 2: cell.setCellValue("已完成"); break;
-						case 3: cell.setCellValue("合同无此项"); break;
-
-					}
+				addParam(cell,o.getCloseMeetingStatus(),o.getCloseMeetingOther());
 			}else if(i==11){
 				cell.setCellValue(o.getProjectApprovalNumber());
 			}else if(i==12){
@@ -2025,52 +2015,16 @@ public class NewExcelUtil<T> {
 			else if(i==20)cell.setCellValue(o.getActualRdRate());
 			else if(i==21)cell.setCellValue(o.getThreeYearsActualRdRate());
 			else if(i==22) {
-				switch (o.getTorchStatus())
-				{
-					case 0:
-						String res="其他:"+o.getTorchOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				addParam(cell,o.getTorchStatus(),o.getTorchOther());
 			}
 			else if(i==23){
-				switch (o.getStatisticsStatus())
-				{
-					case 0:
-						String res="其他:"+o.getStatisticsOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				addParam(cell,o.getStatisticsStatus(),o.getStatisticsOther());
 			}
 			else if(i==24){
-				switch (o.getChStatus())
-				{
-					case 0:
-						String res="其他:"+o.getChOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				addParam(cell,o.getChStatus(),o.getChOther());
 			}
 			else if(i==25){
-				switch (o.getFinalSettlementStatus())
-				{
-					case 0:
-						String res="其他:"+o.getFinalSettlementOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				addParam(cell,o.getFinalSettlementStatus(),o.getFinalSettlementOther());
 			}
 			else if(i==26){
 				if (o.getReportRdAmount() !=null){
@@ -2078,182 +2032,91 @@ public class NewExcelUtil<T> {
 				}else cell.setCellValue("");
 			}
 			else if(i==27){
-				switch (o.getRdReservesStatus())
-				{
-					case 0:
-						String res="其他:"+o.getRdReservesOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				addParam(cell,o.getRdReservesStatus(),o.getRdReservesOther());
 			}
 			else if(i==28){
-				switch (o.getRdAwardCompensationStatus())
-				{
-					case 0:
-						String res="其他:"+o.getRdAwardCompensationOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				addParam(cell,o.getRdAwardCompensationStatus(),o.getRdAwardCompensationOther());
 			}
 			else if(i==29){
-				switch (o.getRdAwardCompensationStatus())
-				{
-					case 0:
-						String res="其他:"+o.getRdAwardCompensationOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
-			}
-			else if(i==30){
 				if (o.getRdAnnouncementAmount() !=null){
 					cell.setCellValue(o.getRdAnnouncementAmount().stripTrailingZeros().toPlainString());
 				}else cell.setCellValue("");
 			}
+			else if(i==30){
+				addParam(cell,o.getAdDeliverStatus(),o.getAdDeliverOther());
+			}
 			else if(i==31){
-				switch (o.getAdDeliverStatus())
-				{
-					case 0:
-						String res="其他:"+o.getAdDeliverOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				addParam(cell,o.getHtDeliverStatus(),o.getHtDeliverOther());
 			}
 			else if(i==32){
-				switch (o.getAdDeliverStatus())
-				{
-					case 0:
-						String res="其他:"+o.getAdDeliverOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
-			}
-			else if(i==33){
-				switch (o.getHtDeliverStatus())
-				{
-					case 0:
-						String res="其他:"+o.getHtDeliverOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
-			}
-			else if(i==34){
 				StringBuilder res= new StringBuilder();
 				if (o.getPhasedType()==1){
 					res.append("月度");
 				}else if (o.getPhasedType()==2){
-					res.append("季度");
+					res.append("季度/ ");
 				}
 				String[] split = o.getPhasedContent().split(",");
                 for (String s : split) {
-                    res.append(s).append("月");
+                    res.append(s).append("月 ,");
                 }
-				cell.setCellValue(res.toString());
+				if(res.toString().contains(",")){
+					cell.setCellValue(res.substring(0,res.length()-1));
+				}else {
+					cell.setCellValue("");
+				}
 			}
-			else if(i==35){
+			else if(i==33){
 				cell.setCellValue(o.getProjectApprovalWriteNumber());
 			}
-			else if(i==36){
+			else if(i==34){
 				cell.setCellValue(o.getProjectApprovalWriteRate());
 			}
+			else if(i==35){
+				addParam(cell,o.getAdPrepareJulyStatus(),o.getAdPrepareJulyOther());
+			}
+			else if(i==36){
+				addParam(cell,o.getAdPrepareOctoberStatus(),o.getAdPrepareOctoberOther());
+			}
 			else if(i==37){
-				switch (o.getAdPrepareJulyStatus())
-				{
-					case 0:
-						String res="其他:"+o.getAdPrepareJulyOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				cell.setCellValue(o.getIpDeclare());
 			}
 			else if(i==38){
-				switch (o.getAdPrepareOctoberStatus())
-				{
-					case 0:
-						String res="其他:"+o.getAdPrepareOctoberOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
+				cell.setCellValue(o.getIpAuthorize());
 			}
 			else if(i==39){
-				cell.setCellValue(o.getIpDeclare());
+				cell.setCellValue(o.getPublicReleaseStipulation());
 			}
 			else if(i==40){
-				cell.setCellValue(o.getIpAuthorize());
+				cell.setCellValue(o.getPublicReleaseActual());
 			}
 			else if(i==41){
-				cell.setCellValue(o.getPublicReleaseStipulation());
+				cell.setCellValue(o.getTrainingStipulation());
 			}
 			else if(i==42){
-				cell.setCellValue(o.getPublicReleaseActual());
+				cell.setCellValue(o.getTrainingActual());
 			}
 			else if(i==43){
-				cell.setCellValue(o.getTrainingStipulation());
+				cell.setCellValue(o.getSpecialInspect());
 			}
 			else if(i==44){
-				cell.setCellValue(o.getTrainingActual());
+				cell.setCellValue(o.getSimulatedAudit());
 			}
 			else if(i==45){
-				cell.setCellValue(o.getSpecialInspect());
+				cell.setCellValue(o.getFeaturedWorkOther());
 			}
 			else if(i==46){
-				cell.setCellValue(o.getSimulatedAudit());
+				addParam(cell,o.getWebSubmit(),o.getWebSubmitOther());
 			}
 			else if(i==47){
-				cell.setCellValue(o.getFeaturedWorkOther());
+				addParam(cell,o.getPaperSubmit(),o.getPaperSubmitOther());
 			}
 			else if(i==48){
-				switch (o.getWebSubmit()){
-					case 0:
-						String res="其他:"+o.getWebSubmitOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
-
-			}
-			else if(i==49){
-				switch (o.getPaperSubmit()){
-					case 0:
-						String res="其他:"+o.getPaperSubmitOther();
-						cell.setCellValue(res);
-						break;
-					case 1: cell.setCellValue("待完成"); break;
-					case 2: cell.setCellValue("已完成"); break;
-					case 3: cell.setCellValue("合同无此项"); break;
-				}
-			}
-			else if(i==50){
 				cell.setCellValue(o.getReviewProvinceNumber());
 			}
-			else if(i==51){
+			else if(i==49){
 				cell.setCellValue(o.getReviewCountryNumber());
 			}
-			else if(i==52){
+			else if(i==50){
 				cell.setCellValue(DateUtils.formatDateYYYYMMddHHmm(o.getUpdateTime()));
 			}else {
 				cell.setCellValue("");
@@ -2262,4 +2125,17 @@ public class NewExcelUtil<T> {
 
 
 	}
+
+	private void addParam(Cell cell, Integer code, String desc) {
+		switch (code)
+		{
+			case 0:
+				String res="其他:"+desc;
+				cell.setCellValue(res);
+				break;
+			case 1: cell.setCellValue("待完成"); break;
+			case 2: cell.setCellValue("已完成"); break;
+			case 3: cell.setCellValue("合同无此项"); break;
+		}
+	}
 }