Browse Source

Merge remote-tracking branch 'origin/wn' into ywx

ywx
雍文秀 1 month ago
parent
commit
df16347bb9

+ 9
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java View File

@@ -134,7 +134,13 @@ public class MsPaperQtypeService {
134 134
     //设置试卷基本信息
135 135
     private void setPaperBaseDetail(MsPaper paper,List<MsPaperQtype> qtypelist){
136 136
         if(paper.getPtype() == 2 && paper.getPfiles()!=null && !paper.getPfiles().isEmpty()){
137
-            paper.setHasfile(1);
137
+            //获取附件为1题干的数量
138
+            List<MsPaperFile> pfiles = paper.getPfiles().stream().filter(p -> p.getFiletype() == 1).collect(Collectors.toList());
139
+            if(N_Utils.isListNotEmpty(pfiles)){
140
+                paper.setHasfile(1);
141
+            }else{
142
+                paper.setHasfile(0);
143
+            }
138 144
         }else {
139 145
             paper.setHasfile(0);
140 146
         }
@@ -1033,6 +1039,8 @@ public class MsPaperQtypeService {
1033 1039
             pf.setFiletype(1);
1034 1040
             pf.setFileorder(i++);
1035 1041
         }
1042
+        paper.setHasfile(1);
1043
+        msPaperMapper.updateByPrimaryKeySelective(paper);
1036 1044
         msPaperFileMapper.insertList(pfiles);
1037 1045
     }
1038 1046
 

+ 1
- 1
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

@@ -13,7 +13,7 @@
13 13
     <select id="examOverview" resultType="java.util.Map">
14 14
         select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,s.ptstate,
15 15
         s.pbstate,s.checkset,s.checkstate,s.invigilatestate,p.answered,s.teacherid,
16
-        u.username as teachername,p.mpid,e.exammode,s.leaderid,u2.username as leadername
16
+        u.username as teachername,p.mpid,p.hasfile,e.exammode,s.leaderid,u2.username as leadername
17 17
         ,if(ps.batchid is not null,ps.mpsid,null) scannum,count(ps.mpsid) stunum
18 18
         from ms_subject s left join t_user u on s.teacherid=u.userid
19 19
         left join t_user u2 on s.leaderid=u2.userid

Loading…
Cancel
Save