|
@@ -361,6 +361,7 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
dto.setStudentId(score.getStudentId());
|
|
dto.setStudentId(score.getStudentId());
|
|
dto.setStudentScoreId(score.getId());
|
|
dto.setStudentScoreId(score.getId());
|
|
dto.setImage(getSlice(score, q, answerImages));
|
|
dto.setImage(getSlice(score, q, answerImages));
|
|
|
|
+// saveSliceImage(score, dto.getImage());
|
|
try {
|
|
try {
|
|
queue.put(dto);
|
|
queue.put(dto);
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
@@ -396,6 +397,7 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
String tem = url.split("\\?")[0];
|
|
String tem = url.split("\\?")[0];
|
|
String suff = tem.substring(tem.lastIndexOf(".") + 1).toLowerCase();
|
|
String suff = tem.substring(tem.lastIndexOf(".") + 1).toLowerCase();
|
|
ret.setImage(ByteArray.fromUrl(url).value());
|
|
ret.setImage(ByteArray.fromUrl(url).value());
|
|
|
|
+// saveSheetImage(score,pageIndex, ret.getImage());
|
|
ret.setPageIndex(pageIndex);
|
|
ret.setPageIndex(pageIndex);
|
|
ret.setSuff(suff);
|
|
ret.setSuff(suff);
|
|
answerImages.put(pageIndex, ret);
|
|
answerImages.put(pageIndex, ret);
|
|
@@ -404,6 +406,54 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// private void saveSheetImage(StudentScoreEntity s,Integer page,byte[] bs) {
|
|
|
|
+// File dir=new File(sysProperty.getDataDir()+"/"+"sheet");
|
|
|
|
+// if(!dir.exists()) {
|
|
|
|
+// dir.mkdir();
|
|
|
|
+// }
|
|
|
|
+// File image=new File(dir.getAbsolutePath()+"/"+s.getStudentCode()+"-"+page+".jpg");
|
|
|
|
+// if(image.exists()) {
|
|
|
|
+// image.delete();
|
|
|
|
+// }
|
|
|
|
+// FileOutputStream out=null;
|
|
|
|
+// try {
|
|
|
|
+// out = new FileOutputStream(image);
|
|
|
|
+// out.write(bs, 0, bs.length);
|
|
|
|
+// out.flush();
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
+// }finally {
|
|
|
|
+// if(out!=null) {
|
|
|
|
+// try {
|
|
|
|
+// out.close();
|
|
|
|
+// } catch (IOException e) {
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// private void saveSliceImage(StudentScoreEntity s,byte[] bs) {
|
|
|
|
+// File dir=new File(sysProperty.getDataDir()+"/"+"slice");
|
|
|
|
+// if(!dir.exists()) {
|
|
|
|
+// dir.mkdir();
|
|
|
|
+// }
|
|
|
|
+// File image=new File(dir.getAbsolutePath()+"/"+s.getStudentCode()+"-"+s.getMainNumber()+"-"+s.getSubNumber()+".jpg");
|
|
|
|
+// if(image.exists()) {
|
|
|
|
+// image.delete();
|
|
|
|
+// }
|
|
|
|
+// FileOutputStream out=null;
|
|
|
|
+// try {
|
|
|
|
+// out = new FileOutputStream(image);
|
|
|
|
+// out.write(bs, 0, bs.length);
|
|
|
|
+// out.flush();
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
+// }finally {
|
|
|
|
+// if(out!=null) {
|
|
|
|
+// try {
|
|
|
|
+// out.close();
|
|
|
|
+// } catch (IOException e) {
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
private String getImageUrl(StudentScoreEntity score, QuestionEntity q, Integer pageIndex) {
|
|
private String getImageUrl(StudentScoreEntity score, QuestionEntity q, Integer pageIndex) {
|
|
if (DataType.MARKING_CLOUD.equals(sysProperty.getDataType())) {
|
|
if (DataType.MARKING_CLOUD.equals(sysProperty.getDataType())) {
|