| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package UIB.UIB03.ZBS;
- import java.io.ByteArrayOutputStream;
- import java.io.InputStream;
- import java.io.OutputStream;
- import jxl.Workbook;
- import jxl.write.WritableSheet;
- import jxl.write.WritableWorkbook;
- public class TestAbc implements IQltyGuaranteeEngine
- {
- public TestAbc(){}
-
- public OutputStream getOutputStream(InputStream is) throws Exception
- {
- OutputStream os = this.getWorkBookStream(is);
- return os;
- }
-
- private OutputStream getWorkBookStream(InputStream is) throws Exception
- {
- OutputStream os = new ByteArrayOutputStream();//建立输出流,填入数据的EXCEL形成该输出流
- Workbook wBook = Workbook.getWorkbook(is);//获取EXCEL对象,生成工作薄
- WritableWorkbook wwBook = Workbook.createWorkbook(os, wBook);//创建可操作副本
- WritableSheet wSheet = wwBook.getSheet(0);//获取第0个工作表
-
- IQltyGuaranteeBuilder explorer = null;
- // if("A".equals(tmplNO.substring(0,1)))
- // {
- // //A类型质保书......
- // explorer = new QltyGuaranteeBuilderA(wSheet);
- // }
- // else if("B".equals(tmplNO.substring(0,1)))
- // {
- // //B类型质保书......
- // explorer = new QltyGuaranteeBuilderB(wSheet);
- // }
- // explorer.buildQltyGuarantee(tmplNO, mapHead, drlChem, drlQlty);
- //
- wwBook.write();
- os.close();
- wwBook.close();
- wBook.close();
- return os;
- }
- }
|