瀏覽代碼

登录返回性别,校园样式

tags/正式版本
王宁 2 年之前
父節點
當前提交
f487cbf1a6

+ 19
- 1
sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolStypeService.java 查看文件

@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
13 13
 import javax.annotation.Resource;
14 14
 import java.util.ArrayList;
15 15
 import java.util.List;
16
+import java.util.Map;
16 17
 import java.util.stream.Collectors;
17 18
 
18 19
 /**
@@ -110,6 +111,23 @@ public class SchoolStypeService {
110 111
 
111 112
     //根据学校id获取列表
112 113
     public List <TSchoolStype> listAll2(TSchoolStype stype) {
113
-        return schoolStypeMapper.findAll2(stype);
114
+        List<TSchoolStype> lst = schoolStypeMapper.findAll2(stype);
115
+        List<TSchoolStype> rtnlst = new ArrayList<>();
116
+        //获取学校样式,如果学校未设置使用default设置的内容
117
+        Map<String,List<TSchoolStype>> map = lst.stream().collect(Collectors.groupingBy(TSchoolStype :: getSchooltype,Collectors.toList()));
118
+        for(Map.Entry<String, List<TSchoolStype>> entry : map.entrySet()){
119
+            List<TSchoolStype> maplist = entry.getValue();
120
+            if(maplist.size() == 1){
121
+                rtnlst.add(maplist.get(0));
122
+            }else if(maplist.size()>1){
123
+                for(TSchoolStype s : maplist){
124
+                    if(!s.getSchooldomain().equals("default")){
125
+                        rtnlst.add(s);
126
+                        break;
127
+                    }
128
+                }
129
+            }
130
+        }
131
+        return rtnlst;
114 132
     }
115 133
 }

+ 9
- 9
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPaperStudentController.java 查看文件

@@ -73,14 +73,6 @@ public class EPaperStudentController {
73 73
         return new ResultVo(0, "成功获取学生试卷", list);
74 74
     }
75 75
 
76
-    //学生开始考试(web)
77
-    @PostMapping("/spw")
78
-    public ResultVo startPaperForWeb(@RequestBody EPaperStudent eps) {
79
-        N_Utils.validation(new Object[]{eps.getEpsid(), "学生试卷id", 1});
80
-        EPaperStudentVo psvo = ePaperStudentService.startPaperForWeb(eps);
81
-        return new ResultVo(0, "成功获取学生试卷", psvo);
82
-    }
83
-
84 76
     //提交单题
85 77
     @PostMapping("/scq")
86 78
     public ResultVo saveCommitQuestion(@RequestBody EPaperStudentQuestion sq) {
@@ -106,7 +98,15 @@ public class EPaperStudentController {
106 98
         }
107 99
     }
108 100
 
109
-    //提交试卷--网页端
101
+    //学生开始考试(web)
102
+    @PostMapping("/spw")
103
+    public ResultVo startPaperForWeb(@RequestBody EPaperStudent eps) {
104
+        N_Utils.validation(new Object[]{eps.getEpsid(), "学生试卷id", 1});
105
+        EPaperStudentVo psvo = ePaperStudentService.startPaperForWeb(eps);
106
+        return new ResultVo(0, "成功获取学生试卷", psvo);
107
+    }
108
+
109
+    //提交试卷(web)
110 110
     @PostMapping("/scpw")
111 111
     public ResultVo saveCommitPaperWeb(@RequestBody PaperStudentWebVo ps) {
112 112
         try {

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java 查看文件

@@ -434,7 +434,7 @@ public class EPaperStudentService {
434 434
                 q.setAnswertype(1);
435 435
 
436 436
                 //获取该试题正确答案(根据题号区分)
437
-                PsqAnswerVo anvo = anvolist.stream().filter(a -> a.getQn().equals(q.getQn())).findFirst().orElse(null);
437
+                PsqAnswerVo anvo = anvolist.stream().filter(a -> a.getEptqid().equals(q.getEptqid())).findFirst().orElse(null);
438 438
 
439 439
                 setCommitQuestion(q,anvo);
440 440
                 if(q.getChecked() == 2){

+ 6
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paperstudent/EPaperStudentVo.java 查看文件

@@ -21,8 +21,12 @@ public class EPaperStudentVo {
21 21
 
22 22
     private Integer esid;//考试科目id
23 23
 
24
+    private Integer gradeid;//年级
25
+
24 26
     private Integer classid;//班级id
25 27
 
28
+    private String classname;//班级名称
29
+
26 30
     private Integer studentid;//学生id
27 31
 
28 32
     private String subjectid;//科目id
@@ -43,6 +47,8 @@ public class EPaperStudentVo {
43 47
 
44 48
     private Double pscore;//试卷总分
45 49
 
50
+    private String hearfile;//听力文件
51
+
46 52
     //试题集合
47 53
     private List<EPaperQtype> qtypelist;
48 54
 }

+ 3
- 3
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml 查看文件

@@ -51,10 +51,10 @@
51 51
     <!--考试试卷基本信息-->
52 52
     <select id="getExamSubjectByEpsid" resultType="com.xhkjedu.sexam.vo.paperstudent.EPaperStudentVo">
53 53
         select ps.epsid,ps.examid,ps.esid,ps.classid,ps.studentid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,
54
-               e.examname,ps.epid,p.ptype,p.pnum,p.pscore
54
+               e.examname,e.gradeid,ps.epid,p.ptype,p.pnum,p.pscore,p.hearfile,s.classname
55 55
         from e_paper_student ps left join e_subject es on ps.esid=es.esid
56
-        left join e_base e on ps.examid=e.examid
57
-        left join e_paper p on ps.epid=p.epid
56
+        left join e_base e on ps.examid=e.examid left join e_paper p on ps.epid=p.epid
57
+        left join t_class s on ps.classid=s.classid
58 58
         where ps.epsid=#{epsid}
59 59
     </select>
60 60
     <!--学生试卷题库(android)-->

+ 2
- 2
suser/src/main/resources/mapper/system/UserMapper.xml 查看文件

@@ -4,7 +4,7 @@
4 4
 
5 5
     <!-- 登录 -->
6 6
     <select id="getUserByLoginname" resultType="com.xhkjedu.suser.vo.system.UserVo">
7
-        select u.userid,u.username,u.loginname,u.loginpwd,u.userphone,u.userbirthday,u.cardid,u.headpic,u.usertype,
7
+        select u.userid,u.username,u.loginname,u.loginpwd,u.userphone,u.userbirthday,u.cardid,u.headpic,u.usertype,u.usersex,
8 8
         u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime,u.userlock
9 9
         ,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.bindmac sbindmac,s.errorrate,s.schooldomain
10 10
         ,c.cloudcode,c.stuweb
@@ -13,7 +13,7 @@
13 13
     </select>
14 14
     <!-- 手机号登录 -->
15 15
     <select id="getUserByPhone" resultType="com.xhkjedu.suser.vo.system.UserVo">
16
-        select u.userid,u.username,u.loginname,u.loginpwd,u.userphone,u.userbirthday,u.cardid,u.headpic,u.usertype,
16
+        select u.userid,u.username,u.loginname,u.loginpwd,u.userphone,u.userbirthday,u.cardid,u.headpic,u.usertype,u.usersex,
17 17
             u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime,u.userlock
18 18
              ,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.bindmac sbindmac,s.errorrate,s.schooldomain
19 19
              ,c.cloudcode,c.stuweb

Loading…
取消
儲存