Browse Source

登录返回性别,校园样式

tags/正式版本
王宁 2 years ago
parent
commit
f487cbf1a6

+ 19
- 1
sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolStypeService.java View File

13
 import javax.annotation.Resource;
13
 import javax.annotation.Resource;
14
 import java.util.ArrayList;
14
 import java.util.ArrayList;
15
 import java.util.List;
15
 import java.util.List;
16
+import java.util.Map;
16
 import java.util.stream.Collectors;
17
 import java.util.stream.Collectors;
17
 
18
 
18
 /**
19
 /**
110
 
111
 
111
     //根据学校id获取列表
112
     //根据学校id获取列表
112
     public List <TSchoolStype> listAll2(TSchoolStype stype) {
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 View File

73
         return new ResultVo(0, "成功获取学生试卷", list);
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
     @PostMapping("/scq")
77
     @PostMapping("/scq")
86
     public ResultVo saveCommitQuestion(@RequestBody EPaperStudentQuestion sq) {
78
     public ResultVo saveCommitQuestion(@RequestBody EPaperStudentQuestion sq) {
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
     @PostMapping("/scpw")
110
     @PostMapping("/scpw")
111
     public ResultVo saveCommitPaperWeb(@RequestBody PaperStudentWebVo ps) {
111
     public ResultVo saveCommitPaperWeb(@RequestBody PaperStudentWebVo ps) {
112
         try {
112
         try {

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java View File

434
                 q.setAnswertype(1);
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
                 setCommitQuestion(q,anvo);
439
                 setCommitQuestion(q,anvo);
440
                 if(q.getChecked() == 2){
440
                 if(q.getChecked() == 2){

+ 6
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paperstudent/EPaperStudentVo.java View File

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

+ 3
- 3
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml View File

51
     <!--考试试卷基本信息-->
51
     <!--考试试卷基本信息-->
52
     <select id="getExamSubjectByEpsid" resultType="com.xhkjedu.sexam.vo.paperstudent.EPaperStudentVo">
52
     <select id="getExamSubjectByEpsid" resultType="com.xhkjedu.sexam.vo.paperstudent.EPaperStudentVo">
53
         select ps.epsid,ps.examid,ps.esid,ps.classid,ps.studentid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,
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
         from e_paper_student ps left join e_subject es on ps.esid=es.esid
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
         where ps.epsid=#{epsid}
58
         where ps.epsid=#{epsid}
59
     </select>
59
     </select>
60
     <!--学生试卷题库(android)-->
60
     <!--学生试卷题库(android)-->

+ 2
- 2
suser/src/main/resources/mapper/system/UserMapper.xml View File

4
 
4
 
5
     <!-- 登录 -->
5
     <!-- 登录 -->
6
     <select id="getUserByLoginname" resultType="com.xhkjedu.suser.vo.system.UserVo">
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
         u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime,u.userlock
8
         u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime,u.userlock
9
         ,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.bindmac sbindmac,s.errorrate,s.schooldomain
9
         ,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.bindmac sbindmac,s.errorrate,s.schooldomain
10
         ,c.cloudcode,c.stuweb
10
         ,c.cloudcode,c.stuweb
13
     </select>
13
     </select>
14
     <!-- 手机号登录 -->
14
     <!-- 手机号登录 -->
15
     <select id="getUserByPhone" resultType="com.xhkjedu.suser.vo.system.UserVo">
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
             u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime,u.userlock
17
             u.userstate,u.opepassword,u.createid,u.createtime,u.deleteid,u.deletetime,u.schoolid,u.bindmac,u.mac,u.usertime,u.userlock
18
              ,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.bindmac sbindmac,s.errorrate,s.schooldomain
18
              ,s.year,s.schoolname,s.schoollevel,s.schoolstate,s.bindmac sbindmac,s.errorrate,s.schooldomain
19
              ,c.cloudcode,c.stuweb
19
              ,c.cloudcode,c.stuweb

Loading…
Cancel
Save