Commit e888abaf authored by Quxl's avatar Quxl

x

parent 859b39c5
......@@ -633,17 +633,17 @@ public class ExportServiceImpl implements ExportService {
}
Map<String, String> photoVars = new HashMap<String, String>();
photoVars.put("0,3,9,3", filmExt.getPhoto_mv());
photoVars.put("2,18,3,25", filmExt.getPhoto_director());
photoVars.put("1,4,10,4", filmExt.getPhoto_mv());
photoVars.put("3,19,4,26", filmExt.getPhoto_director());
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
for(String key : photoVars.keySet()) {
if(StringUtil.isNotBlank(key)) {
try {
String[] c1_r1_c2_r2_ary = key.split(",", 4);
short c1 = Short.valueOf(c1_r1_c2_r2_ary[0]);
int r1 = Integer.valueOf(c1_r1_c2_r2_ary[1]);
short c2 = Short.valueOf(c1_r1_c2_r2_ary[2]);
int r2 = Integer.valueOf(c1_r1_c2_r2_ary[3]);
int c1 = Integer.valueOf(c1_r1_c2_r2_ary[0]) - 1;
int r1 = Integer.valueOf(c1_r1_c2_r2_ary[1]) - 1;
int c2 = Integer.valueOf(c1_r1_c2_r2_ary[2]) - 1;
int r2 = Integer.valueOf(c1_r1_c2_r2_ary[3]) - 1;
String pathMvPhoto = ossService.getOssPath(photoVars.get(key), 10);
URL mvPhotoUrl = new URL(pathMvPhoto);
HttpURLConnection mvPhotoConn = (HttpURLConnection)mvPhotoUrl.openConnection();
......@@ -651,7 +651,7 @@ public class ExportServiceImpl implements ExportService {
mvPhotoConn.setConnectTimeout(50 * 1000);
InputStream mvPhotoInstream = mvPhotoConn.getInputStream();
byte[] mvPhotoBytes = FileUtil.streamToBytes(mvPhotoInstream);
ClientAnchor anchor = new HSSFClientAnchor(0, 0, 1023, 255, c1, r1, c2, r2);
ClientAnchor anchor = new HSSFClientAnchor(0, 0, 1023, 255, (short)c1, r1, (short)c2, r2);
int pritureType = HSSFWorkbook.PICTURE_TYPE_JPEG;
String fileName = filmExt.getPhoto_director().toUpperCase();
if(fileName.endsWith(".JPG") || fileName.endsWith(".JPEG")) {
......
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