소스 검색

打印测试

Signed-off-by: anderx <312518615@qq.com>
anderx 5 년 전
부모
커밋
172d0c28e9
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      src/main/java/com/goafanti/demandCollection/service/impl/DemandCollectionServiceImpl.java

+ 8 - 2
src/main/java/com/goafanti/demandCollection/service/impl/DemandCollectionServiceImpl.java

@@ -65,6 +65,7 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
 	public void exportDemandCollectionList(HttpServletResponse response, InputDemandCollection idc) throws IOException {
 		OutputStream out = response.getOutputStream();
 		try {
+			System.out.println(1);
 			String[] comment = { "编号", "单位名称", "单位性质", "行业领域", "所属市州", "所属园区", "拥有的省级及以上平台", "法人代表", "统一社会信用代码", "经济规模",
 					"人员规模", "成立时间", "注册资本", "通讯地址", "邮编", "联系人", "联系电话", "email", "主营业务及核心产品(服务)", "2018年度项目主营业务收入(万元)",
 					"2018年度项目净利润(万元)", "2019年度项目主营业务收入(万元)", "2019年度项目净利润(万元)", "年度研发投入", "年度研发投入占营业收入比例", "是否曾获银行贷款",
@@ -78,14 +79,17 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
 					"需求是否可以公开 ", "为解决技术难题能提供的合作资金", "资金用途", "资金缺口", "需求解决方式", "企业产品是否有销往国外", "企业产品是否有意向出口", "创建时间" };
     		String fileName ="需求征集表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
     		XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"需求征集表");
+    		System.out.println(2);
     		//根据列表编写文档
     		XSSFSheet sheet =wb.getSheetAt(0);
+    		
     		XSSFCellStyle styleTitle = wb.createCellStyle();
 			styleTitle.setAlignment(HorizontalAlignment.CENTER);
 			styleTitle.setWrapText(true);
+			System.out.println(3);
     		for (OutDemandCollection ob : (List<OutDemandCollection>)demandCollectionList(idc).getList()) {
+    			System.out.println(4);
     			int x=0;
-    			
     			//新增一行
     			XSSFRow r = sheet.createRow(sheet.getLastRowNum()+1);
     			for (int i = 0; i < comment.length; i++) {
@@ -145,7 +149,9 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
     				case "拟采取成果转移转化方式合作开发 " : o = ob.getNcqcgzyzhfshzkf(); break; 
     				case "拟采取成果转移转化方式技术转让 " : o = ob.getNcqcgzyzhfsjszr(); break; 
     				case "预计可转移转化时间" : o = ob.getYjkzyzhsj(); break; 
-    				case "成果简述" : o = ob.getCgjs(); break; 
+    				case "成果简述" : o = ob.getCgjs(); 
+    				if (x==0)sheet.setColumnWidth(i, 10000);
+    				break; 
     				case "是否有成果合作需求" : o = ob.getSfycghzxq(); break; 
     				case "是否有意向合作单位" : o = ob.getSfyyxhzdw(); break;
     				case "意向合作单位" : o = ob.getSfyyxhzdwValue(); break;