Browse Source

考试报告

tags/正式版本
雍文秀 2 years ago
parent
commit
6b497700ad

+ 60
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportSchoolController.java View File

@@ -1,6 +1,22 @@
1 1
 package com.xhkjedu.sexam.controller.report;
2 2
 
3
+import com.github.pagehelper.PageHelper;
4
+import com.github.pagehelper.PageInfo;
5
+import com.xhkjedu.sexam.model.report.ERbase;
6
+import com.xhkjedu.sexam.model.reportstu.ERstudent;
7
+import com.xhkjedu.sexam.service.report.EReportSchoolService;
8
+import com.xhkjedu.utils.N_Utils;
9
+import com.xhkjedu.utils.PageUtil;
10
+import com.xhkjedu.vo.PageResult;
11
+import com.xhkjedu.vo.ResultVo;
12
+import org.springframework.web.bind.annotation.PostMapping;
13
+import org.springframework.web.bind.annotation.RequestBody;
3 14
 import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RestController;
16
+
17
+import javax.annotation.Resource;
18
+import java.util.List;
19
+import java.util.Map;
4 20
 
5 21
 /**
6 22
  * @author ywx
@@ -8,6 +24,50 @@ import org.springframework.web.bind.annotation.RequestMapping;
8 24
  * @description 校级报告
9 25
  * @date 2022/8/8 9:37
10 26
  **/
27
+@RestController
11 28
 @RequestMapping("ers")
