Commit bdd4b0cc authored by Quxl's avatar Quxl

x

parent 7aaeb993
...@@ -15,6 +15,7 @@ import java.util.Map; ...@@ -15,6 +15,7 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFPatriarch; import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
...@@ -637,11 +638,7 @@ public class ExportServiceImpl implements ExportService { ...@@ -637,11 +638,7 @@ public class ExportServiceImpl implements ExportService {
mvPhotoConn.setConnectTimeout(50 * 1000); mvPhotoConn.setConnectTimeout(50 * 1000);
InputStream mvPhotoInstream = mvPhotoConn.getInputStream(); InputStream mvPhotoInstream = mvPhotoConn.getInputStream();
byte[] mvPhotoBytes = FileUtil.streamToBytes(mvPhotoInstream); byte[] mvPhotoBytes = FileUtil.streamToBytes(mvPhotoInstream);
CreationHelper helper = sheet.getWorkbook().getCreationHelper(); ClientAnchor anchor = new HSSFClientAnchor(0,0,0,0,(short)0,3,(short)8,3);
ClientAnchor anchor = helper.createClientAnchor();
anchor.setRow1(3);
anchor.setCol1(0);
anchor.setAnchorType(3);
patriarch.createPicture(anchor, wb.addPicture(mvPhotoBytes, HSSFWorkbook.PICTURE_TYPE_JPEG)); patriarch.createPicture(anchor, wb.addPicture(mvPhotoBytes, HSSFWorkbook.PICTURE_TYPE_JPEG));
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -660,11 +657,7 @@ public class ExportServiceImpl implements ExportService { ...@@ -660,11 +657,7 @@ public class ExportServiceImpl implements ExportService {
directorPhotoConn.setConnectTimeout(50 * 1000); directorPhotoConn.setConnectTimeout(50 * 1000);
InputStream directorPhotoInstream = directorPhotoConn.getInputStream(); InputStream directorPhotoInstream = directorPhotoConn.getInputStream();
byte[] directorPhotoBytes = FileUtil.streamToBytes(directorPhotoInstream); byte[] directorPhotoBytes = FileUtil.streamToBytes(directorPhotoInstream);
CreationHelper helper = sheet.getWorkbook().getCreationHelper(); ClientAnchor anchor = new HSSFClientAnchor(0,0,0,0,(short)2,18,(short)3,25);
ClientAnchor anchor = helper.createClientAnchor();
anchor.setRow1(3);
anchor.setCol1(0);
anchor.setAnchorType(3);
patriarch.createPicture(anchor, wb.addPicture(directorPhotoBytes, HSSFWorkbook.PICTURE_TYPE_JPEG)); patriarch.createPicture(anchor, wb.addPicture(directorPhotoBytes, HSSFWorkbook.PICTURE_TYPE_JPEG));
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment