|
@@ -8,16 +8,19 @@ import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
|
8
|
8
|
import com.xhkjedu.sexam.mapper.system.UserBasketMapper;
|
9
|
9
|
import com.xhkjedu.sexam.model.paper.*;
|
10
|
10
|
import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
|
|
11
|
+import com.xhkjedu.sexam.utils.ConvertUtil;
|
11
|
12
|
import com.xhkjedu.sexam.utils.ExamUtil;
|
12
|
13
|
import com.xhkjedu.sexam.vo.paper.*;
|
13
|
14
|
import com.xhkjedu.utils.N_Utils;
|
14
|
15
|
import com.xhkjedu.vo.ResultVo;
|
15
|
16
|
import lombok.extern.slf4j.Slf4j;
|
16
|
17
|
import org.springframework.beans.BeanUtils;
|
|
18
|
+import org.springframework.beans.factory.annotation.Autowired;
|
17
|
19
|
import org.springframework.stereotype.Service;
|
18
|
20
|
import org.springframework.transaction.annotation.Transactional;
|
19
|
21
|
|
20
|
22
|
import javax.annotation.Resource;
|
|
23
|
+import java.io.File;
|
21
|
24
|
import java.util.*;
|
22
|
25
|
import java.util.List;
|
23
|
26
|
import java.util.stream.Collectors;
|
|
@@ -48,6 +51,8 @@ public class EPaperQtypeService {
|
48
|
51
|
private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
|
49
|
52
|
@Resource
|
50
|
53
|
private EPaperStudentMapper ePaperStudentMapper;
|
|
54
|
+ @Autowired
|
|
55
|
+ private ConvertUtil convertUtil;
|
51
|
56
|
|
52
|
57
|
|
53
|
58
|
/**
|
|
@@ -621,8 +626,25 @@ public class EPaperQtypeService {
|
621
|
626
|
ePaperQtypeMapper.updateBatchQuestionForScan(questions);
|
622
|
627
|
if(paper.getPstate() == 1){
|
623
|
628
|
eSubjectMapper.updateEsubjectStateByEpid(1,paper.getEpid());
|
|
629
|
+ //提交之后把答题卡base图片转成pdf
|
|
630
|
+// chandleScantronFile(paper.getEpid());
|
|
631
|
+ }
|
|
632
|
+ }
|
624
|
633
|
|
625
|
|
-
|
|
634
|
+ //答题卡种图片处理
|
|
635
|
+ private void chandleScantronFile(Integer epid){
|
|
636
|
+ //获取试卷中答题卡文件,
|
|
637
|
+ Map map = ePaperMapper.getPaperScantronfile(epid);
|
|
638
|
+ if(map.get("scantronfile")!=null){
|
|
639
|
+ List<String> scantronfiles = JSON.parseArray(map.get("scantronfile").toString(),String.class);
|
|
640
|
+ if(N_Utils.isNotEmpty(scantronfiles)){
|
|
641
|
+ Integer examid = Integer.parseInt(map.get("examid").toString());
|
|
642
|
+ Integer schoolid = Integer.parseInt(map.get("schoolid").toString());
|
|
643
|
+ String cloudcode = map.get("cloudcode").toString();
|
|
644
|
+ String path = cloudcode + File.separator + schoolid + File.separator + "exam" +
|
|
645
|
+ File.separator;
|
|
646
|
+ convertUtil.baseToPdf(epid,examid,scantronfiles,path);
|
|
647
|
+ }
|
626
|
648
|
}
|
627
|
649
|
}
|
628
|
650
|
}
|