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
     //设置试卷基本信息
134
     //设置试卷基本信息
135
     private void setPaperBaseDetail(MsPaper paper,List<MsPaperQtype> qtypelist){
135
     private void setPaperBaseDetail(MsPaper paper,List<MsPaperQtype> qtypelist){
136
         if(paper.getPtype() == 2 && paper.getPfiles()!=null && !paper.getPfiles().isEmpty()){
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
         }else {
144
         }else {
139
             paper.setHasfile(0);
145
             paper.setHasfile(0);
140
         }
146
         }
1033
             pf.setFiletype(1);
1039
             pf.setFiletype(1);
1034
             pf.setFileorder(i++);
1040
             pf.setFileorder(i++);
1035
         }
1041
         }
1042
+        paper.setHasfile(1);
1043
+        msPaperMapper.updateByPrimaryKeySelective(paper);
1036
         msPaperFileMapper.insertList(pfiles);
1044
         msPaperFileMapper.insertList(pfiles);
1037
     }
1045
     }
1038
 
1046
 

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

13
     <select id="examOverview" resultType="java.util.Map">
13
     <select id="examOverview" resultType="java.util.Map">
14
         select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,s.ptstate,
14
         select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,s.ptstate,
15
         s.pbstate,s.checkset,s.checkstate,s.invigilatestate,p.answered,s.teacherid,
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
         ,if(ps.batchid is not null,ps.mpsid,null) scannum,count(ps.mpsid) stunum
17
         ,if(ps.batchid is not null,ps.mpsid,null) scannum,count(ps.mpsid) stunum
18
         from ms_subject s left join t_user u on s.teacherid=u.userid
18
         from ms_subject s left join t_user u on s.teacherid=u.userid
19
         left join t_user u2 on s.leaderid=u2.userid
19
         left join t_user u2 on s.leaderid=u2.userid

Loading…
Cancel
Save