12 29
 public class EReportSchoolController {
30
+    @Resource
31
+    private EReportSchoolService eReportSchoolService;
32
+
33
+    /**
34
+     * 考试概况
35
+     *
36
+     * @return com.xhkjedu.vo.ResultVo
37
+     * @Param [rbase]
38
+     * @Author ywx
39
+     * @Date 2022/8/25 9:20
40
+     **/
41
+    @PostMapping("/get_ksgk")
42
+    public ResultVo getKsGk(@RequestBody ERbase rbase) {
43
+        Integer examid = rbase.getExamid();
44
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
45
+        Map map = eReportSchoolService.getKsGk(examid);
46
+        return new ResultVo(0, "获取成功", map);
47
+    }
48
+
49
+    /**
50
+     * 成绩单
51
+     *
52
+     * @return com.xhkjedu.vo.ResultVo
53
+     * @Param [stu]
54
+     * @Author ywx
55
+     * @Date 2022/8/25 9:36
56
+     **/
57
+    @PostMapping("/list_cjd")
58
+    public ResultVo listCjd(@RequestBody ERstudent stu) {
59
+        Integer examid = stu.getExamid();
60
+        Integer page = stu.getPage();
61
+        Integer pageSize = stu.getPageSize();
62
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
63
+        if (N_Utils.isEmptyInteger(page)) {
64
+            List<Map> list = eReportSchoolService.listCjd(stu);
65
+            return new ResultVo(0, "获取成功", list);
66
+        } else {
67
+            PageHelper.startPage(page, pageSize);
68
+            List<Map> list = eReportSchoolService.listCjd(stu);
69
+            PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
70
+            return new ResultVo(0, "获取成功", pageResult);
71
+        }
72
+    }
13 73
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/ESubjectBadstudentMapper.java View File

@@ -20,4 +20,7 @@ public interface ESubjectBadstudentMapper extends TkMapper<ESubjectBadstudent> {
20 20
 
21 21
     //试卷学生异常记录
22 22
     List<Map> listBadStu(@Param("ei") ESubjectInvigilate ei);
23
+
24
+    //学生违纪行为分析详情
25
+    List<Map> listBad(@Param("studentid") Integer studentid, @Param("examid") Integer examid);
23 26
 }

+ 5
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/report/ERbaseMapper.java View File

@@ -2,6 +2,11 @@ package com.xhkjedu.sexam.mapper.report;
2 2
 
3 3
 import com.xhkjedu.sexam.base.TkMapper;
4 4
 import com.xhkjedu.sexam.model.report.ERbase;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.Map;
5 8
 
6 9
 public interface ERbaseMapper extends TkMapper<ERbase> {
10
+    //考试概况
11
+    Map findByExamId(@Param("examid") Integer examid);
7 12
 }

+ 6
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/report/ERsubjectMapper.java View File

@@ -2,6 +2,12 @@ package com.xhkjedu.sexam.mapper.report;
2 2
 
3 3
 import com.xhkjedu.sexam.base.TkMapper;
4 4
 import com.xhkjedu.sexam.model.report.ERsubject;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+import java.util.Map;
5 9
 
6 10
 public interface ERsubjectMapper extends TkMapper<ERsubject> {
11
+    //校级报告-成绩概况
12
+    List<Map> listByExamId(@Param("examid") Integer examid);
7 13
 }

+ 6
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/reportstu/ERstudentMapper.java View File

@@ -2,6 +2,12 @@ package com.xhkjedu.sexam.mapper.reportstu;
2 2
 
3 3
 import com.xhkjedu.sexam.base.TkMapper;
4 4
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+import java.util.Map;
5 9
 
6 10
 public interface ERstudentMapper extends TkMapper<ERstudent> {
11
+    //校级报告-成绩单
12
+    List<Map> listByExamId(@Param("stu") ERstudent stu);
7 13
 }

+ 49
- 39
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

@@ -1,7 +1,6 @@
1 1
 package com.xhkjedu.sexam.service.report;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4
-import com.mysql.cj.x.protobuf.MysqlxDatatypes;
5 4
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
6 5
 import com.xhkjedu.sexam.mapper.paper.EPaperAnalyzeMapper;
7 6
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
@@ -45,6 +44,7 @@ import com.xhkjedu.sexam.vo.report.ERPointStuScoreVo;
45 44
 import com.xhkjedu.sexam.vo.report.ExamPaperClassVo;
46 45
 import com.xhkjedu.sexam.vo.system.UserVo;
47 46
 import com.xhkjedu.utils.N_Utils;
47
+import org.springframework.beans.BeanUtils;
48 48
 import org.springframework.stereotype.Service;
49 49
 import org.springframework.transaction.annotation.Transactional;
50 50
 
@@ -178,7 +178,7 @@ public class EReportGenerateService {
178 178
         DoubleSummaryStatistics classStatistics = classStudents.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
179 179
         DoubleSummaryStatistics cSStatistics = classSubjectStudents.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
180 180
         double schoolStatisticsMax = schoolStatistics.getMax();
181
-        double schoolStatisticsAverage = schoolStatistics.getAverage();
181
+        double schoolStatisticsAverage = N_Utils.formatDouble(schoolStatistics.getAverage(), 2);
182 182
         double schoolStatisticsMin = schoolStatistics.getMin();
183 183
 
184 184
         ERbase rbase = new ERbase();
@@ -212,10 +212,10 @@ public class EReportGenerateService {
212 212
             }
213 213
             ERPaperVo rp = paperMap.get(subjectid);
214 214
             Double allscore = rp.getPscore();//满分
215
-            double yxscore = allscore * 0.85;//优秀分
216
-            double lhscore = allscore * 0.7;//良好分
217
-            double jgscore = allscore * 0.6;//及格分
218
-            double dfscore = allscore * 0.4;//低分
215
+            double yxscore = ExamUtil.mul(allscore, 0.85);//优秀分
216
+            double lhscore = ExamUtil.mul(allscore, 0.7);//良好分
217
+            double jgscore = ExamUtil.mul(allscore, 0.6);//及格分
218
+            double dfscore = ExamUtil.mul(allscore, 0.4);//低分
219 219
 
220 220
             DoubleSummaryStatistics statistics = list.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
221 221
             ERsubject rs = new ERsubject();
@@ -225,7 +225,7 @@ public class EReportGenerateService {
225 225
             rs.setScore(allscore);
226 226
             rs.setMaxscore(statistics.getMax());
227 227
             rs.setMinscore(statistics.getMin());
228
-            rs.setAvgscore(statistics.getAverage());
228
+            rs.setAvgscore(N_Utils.formatDouble(statistics.getAverage(), 2));
229 229
             int yxnum = list.stream().filter(l -> l.getScore().compareTo(yxscore) != -1)
230 230
                             .collect(Collectors.toList()).size();
231 231
             int lhnum = list.stream().filter(l -> l.getScore().compareTo(lhscore) != -1)
@@ -258,9 +258,9 @@ public class EReportGenerateService {
258 258
                 rc.setAllscore(allscore);
259 259
                 rc.setClassmaxscore(claStatistics.getMax());
260 260
                 rc.setClassminscore(claStatistics.getMin());
261
-                rc.setClassavgscore(claStatistics.getAverage());
261
+                rc.setClassavgscore(N_Utils.formatDouble(claStatistics.getAverage(), 2));
262 262
                 rc.setSchoolmaxscore(statistics.getMax());
263
-                rc.setSchoolavgscore(statistics.getAverage());
263
+                rc.setSchoolavgscore(N_Utils.formatDouble(statistics.getAverage(), 2));
264 264
                 sknum = rstudentList.size();
265 265
                 rc.setStunum(sknum);//实考人数
266 266
                 rc.setMissnum(stunum - sknum);//缺考人数=计划人数-实考人数
@@ -294,8 +294,8 @@ public class EReportGenerateService {
294 294
             Integer studentid = cs.getStudentid();
295 295
             cs.setClassrank(classStuRank.get(cs.getClassid() + "_" + studentid));
296 296
             cs.setClassmaxscore(classStatistics.getMax());
297
-            cs.setClassavgscore(classStatistics.getAverage());
298
-            Integer schoolrank = schoolStuRank.get(studentid);
297
+            cs.setClassavgscore(N_Utils.formatDouble(classStatistics.getAverage(), 2));
298
+            Integer schoolrank = schoolStuRank.get(studentid.toString());
299 299
             cs.setSchoolrank(schoolrank);
300 300
             cs.setSchoolmaxscore(schoolStatisticsMax);
301 301
             cs.setSchoolavgscore(schoolStatisticsAverage);
@@ -310,12 +310,12 @@ public class EReportGenerateService {
310 310
             subjectid = cs.getSubjectid();
311 311
             cs.setClassrank(classSubStuRank.get(classid + "_" + subjectid + "_" + studentid));
312 312
             cs.setClassmaxscore(cSStatistics.getMax());
313
-            cs.setClassavgscore(cSStatistics.getAverage());
313
+            cs.setClassavgscore(N_Utils.formatDouble(cSStatistics.getAverage(), 2));
314 314
             Integer schoolrank = schoolSubStuRank.get(subjectid + "_" + studentid);
315 315
             cs.setSchoolrank(schoolrank);
316
-            cs.setZfSchoolRank(schoolStuRank.get(studentid));
316
+            cs.setZfSchoolRank(schoolStuRank.get(studentid.toString()));
317 317
             cs.setSchoolmaxscore(sSStatistics.getMax());
318
-            cs.setSchoolavgscore(sSStatistics.getAverage());
318
+            cs.setSchoolavgscore(N_Utils.formatDouble(sSStatistics.getAverage(), 2));
319 319
             setStuGoal(stuRankGoals, cs, schoolrank);//设置学生目标
320 320
         }
321 321
         eRstudentMapper.insertList(classSubjectStudents);
@@ -434,9 +434,11 @@ public class EReportGenerateService {
434 434
         Integer ranktype = eRrank.getRanktype();
435 435
         if (ranktype == 1) {//等级(A[85%~100%],B[70%~85%),C[60%~70%),D[40%~60%),E[0%~40%))
436 436
             for (ERrank rrank : rranks) {
437
+                Double maxrate = rrank.getMaxscore();
438
+                Double minrate = rrank.getMinscore();
437 439
                 //总分统计
438
-                double maxscore = rrank.getMaxscore() * zfscore;
439
-                double minscore = rrank.getMinscore() * zfscore;
440
+                double maxscore = ExamUtil.mul(maxrate, zfscore);
441
+                double minscore = ExamUtil.mul(minrate, zfscore);
440 442
                 rrank.setMaxscore(maxscore);
441 443
                 rrank.setMinscore(minscore);
442 444
                 rrankList.add(rrank);
@@ -458,11 +460,13 @@ public class EReportGenerateService {
458 460
                 for (ERPaperVo paper : papers) {
459 461
                     String subjectid = paper.getSubjectid();
460 462
                     pscore = scoreMap.get(subjectid);
461
-                    maxscore = rrank.getMaxscore() * pscore;
462
-                    minscore = rrank.getMinscore() * pscore;
463
+                    maxscore = ExamUtil.mul(maxrate, pscore);
464
+                    minscore = ExamUtil.mul(minrate, pscore);
463 465
                     rrank.setMaxscore(maxscore);
464 466
                     rrank.setMinscore(minscore);
465
-                    rrankList.add(rrank);
467
+                    ERrank rrank1 = new ERrank();
468
+                    BeanUtils.copyProperties(rrank, rrank1);
469
+                    rrankList.add(rrank1);
466 470
                     rankrange = "[" + minscore + "," + maxscore;
467 471
                     if (rankname.equals("A")) {
468 472
                         rankrange = rankrange + "]";
@@ -494,8 +498,8 @@ public class EReportGenerateService {
494 498
             for (Integer i = 1; i <= gnum; i++) {
495 499
                 ERrank rrank = new ERrank();
496 500
                 rrank.setRanktype(ranktype);
497
-                double maxscore = i * linescore;
498
-                double minscore = (i - 1) * linescore;
501
+                double maxscore = ExamUtil.mul(i, linescore);
502
+                double minscore = ExamUtil.mul(i - 1, linescore);
499 503
                 if (maxscore > zfscore) {
500 504
                     maxscore = zfscore;
501 505
                 }
@@ -526,13 +530,11 @@ public class EReportGenerateService {
526 530
                 for (Integer i = 1; i <= cnum; i++) {
527 531
                     ERrank rrank = new ERrank();
528 532
                     rrank.setRanktype(ranktype);
529
-                    double maxscore = i * linescore;
530
-                    double minscore = (i - 1) * linescore;
533
+                    double maxscore = ExamUtil.mul(i, linescore);
534
+                    double minscore = ExamUtil.mul(i - 1, linescore);
531 535
                     if (maxscore > zfscore) {
532 536
                         maxscore = zfscore;
533 537
                     }
534
-                    maxscore = rrank.getMaxscore() * pscore;
535
-                    minscore = rrank.getMinscore() * pscore;
536 538
                     rrank.setMaxscore(maxscore);
537 539
                     rrank.setMinscore(minscore);
538 540
                     String rankrange = "[" + minscore + "," + maxscore;
@@ -542,7 +544,9 @@ public class EReportGenerateService {
542 544
                         rankrange = rankrange + ")";
543 545
                     }
544 546
                     rrank.setRankname(rankrange);
545
-                    rrankList.add(rrank);
547
+                    ERrank rrank1 = new ERrank();
548
+                    BeanUtils.copyProperties(rrank, rrank1);
549
+                    rrankList.add(rrank1);
546 550
 
547 551
                     //全部班级统计
548 552
                     for (Map.Entry<String, List<ERstudent>> entry : qbbjcollect.entrySet()) {
@@ -562,14 +566,15 @@ public class EReportGenerateService {
562 566
                 }
563 567
             }
564 568
         } else if (ranktype == 3) {//临界分(临界分:总分*80%,浮动分:5分)
565
-            Integer linescore = eRrank.getLinescore();
569
+            Integer linescore1 = eRrank.getLinescore();
570
+            Integer linescore = linescore1;
566 571
             Integer floatscore = eRrank.getFloatscore();
567
-            if (N_Utils.isEmptyInteger(linescore)) linescore = (int) (zfscore * 0.8);
572
+            if (N_Utils.isEmptyInteger(linescore)) linescore = (int) (ExamUtil.mul(zfscore, 0.8));
568 573
             //总分统计
569 574
             ERrank rrank = new ERrank();
570 575
             rrank.setRanktype(ranktype);
571
-            double maxscore = linescore + floatscore;
572
-            double minscore = linescore - floatscore;
576
+            double maxscore = ExamUtil.add(linescore, floatscore);
577
+            double minscore = ExamUtil.sub(linescore, floatscore);
573 578
             if (maxscore > zfscore) maxscore = zfscore;
574 579
             if (minscore < 0) minscore = 0;
575 580
             rrank.setMaxscore(maxscore);
@@ -591,9 +596,10 @@ public class EReportGenerateService {
591 596
             for (ERPaperVo paper : papers) {
592 597
                 String subjectid = paper.getSubjectid();
593 598
                 pscore = scoreMap.get(subjectid);
594
-                if (N_Utils.isEmptyInteger(linescore)) linescore = (int) (pscore * 0.8);
595
-                maxscore = linescore + floatscore;
596
-                minscore = linescore - floatscore;
599
+                linescore = linescore1;
600
+                if (N_Utils.isEmptyInteger(linescore)) linescore = (int) (ExamUtil.mul(pscore, 0.8));
601
+                maxscore = ExamUtil.add(linescore, floatscore);
602
+                minscore = ExamUtil.sub(linescore, floatscore);
597 603
                 if (maxscore > pscore) maxscore = pscore;
598 604
                 if (minscore < 0) minscore = 0;
599 605
                 rrank.setMaxscore(maxscore);
@@ -602,7 +608,9 @@ public class EReportGenerateService {
602 608
                 rrank.setFloatscore(floatscore);
603 609
                 rankrange = "[" + minscore + "," + maxscore + "]";
604 610
                 rrank.setRankname(rankrange);
605
-                rrankList.add(rrank);
611
+                ERrank rrank1 = new ERrank();
612
+                BeanUtils.copyProperties(rrank, rrank1);
613
+                rrankList.add(rrank1);
606 614
 
607 615
                 //全部班级统计
608 616
                 for (Map.Entry<String, List<ERstudent>> entry : qbbjcollect.entrySet()) {
@@ -626,8 +634,8 @@ public class EReportGenerateService {
626 634
             //总分统计
627 635
             ERrank rrank = new ERrank();
628 636
             rrank.setRanktype(ranktype);
629
-            double maxscore = linescore - floatscore;//最高名次
630
-            double minscore = linescore + floatscore;//最低名次
637
+            double maxscore = ExamUtil.sub(linescore, floatscore);//最高名次
638
+            double minscore = ExamUtil.add(linescore, floatscore);//最低名次
631 639
             if (maxscore < 1) maxscore = 1;//最高名次为1
632 640
             int stunum = (int) students.stream().map(s -> s.getStudentid()).distinct().count();//学生数量
633 641
             if (minscore > stunum) minscore = stunum;//最低名次=学生数量
@@ -649,8 +657,8 @@ public class EReportGenerateService {
649 657
             //分科统计
650 658
             for (ERPaperVo paper : papers) {
651 659
                 String subjectid = paper.getSubjectid();
652
-                maxscore = linescore - floatscore;//最高名次
653
-                minscore = linescore + floatscore;//最低名次
660
+                maxscore = ExamUtil.sub(linescore, floatscore);//最高名次
661
+                minscore = ExamUtil.add(linescore, floatscore);//最低名次
654 662
                 if (maxscore < 1) maxscore = 1;//最高名次为1
655 663
                 stunum = students.size();//学生数量
656 664
                 if (minscore > stunum) minscore = stunum;//最低名次=学生数量
@@ -660,7 +668,9 @@ public class EReportGenerateService {
660 668
                 rrank.setFloatscore(floatscore);
661 669
                 rankrange = "[" + minscore + "," + maxscore + "]";
662 670
                 rrank.setRankname(rankrange);
663
-                rrankList.add(rrank);
671
+                ERrank rrank1 = new ERrank();
672
+                BeanUtils.copyProperties(rrank, rrank1);
673
+                rrankList.add(rrank1);
664 674
 
665 675
                 //全部班级统计
666 676
                 for (Map.Entry<String, List<ERstudent>> entry : qbbjcollect.entrySet()) {

+ 31
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportSchoolService.java View File

@@ -1,10 +1,41 @@
1 1
 package com.xhkjedu.sexam.service.report;
2 2
 
3
+import com.xhkjedu.sexam.mapper.report.ERbaseMapper;
4
+import com.xhkjedu.sexam.mapper.report.ERsubjectMapper;
5
+import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
6
+import com.xhkjedu.sexam.model.reportstu.ERstudent;
7
+import org.springframework.stereotype.Service;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.List;
11
+import java.util.Map;
12
+
3 13
 /**
4 14
  * @author ywx
5 15
  * @className EReportSchoolService
6 16
  * @description 校级报告
7 17
  * @date 2022/8/8 9:46
8 18
  **/
19
+@Service
9 20
 public class EReportSchoolService {
21
+    @Resource
22
+    private ERbaseMapper eRbaseMapper;
23
+    @Resource
24
+    private ERsubjectMapper eRsubjectMapper;
25
+    @Resource
26
+    private ERstudentMapper eRstudentMapper;
27
+
28
+    //考试概况
29
+    public Map getKsGk(Integer examid) {
30
+        Map map = eRbaseMapper.findByExamId(examid);
31
+        //成绩概况
32
+        List<Map> subjects = eRsubjectMapper.listByExamId(examid);
33
+        map.put("subjects", subjects);
34
+        return map;
35
+    }
36
+
37
+    //成绩单
38
+    public List<Map> listCjd(ERstudent stu) {
39
+        return eRstudentMapper.listByExamId(stu);
40
+    }
10 41
 }

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/utils/ExamUtil.java View File

@@ -175,7 +175,7 @@ public class ExamUtil {
175 175
 
176 176
     //标准差σ=sqrt(s^2)
177 177
     public static double standardDiviation(List<Double> x) {
178
-        return Math.sqrt(variance(x));
178
+        return N_Utils.formatDouble(Math.sqrt(variance(x)), 2);
179 179
     }
180 180
 
181 181
     /**

+ 8
- 0
sexam/src/main/resources/mapper/report/ERbaseMapper.xml View File

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.sexam.mapper.report.ERbaseMapper">
4
+    <!--考试概况-->
5
+    <select id="findByExamId" resultType="java.util.Map">
6
+        select * from e_rbase where examid=#{examid} limit 1
7
+    </select>
8
+</mapper>

+ 6
- 2
sexam/src/main/resources/mapper/report/EReportGenerateMapper.xml View File

@@ -14,19 +14,23 @@
14 14
     <delete id="deleteExamReport">
15 15
         delete from e_rbase where examid=#{examid};
16 16
         delete from e_rclass where examid=#{examid};
17
+        delete from e_rclass_complexity where examid=#{examid};
18
+        delete from e_rclass_point where examid=#{examid};
17 19
         delete from e_rclass_qtype where examid=#{examid};
18 20
         delete from e_rclass_question where examid=#{examid};
19
-        delete from e_rclass_question_point where examid=#{examid};
20 21
         delete from e_rclass_rank where examid=#{examid};
21 22
         delete from e_rrank where examid=#{examid};
22 23
         delete from e_rstudent where examid=#{examid};
24
+        delete from e_rstudent_complexity where examid=#{examid};
23 25
         delete from e_rstudent_point where examid=#{examid};
26
+        delete from e_rstudent_qtype where examid=#{examid};
24 27
         delete from e_rsubject where examid=#{examid};
25 28
     </delete>
26 29
     <!--学生上次考试排名及目标-->
27 30
     <select id="listStuRankAndGoal" resultType="com.xhkjedu.sexam.model.reportstu.ERstudent">
28 31
         select er.studentid,er.subjectid,er.schoolrank,er.nextgoal
29 32
         from(select max(er.rsid)rsid from e_class_student ecs left join e_rstudent er on ecs.studentid = er.studentid
30
-        where ecs.examid=#{examid} group by er.studentid,er.subjectid)a left join e_rstudent er on a.rsid=er.rsid
33
+        where ecs.examid=#{examid} and ecs.examid!=er.examid and er.rsid is not null group by er.studentid,er.subjectid)a
34
+        left join e_rstudent er on a.rsid=er.rsid
31 35
     </select>
32 36
 </mapper>

+ 31
- 0
sexam/src/main/resources/mapper/report/ERstudentMapper.xml View File

@@ -0,0 +1,31 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper">
4
+    <!--校级报告-成绩单-->
5
+    <resultMap id="stuResult" type="java.util.Map">
6
+        <collection property="subjects" ofType="java.util.Map" javaType="java.util.List"
7
+                    select="listSubject" column="{examid=examid,studentid=studentid,subjectid=subjectid}">
8
+        </collection>
9
+    </resultMap>
10
+    <select id="listSubject" resultType="java.util.Map">
11
+        select s.score,s.classrank,s.classrankpre,s.classmaxscore,s.classavgscore
12
+        ,s.schoolrank,s.schoolmaxscore,s.schoolavgscore,s.goal,s.nextgoal,s.subjectname
13
+        from e_rstudent s where s.examid=#{examid} and s.studentid=#{studentid}
14
+        <if test="subjectid!=null and subjectid!=''">
15
+            and s.subjectid=#{subjectid}
16
+        </if>
17
+    </select>
18
+    <select id="listByExamId" resultMap="stuResult">
19
+        select s.examid,s.classid,s.studentid,c.classname,u.username,u.loginname,#{stu.subjectid} subjectid
20
+        from e_class_student s left join t_user u on s.studentid=u.userid
21
+        left join e_class c on s.classid=c.classid
22
+        where s.examid=#{stu.examid}
23
+        <if test="stu.classid!=null and stu.classid!=0">
24
+            and s.classid=#{stu.classid}
25
+        </if>
26
+        <if test="stu.createname!=null and stu.createname!=''">
27
+            and (u.username like '%${stu.createname}%' or u.loginname like '%${stu.createname}%')
28
+        </if>
29
+        group by s.studentid
30
+    </select>
31
+</mapper>

+ 8
- 0
sexam/src/main/resources/mapper/report/ERsubjectMapper.xml View File

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.sexam.mapper.report.ERsubjectMapper">
4
+    <!--校级报告-成绩概况-->
5
+    <select id="listByExamId" resultType="java.util.Map">
6
+        select * from e_rsubject where examid=#{examid}
7
+    </select>
8
+</mapper>

+ 13
- 4
suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java View File

@@ -1,6 +1,5 @@
1 1
 package com.xhkjedu.suser.service.system;
2 2
 
3
-import com.alibaba.fastjson.JSON;
4 3
 import com.github.pagehelper.PageHelper;
5 4
 import com.github.pagehelper.PageInfo;
6 5
 import com.xhkjedu.suser.config.ConfigKey;
@@ -23,7 +22,11 @@ import com.xhkjedu.suser.utils.UserUtil;
23 22
 import com.xhkjedu.suser.vo.assess.AssessParams;
24 23
 import com.xhkjedu.suser.vo.system.UserVo;
25 24
 import com.xhkjedu.suser.vo.system.ZtMsgVo;
26
-import com.xhkjedu.utils.*;
25
+import com.xhkjedu.utils.DESUtils;
26
+import com.xhkjedu.utils.DatesUtil;
27
+import com.xhkjedu.utils.MD5;
28
+import com.xhkjedu.utils.N_Utils;
29
+import com.xhkjedu.utils.PageUtil;
27 30
 import com.xhkjedu.vo.PageResult;
28 31
 import com.xhkjedu.vo.ResultVo;
29 32
 import lombok.extern.slf4j.Slf4j;
@@ -34,7 +37,11 @@ import org.springframework.web.multipart.MultipartFile;
34 37
 
35 38
 import javax.annotation.Resource;
36 39
 import javax.servlet.http.HttpServletRequest;
37
-import java.util.*;
40
+import java.util.ArrayList;
41
+import java.util.HashMap;
42
+import java.util.List;
43
+import java.util.Map;
44
+import java.util.UUID;
38 45
 import java.util.stream.Collectors;
39 46
 
40 47
 /**
@@ -694,7 +701,9 @@ public class UserService extends JedisUtil {
694 701
             for (TUser user : teachers) {
695 702
                 String loginname = user.getLoginname();
696 703
                 String userphone = user.getUserphone();
697
-                if (N_Utils.isNotEmpty(userphone) && !phoneMap.get(userphone).equals(loginname)) {//绑定的手机号和登录名不一致,则手机号被其他用户绑定
704
+                String phone = phoneMap.get(userphone);
705
+                if (N_Utils.isNotEmpty(userphone) && N_Utils.isNotEmpty(phone) && !phone.equals(loginname)) {
706
+                    //绑定的手机号和登录名不一致,则手机号被其他用户绑定
698 707
                     return new ResultVo(1, "手机号【" + userphone + "】已被绑定");
699 708
                 }
700 709
                 TUser u = getObjByLoginName(loginname);

Loading…
Cancel
Save