Selaa lähdekoodia

模块更改终端类型模块角色更改,完善组件数据

tags/正式3.14.0
王宁 5 kuukautta sitten
vanhempi
commit
047a010477

+ 14
- 0
sapi/src/main/java/com/xhkjedu/sapi/controller/component/ComponentController.java Näytä tiedosto

@@ -411,4 +411,18 @@ public class ComponentController {
411 411
         N_Utils.validation(new Object[]{userid, "用户ID", 1});
412 412
         return new ResultVo(0, componentService.listExamCheckProgress(params));
413 413
     }
414
+
415
+    /*
416
+     * @Description 作业-我的
417
+     * @Date 2024/7/25 16:26:17
418
+     * @Author WN
419
+     * @Param [params]
420
+     * @Return com.xhkjedu.vo.ResultVo
421
+     **/
422
+    @PostMapping("/paper_my")
423
+    public ResultVo listPaperForMy(@RequestBody ComponentParams params) {
424
+        Integer userid = params.getUserid();
425
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
426
+        return new ResultVo(0, componentService.listPaperForMy(params));
427
+    }
414 428
 }

+ 4
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/component/ComponentMapper.java Näytä tiedosto

@@ -23,6 +23,9 @@ public interface ComponentMapper {
23 23
     //批改作业
24 24
     List<PaperListVo> listCorrectPages(@Param("userid")Integer userid,@Param("schoolid")Integer schoolid,@Param("limitSize")Integer limitSize);
25 25
 
26
+    //作业-我的
27
+    List<PaperListVo> listPaperForMy(@Param("params")ComponentParams params);
28
+
26 29
     //通知公告
27 30
     List<NoticeVo> listNotices(@Param("userid")Integer userid,@Param("limitSize")Integer limitSize);
28 31
 
@@ -122,4 +125,5 @@ public interface ComponentMapper {
122 125
     List<EPaperVo> listExamCheckProgressPaper(@Param("examid")Integer examid);
123 126
     //考试-阅卷进度-学生试题
124 127
     List<PaperStudentQuestionVo> listExamCheckProgressStuQuestion(@Param("epids")String epids);
128
+
125 129
 }

+ 4
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/ModuleMapper.java Näytä tiedosto

@@ -90,6 +90,10 @@ public interface ModuleMapper extends TkMapper<TModule> {
90 90
      //根据默认模块更改固定值:适用终端、站内应用、应用地址、应用编码、应用描述
91 91
     void updateBatchFixed(@Param("module") TModuledefault module);
92 92
 
93
+    //区域更改终端类型时,更改角色模块对应类型
94
+    void updateBatchBelongcode(@Param("module") TModuledefault module);
93 95
 
96
+    //学校修改终端类型时,更改对应模块角色终端类型
97
+    void updateBelongcodeByModuleid(@Param("module") TModule module);
94 98
 
95 99
 }

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/model/notice/TNotice.java Näytä tiedosto

@@ -21,7 +21,7 @@ public class TNotice extends BaseBean {
21 21
     //通知标题
22 22
     private String noticetitle;
23 23
 
24
-    //通知对象1班级2老师3单个学生4教师学生
24
+    //通知对象1班级(无)2老师3单个学生4教师学生
25 25
     private Integer noticetype;
26 26
 
27 27
     //创建人

+ 177
- 167
sapi/src/main/java/com/xhkjedu/sapi/service/component/ComponentService.java Näytä tiedosto

@@ -1,7 +1,6 @@
1 1
 package com.xhkjedu.sapi.service.component;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4
-import com.xhkjedu.sapi.mapper.analyze.SchoolPeopleMapper;
5 4
 import com.xhkjedu.sapi.mapper.component.ComponentMapper;
6 5
 import com.xhkjedu.sapi.mapper.gradeclass.ClassMapper;
7 6
 import com.xhkjedu.sapi.mapper.subjectbook.SubjectMapper;
@@ -43,8 +42,6 @@ public class ComponentService {
43 42
     private SubjectMapper subjectMapper;
44 43
     @Resource
45 44
     private ClassMapper classMapper;
46
-    @Resource
47
-    SchoolPeopleMapper schoolPeopleMapper;
48 45
 
49 46
 
50 47
     /*
@@ -57,24 +54,45 @@ public class ComponentService {
57 54
     public List<PaperListVo> listCorrectPages(Integer userid, Integer limitSize) {
58 55
         Integer schoolid = userMapper.getSchoolIdByUserId(userid);
59 56
         List<PaperListVo> list = componentMapper.listCorrectPages(userid, schoolid, limitSize);
57
+        return setPaperListVo(list);
58
+    }
59
+
60
+    /*
61
+     * @Description 作业-我的
62
+     * @Date 2024/7/25 16:25:33
63
+     * @Author WN
64
+     * @Param [params]
65
+     * @Return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
66
+     **/
67
+    public List<PaperListVo> listPaperForMy(ComponentParams params) {
68
+        Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
69
+        params.setSchoolid(schoolid);
70
+        List<PaperListVo> list = componentMapper.listPaperForMy(params);
71
+        return setPaperListVo(list);
72
+    }
73
+
74
+    public List<PaperListVo> setPaperListVo(List<PaperListVo> list) {
60 75
         for (PaperListVo p : list) {
61
-            List<Map> schools = p.getSchools();
62
-            List<PaperClassVo> classes = new ArrayList<>();
63
-            for (Map school : schools) {
64
-                List<PaperClassVo> classList = (List<PaperClassVo>) school.get("classes");
65
-                classes.addAll(classList);
66
-                for (PaperClassVo c : classList) {
67
-                    if (!N_Utils.isEmptyInteger(c.getClassnum())) {
68
-                        c.setWtjnum(c.getClassnum() - c.getYtjnum());
76
+            if (p.getPaperstate() == 21) {// 未布置
77
+                p.setClasses(null);
78
+                p.setChecklist(null);
79
+            } else {
80
+                List<Map> schools = p.getSchools();
81
+                List<PaperClassVo> classes = new ArrayList<>();
82
+                for (Map school : schools) {
83
+                    List<PaperClassVo> classList = (List<PaperClassVo>) school.get("classes");
84
+                    classes.addAll(classList);
85
+                    for (PaperClassVo c : classList) {
86
+                        if (!N_Utils.isEmptyInteger(c.getClassnum())) {
87
+                            c.setWtjnum(c.getClassnum() - c.getYtjnum());
88
+                        }
69 89
                     }
70 90
                 }
91
+                p.setClassnum(classes.stream().mapToInt(c -> c.getClassnum()).sum());
92
+                p.setYtjnum(classes.stream().mapToInt(c -> c.getYtjnum()).sum());
93
+                p.setYpgnum(classes.stream().mapToInt(c -> c.getYpgnum()).sum());
71 94
             }
72
-            p.setClassnum(classes.stream().mapToInt(c -> c.getClassnum()).sum());
73
-            p.setYtjnum(classes.stream().mapToInt(c -> c.getYtjnum()).sum());
74
-            p.setYpgnum(classes.stream().mapToInt(c -> c.getYpgnum()).sum());
75
-            p.setSchools(null);
76 95
         }
77
-
78 96
         return list;
79 97
     }
80 98
 
@@ -434,23 +452,23 @@ public class ComponentService {
434 452
      * @Param [params]
435 453
      * @Return void
436 454
      **/
437
-    public Map<String,Object> getClassErrorQuestion(ComponentParams params) {
438
-        long[] yeartimestamp = ApiUtil.getNowhalfYearTimestamp();//近半年
455
+    public Map<String, Object> getClassErrorQuestion(ComponentParams params) {
456
+        long[] yeartimestamp = ApiUtil.getNowhalfYearTimestamp();// 近半年
439 457
         params.setStarttime(yeartimestamp[0]);
440 458
         params.setStoptime(yeartimestamp[1]);
441 459
 
442 460
         // 获取当前教师班级最近一次已生成报告作业
443 461
         Integer lastError = componentMapper.getClassErrorQuesLastPaper(params);
444
-        Map<String,Object> map =  componentMapper.getClassErrorQuesAndExplain(params);
445
-        if(map == null || map.isEmpty()) {
462
+        Map<String, Object> map = componentMapper.getClassErrorQuesAndExplain(params);
463
+        if (map == null || map.isEmpty()) {
446 464
             map = new HashMap<>();
447
-            map.put("quesnum",0);
448
-            map.put("explainnum",0);
465
+            map.put("quesnum", 0);
466
+            map.put("explainnum", 0);
449 467
         }
450
-        if(lastError == null){
468
+        if (lastError == null) {
451 469
             lastError = 0;
452 470
         }
453
-        map.put("lasterror",lastError);
471
+        map.put("lasterror", lastError);
454 472
         return map;
455 473
     }
456 474
 
@@ -461,29 +479,29 @@ public class ComponentService {
461 479
      * @Param [params]
462 480
      * @Return java.util.Map<java.lang.String,java.lang.Integer>
463 481
      **/
464
-    public Map<String,Integer> getClassForTeacher(ComponentParams params){
482
+    public Map<String, Integer> getClassForTeacher(ComponentParams params) {
465 483
         Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
466 484
         params.setSchoolid(schoolid);
467
-        List<Integer> classids = componentMapper.listClassidsForTeacher(params);//权限班级
485
+        List<Integer> classids = componentMapper.listClassidsForTeacher(params);// 权限班级
468 486
         int classnum = 0;
469 487
         int stunum = 0;
470 488
         int groupnum = 0;
471
-        if(classids != null && classids.size() > 0) {
489
+        if (classids != null && classids.size() > 0) {
472 490
             classnum = classids.size();
473 491
             String classidsStr = classids.stream()
474
-                                .map(Object::toString)
475
-                                .collect(Collectors.joining(","));
476
-            List<Integer> stuGroups = componentMapper.listClassStuAndGroup(params.getUserid(),classidsStr);
477
-            if(stuGroups != null && stuGroups.size() > 0) {
492
+                                         .map(Object::toString)
493
+                                         .collect(Collectors.joining(","));
494
+            List<Integer> stuGroups = componentMapper.listClassStuAndGroup(params.getUserid(), classidsStr);
495
+            if (stuGroups != null && stuGroups.size() > 0) {
478 496
                 stunum = stuGroups.get(0);
479 497
                 groupnum = stuGroups.get(1);
480 498
             }
481 499
         }
482 500
 
483
-        Map<String,Integer> map = new HashMap<>();
484
-        map.put("classnum",classnum);
485
-        map.put("stunum",stunum);
486
-        map.put("groupnum",groupnum);
501
+        Map<String, Integer> map = new HashMap<>();
502
+        map.put("classnum", classnum);
503
+        map.put("stunum", stunum);
504
+        map.put("groupnum", groupnum);
487 505
         return map;
488 506
     }
489 507
 
@@ -494,25 +512,25 @@ public class ComponentService {
494 512
      * @Param [params]
495 513
      * @Return java.util.Map<java.lang.String,java.lang.Integer>
496 514
      **/
497
-    public Map<String,Integer> getQuestionStatistic(ComponentParams params){
515
+    public Map<String, Integer> getQuestionStatistic(ComponentParams params) {
498 516
         UserVo uservo = userMapper.getUserAndSchoolInfo(params.getUserid());
499 517
         params.setSchoolid(uservo.getSchoolid());
500 518
         params.setSchoollevel(uservo.getSchoollevel());
501 519
 
502
-        Map<String,Integer> map = componentMapper.getQuestionStatistic(params);
503
-        if(map == null || map.isEmpty()){
520
+        Map<String, Integer> map = componentMapper.getQuestionStatistic(params);
521
+        if (map == null || map.isEmpty()) {
504 522
             map = new HashMap<>();
505
-            map.put("totalnum",0);
506
-            map.put("todaynum",0);
523
+            map.put("totalnum", 0);
524
+            map.put("todaynum", 0);
507 525
         }
508
-        //获取当前学科试题数量
526
+        // 获取当前学科试题数量
509 527
         Integer subjectnum = componentMapper.getQuestionStatisticSubejct(params);
510
-        if(subjectnum == null){
528
+        if (subjectnum == null) {
511 529
             subjectnum = 0;
512 530
         }
513
-        map.put("subjectnum",subjectnum);
531
+        map.put("subjectnum", subjectnum);
514 532
 
515
-        return  map;
533
+        return map;
516 534
     }
517 535
 
518 536
     /*
@@ -522,54 +540,54 @@ public class ComponentService {
522 540
      * @Param [params]
523 541
      * @Return java.util.Map<java.lang.String,java.lang.Object>
524 542
      **/
525
-    public Map<String,Object> getTeachingStatistic(ComponentParams params){
543
+    public Map<String, Object> getTeachingStatistic(ComponentParams params) {
526 544
         UserVo uservo = userMapper.getUserAndSchoolInfo(params.getUserid());
527 545
         params.setSchoolid(uservo.getSchoolid());
528 546
         params.setSchoollevel(uservo.getSchoollevel());
529 547
         params.setYear(uservo.getYear());
530 548
 
531
-        //近半年
549
+        // 近半年
532 550
         long[] yeartimestamp = ApiUtil.getNowhalfYearTimestamp();
533 551
         params.setStarttime(yeartimestamp[0]);
534 552
         params.setStoptime(yeartimestamp[1]);
535 553
 
536 554
         params.setTimestamp(N_Utils.getSecondTimestamp());
537 555
 
538
-        Map<String,Object> map = componentMapper.getTeachingSchoolClassNum(params);//班级总数量
556
+        Map<String, Object> map = componentMapper.getTeachingSchoolClassNum(params);// 班级总数量
539 557
 
540
-        //作业
558
+        // 作业
541 559
         List<SchoolWorkSubjectVo> lst = componentMapper.listTeachingPapers(params);
542 560
         Integer paperTotalnum = 0;
543 561
         double paperCommitRate = 0;
544 562
         double paperCheckRate = 0;
545 563
 
546
-        if(lst!=null && lst.size()>0){
547
-            for(SchoolWorkSubjectVo subject : lst){
548
-                subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(),subject.getStunum()));
549
-                subject.setCheckrate(N_Utils.getIntegerDivideAndMulitiply(subject.getChecknum(),subject.getCommitnum()));
564
+        if (lst != null && lst.size() > 0) {
565
+            for (SchoolWorkSubjectVo subject : lst) {
566
+                subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(), subject.getStunum()));
567
+                subject.setCheckrate(N_Utils.getIntegerDivideAndMulitiply(subject.getChecknum(), subject.getCommitnum()));
550 568
                 subject.setWorklist(new ArrayList<>());
551 569
             }
552 570
 
553 571
             paperTotalnum = lst.stream().mapToInt(SchoolWorkSubjectVo::getFabunum).sum();
554
-            Integer totalcommit =  lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
572
+            Integer totalcommit = lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
555 573
             Integer totalcheck = lst.stream().mapToInt(SchoolWorkSubjectVo::getChecknum).sum();
556 574
             Integer totalstunum = lst.stream().mapToInt(SchoolWorkSubjectVo::getStunum).sum();
557
-            paperCommitRate  = N_Utils.getIntegerDivideAndMulitiply(totalcommit,totalstunum);
558
-            if(totalcommit>0){
559
-                paperCheckRate = N_Utils.getIntegerDivideAndMulitiply(totalcheck,totalcommit);
575
+            paperCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit, totalstunum);
576
+            if (totalcommit > 0) {
577
+                paperCheckRate = N_Utils.getIntegerDivideAndMulitiply(totalcheck, totalcommit);
560 578
             }
561 579
         }
562
-        map.put("paperTotalnum",paperTotalnum);
563
-        map.put("paperCommitRate",paperCommitRate);
564
-        map.put("paperCheckRate",paperCheckRate);
580
+        map.put("paperTotalnum", paperTotalnum);
581
+        map.put("paperCommitRate", paperCommitRate);
582
+        map.put("paperCheckRate", paperCheckRate);
565 583
 
566
-        //预习
584
+        // 预习
567 585
         List<SchoolWorkSubjectVo> guideList = componentMapper.listTeachingGuides(params);
568 586
         Integer guideTotalnum = 0;
569 587
         double guideCommitRate = 0;
570
-        if(guideList!=null && guideList.size()>0){
571
-            for(SchoolWorkSubjectVo subject : guideList){
572
-                subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(),subject.getStunum()));
588
+        if (guideList != null && guideList.size() > 0) {
589
+            for (SchoolWorkSubjectVo subject : guideList) {
590
+                subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(), subject.getStunum()));
573 591
 
574 592
                 subject.setWorklist(new ArrayList<>());
575 593
             }
@@ -577,14 +595,14 @@ public class ComponentService {
577 595
             guideTotalnum = lst.stream().mapToInt(SchoolWorkSubjectVo::getFabunum).sum();
578 596
             Integer totalstunum = lst.stream().mapToInt(SchoolWorkSubjectVo::getStunum).sum();
579 597
             Integer totalcommit = lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
580
-            if(totalcommit>0){
581
-                guideCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit,totalstunum);
598
+            if (totalcommit > 0) {
599
+                guideCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit, totalstunum);
582 600
             }
583 601
         }
584
-        map.put("guideTotalnum",guideTotalnum);
585
-        map.put("guideCommitRate",guideCommitRate);
602
+        map.put("guideTotalnum", guideTotalnum);
603
+        map.put("guideCommitRate", guideCommitRate);
586 604
 
587
-        //背诵
605
+        // 背诵
588 606
         // List<SchoolWorkSubjectVo> reciteList = componentMapper.listTeachingRecites(params);
589 607
         // int reciteTotalnum = 0;
590 608
         // double reciteCommitRate = 0;
@@ -604,7 +622,7 @@ public class ComponentService {
604 622
         // map.put("reciteTotalnum",reciteTotalnum);
605 623
         // map.put("reciteCommitRate",reciteCommitRate);
606 624
 
607
-        return  map;
625
+        return map;
608 626
     }
609 627
 
610 628
     /*
@@ -614,7 +632,7 @@ public class ComponentService {
614 632
      * @Param [params]
615 633
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
616 634
      **/
617
-    public List<Map<String,Object>> listUserModules(ComponentParams params){
635
+    public List<Map<String, Object>> listUserModules(ComponentParams params) {
618 636
         return componentMapper.listUserModules(params);
619 637
     }
620 638
 
@@ -625,7 +643,7 @@ public class ComponentService {
625 643
      * @Param [params]
626 644
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
627 645
      **/
628
-    public List<Map<String,Object>> listExamPaperGiv(ComponentParams params){
646
+    public List<Map<String, Object>> listExamPaperGiv(ComponentParams params) {
629 647
         params.setTodayDatetime(LocalDateTime.now());
630 648
         return componentMapper.listExamPaperGiv(params);
631 649
     }
@@ -637,7 +655,7 @@ public class ComponentService {
637 655
      * @Param [params]
638 656
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
639 657
      **/
640
-    public List<Map<String,Object>> listExamPaperCheck(ComponentParams params){
658
+    public List<Map<String, Object>> listExamPaperCheck(ComponentParams params) {
641 659
         return componentMapper.listExamPaperCheck(params);
642 660
     }
643 661
 
@@ -648,16 +666,16 @@ public class ComponentService {
648 666
      * @Param [params]
649 667
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
650 668
      **/
651
-    public List<Map<String,Object>> listExamInvigilate(ComponentParams params){
669
+    public List<Map<String, Object>> listExamInvigilate(ComponentParams params) {
652 670
         params.setTodayDatetime(LocalDateTime.now());
653 671
         Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
654 672
 
655
-        List<Map<String,Object>> list = componentMapper.listExamInvigilate(params);
673
+        List<Map<String, Object>> list = componentMapper.listExamInvigilate(params);
656 674
         for (Map map : list) {
657 675
             List<Map> classes = JSON.parseArray(map.get("classnames").toString(), Map.class);
658 676
             List<Map> classList = new ArrayList<>();
659 677
             Integer majored = (Integer) map.get("majored");
660
-            if (majored == 1) {//主监考
678
+            if (majored == 1) {// 主监考
661 679
                 classList.addAll(classes);
662 680
             } else {
663 681
                 String[] classids2 = map.get("classids").toString().split(",");
@@ -686,7 +704,7 @@ public class ComponentService {
686 704
                 schools.add(school);
687 705
             }
688 706
             if (schools.size() > 1) {
689
-                //把本校放在第一个位置
707
+                // 把本校放在第一个位置
690 708
                 for (int i = 0; i < schools.size(); i++) {
691 709
                     Map rtnMap = schools.get(i);
692 710
                     Integer schoolid2 = Integer.parseInt(rtnMap.get("schoolid").toString());
@@ -709,27 +727,25 @@ public class ComponentService {
709 727
      * @Param [params]
710 728
      * @Return java.util.Map<java.lang.String,java.lang.Object>
711 729
      **/
712
-    public Map<String,Object> getExamReportSchool(ComponentParams params){
730
+    public Map<String, Object> getExamReportSchool(ComponentParams params) {
713 731
         Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
714
-        //获取最新近一次有报告的考试
715
-        Map<String,Object> map = componentMapper.getExamReportSchoolBase(schoolid);
716
-        if(map!=null && !map.isEmpty()){
717
-            Integer examid = Integer.parseInt(map.get("examid").toString());
718
-            List<Map<String,Object>> subjects = componentMapper.listExamReportSchoolStatistic(examid);
719
-            map.put("subjects",subjects);
720
-        }else {
721
-            map = new HashMap<>();
722
-            map.put("classnum", 0);
723
-            map.put("stunum", 0);
724
-            map.put("missnum", 0);
725
-            map.put("subjectnum", 0);
726
-            map.put("maxscore", 0);
727
-            map.put("avgscore", 0);
728
-            map.put("mixscore", 0);
729
-
730
-            map.put("subjects",new ArrayList<>());
732
+        // 获取最新近一次有报告的考试
733
+        Map<String, Object> map = componentMapper.getExamReportSchoolBase(schoolid);
734
+        if (map != null && !map.isEmpty()) {
735
+            Integer examstate = Integer.parseInt(map.get("examstate").toString());
736
+            if (examstate == 3) {
737
+                Integer examid = Integer.parseInt(map.get("examid").toString());
738
+                List<Map<String, Object>> subjects = componentMapper.listExamReportSchoolStatistic(examid);
739
+                map.put("subjects", subjects);
740
+                return map;
741
+            } else {
742
+                return null;
743
+            }
744
+
745
+        } else {
746
+            return null;
731 747
         }
732
-        return map;
748
+
733 749
     }
734 750
 
735 751
     /*
@@ -739,44 +755,40 @@ public class ComponentService {
739 755
      * @Param [params]
740 756
      * @Return java.util.Map<java.lang.String,java.lang.Object>
741 757
      **/
742
-    public Map<String,Object> getExamReportClass(ComponentParams params){
758
+    public Map<String, Object> getExamReportClass(ComponentParams params) {
743 759
         Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
744 760
         params.setSchoolid(schoolid);
745 761
 
746
-        Map<String,Object> map = new HashMap<>();
747 762
         ExamInfoVo examInfoVo = componentMapper.getExamReportClassInfo(params);
748
-        if(examInfoVo != null){
749
-            params.setSubjectid("zf");
750
-            params.setClassid(examInfoVo.getClassid());
751
-            params.setShowrank(examInfoVo.getTeashowrank());
752
-            params.setExamid(examInfoVo.getExamid());
763
+        if (examInfoVo != null) {
764
+            if(examInfoVo.getExamstate() == 3){
765
+                params.setSubjectid("zf");
766
+                params.setShowrank(examInfoVo.getTeashowrank());
767
+                params.setExamid(examInfoVo.getExamid());
768
+                if (!N_Utils.isTrueInteger(params.getClassid())) {
769
+                    params.setClassid(examInfoVo.getClassid());
770
+                }
753 771
 
754
-            map = componentMapper.getExamReportSingleBase(params);
772
+                Map<String, Object>  map = componentMapper.getExamReportSingleBase(params);
755 773
 
756
-            //获取考试关联的班级信息
757
-            List<Map<String,Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(),params.getUserid());
758
-            map.put("classlist",classList);
774
+                // 获取考试关联的班级信息
775
+                List<Map<String, Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(), params.getUserid());
776
+                map.put("classlist", classList);
759 777
 
760 778
 
761
-            List<Map<String,Object>> subjectList = new ArrayList<>();
762
-            if(examInfoVo.getTeashowrank() == 3){
763
-                subjectList = componentMapper.listExamReportClassScore(params);
779
+                List<Map<String, Object>> subjectList = new ArrayList<>();
780
+                if (examInfoVo.getTeashowrank() == 3) {
781
+                    subjectList = componentMapper.listExamReportClassScore(params);
782
+                }
783
+                map.put("subjectlist", subjectList);
784
+                map.put("teashowrank", examInfoVo.getTeashowrank());
785
+                return map;
786
+            }else{
787
+                return null;
764 788
             }
765
-            map.put("subjectlist",subjectList);
766
-        }else{
767
-            map = new HashMap<>();
768
-            map.put("classlist", new ArrayList<>());
769
-            map.put("subjectlist", new ArrayList<>());
770
-            map.put("yxrate", 0);
771
-            map.put("jgrate", 0);
772
-            map.put("classmaxscore", 0);
773
-            map.put("classavgscore", 0);
774
-            map.put("classavgscorerank", 0);
775
-            map.put("schoolmaxscore", 0);
776
-            map.put("schoolavgscore", 0);
789
+        } else {
790
+            return null;
777 791
         }
778
-
779
-        return map;
780 792
     }
781 793
 
782 794
     /*
@@ -786,44 +798,42 @@ public class ComponentService {
786 798
      * @Param [params]
787 799
      * @Return java.util.Map<java.lang.String,java.lang.Object>
788 800
      **/
789
-    public Map<String,Object> getExamReportSingle(ComponentParams params){
801
+    public Map<String, Object> getExamReportSingle(ComponentParams params) {
790 802
         Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
791 803
         params.setSchoolid(schoolid);
792 804
 
793
-        Map<String,Object> map = new HashMap<>();
794 805
         ExamInfoVo examInfoVo = componentMapper.getExamReportSingleInfo(params);
795 806
 
796
-        if(examInfoVo != null){
797
-            params.setSubjectid(examInfoVo.getSubjectid());
798
-            params.setClassid(examInfoVo.getClassid());
799
-            params.setShowrank(examInfoVo.getTeashowrank());
800
-            params.setExamid(examInfoVo.getExamid());
807
+        if (examInfoVo != null) {
808
+            if(examInfoVo.getExamstate() == 3){
809
+                params.setSubjectid(examInfoVo.getSubjectid());
810
+                params.setShowrank(examInfoVo.getTeashowrank());
811
+                params.setExamid(examInfoVo.getExamid());
801 812
 
802
-            map = componentMapper.getExamReportSingleBase(params);
813
+                if (!N_Utils.isTrueInteger(params.getClassid())) {
814
+                    params.setClassid(examInfoVo.getClassid());
815
+                }
803 816
 
804
-            //获取考试关联的班级信息
805
-            List<Map<String,Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(),params.getUserid());
806
-            map.put("classlist",classList);
817
+                Map<String, Object> map = componentMapper.getExamReportSingleBase(params);
807 818
 
808
-            List<Map<String,Object>> rankList = new ArrayList<>();
809
-            if(examInfoVo.getTeashowrank() == 3){
810
-                rankList = componentMapper.listExamReportSingleRank(params);
819
+                // 获取考试关联的班级信息
820
+                List<Map<String, Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(), params.getUserid());
821
+                map.put("classlist", classList);
822
+
823
+                List<Map<String, Object>> rankList = new ArrayList<>();
824
+                if (examInfoVo.getTeashowrank() == 3) {
825
+                    rankList = componentMapper.listExamReportSingleRank(params);
826
+                }
827
+                map.put("ranklist", rankList);
828
+                map.put("teashowrank", examInfoVo.getTeashowrank());
829
+                return map;
830
+            }else{
831
+                return null;
811 832
             }
812
-            map.put("ranklist",rankList);
813
-        }else{
814
-            map = new HashMap<>();
815
-            map.put("classlist", new ArrayList<>());
816
-            map.put("ranklist", new ArrayList<>());
817
-            map.put("yxrate", 0);
818
-            map.put("jgrate", 0);
819
-            map.put("classmaxscore", 0);
820
-            map.put("classavgscore", 0);
821
-            map.put("classavgscorerank", 0);
822
-            map.put("schoolmaxscore", 0);
823
-            map.put("schoolavgscore", 0);
824
-        }
825 833
 
826
-        return map;
834
+        } else {
835
+            return null;
836
+        }
827 837
     }
828 838
 
829 839
     /*
@@ -833,43 +843,43 @@ public class ComponentService {
833 843
      * @Param [params]
834 844
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
835 845
      **/
836
-    public List<Map<String,Object>> listExamCheckProgress(ComponentParams params){
846
+    public List<Map<String, Object>> listExamCheckProgress(ComponentParams params) {
837 847
         UserVo userVo = userMapper.getUserAndSchoolInfo(params.getUserid());
838 848
         params.setSchoolid(userVo.getSchoolid());
839 849
         params.setUsertype(userVo.getUsertype());
840
-        //获取最新的一个考试阅卷
850
+        // 获取最新的一个考试阅卷
841 851
         ExamInfoVo examInfoVo = componentMapper.getExamCheckProgressBase(params);
842
-        List<Map<String,Object>> mapList = new ArrayList<>();
852
+        List<Map<String, Object>> mapList = new ArrayList<>();
843 853
 
844
-        if(examInfoVo!=null){
854
+        if (examInfoVo != null) {
845 855
             List<EPaperVo> papers = componentMapper.listExamCheckProgressPaper(examInfoVo.getExamid());
846 856
             String epids = papers.stream().map(p -> p.getEpid().toString()).collect(Collectors.joining(","));
847
-            List<PaperStudentQuestionVo> questions = componentMapper.listExamCheckProgressStuQuestion(epids);//获取考试学生试题
857
+            List<PaperStudentQuestionVo> questions = componentMapper.listExamCheckProgressStuQuestion(epids);// 获取考试学生试题
848 858
 
849 859
             for (EPaperVo paper : papers) {
850
-                //单科统计
860
+                // 单科统计
851 861
                 Integer epid = paper.getEpid();
852 862
                 List<PaperStudentQuestionVo> qlist =
853 863
                         questions.stream().filter(q -> q.getEpid().equals(epid)).collect(Collectors.toList());
854 864
 
855 865
                 List<Integer> qtlist = qlist.stream().filter(q -> !N_Utils.isObjectiveQuestion(q.getCtype()))
856 866
                                             .map(q -> q.getQorder()).distinct().collect(Collectors.toList());
857
-                List<PaperStudentQuestionVo> zdlist =//作答集合
867
+                List<PaperStudentQuestionVo> zdlist =// 作答集合
858 868
                         qlist.stream().filter(q -> q.getAnswered().equals(1)).collect(Collectors.toList());
859
-                List<PaperStudentQuestionVo> pylist =//批阅集合
869
+                List<PaperStudentQuestionVo> pylist =// 批阅集合
860 870
                         zdlist.stream().filter(q -> q.getChecked().equals(2)).collect(Collectors.toList());
861 871
                 Integer zgtnum = qtlist.size();
862 872
                 Integer stunum = zdlist.stream().map(q -> q.getStudentid()).distinct().collect(Collectors.toList()).size();
863
-                Integer zpynum = pylist.size();//试卷批阅试题数量
873
+                Integer zpynum = pylist.size();// 试卷批阅试题数量
864 874
 
865
-                Map<String,Object> map = new LinkedHashMap<>();
875
+                Map<String, Object> map = new LinkedHashMap<>();
866 876
 
867
-                map.put("subjectid",paper.getSubjectid());
868
-                map.put("subjectname",paper.getSubjectname());
869
-                map.put("examnum",examInfoVo.getExamnum());
870
-                map.put("stunum",stunum);//实际人数
871
-                map.put("zgtnum",zgtnum);//主观题数量
872
-                map.put("pyrate",N_Utils.getIntegerDivideAndMulitiply(zpynum, zdlist.size()));//批阅进度
877
+                map.put("subjectid", paper.getSubjectid());
878
+                map.put("subjectname", paper.getSubjectname());
879
+                map.put("examnum", examInfoVo.getExamnum());
880
+                map.put("stunum", stunum);// 实际人数
881
+                map.put("zgtnum", zgtnum);// 主观题数量
882
+                map.put("pyrate", N_Utils.getIntegerDivideAndMulitiply(zpynum, zdlist.size()));// 批阅进度
873 883
 
874 884
                 mapList.add(map);
875 885
             }

+ 7
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/system/ModuleService.java Näytä tiedosto

@@ -74,7 +74,14 @@ public class ModuleService {
74 74
         TModule original=moduleMapper.selectByPrimaryKey(module.getModuleid());
75 75
         if(original!=null && original.getSourcetype() ==2){
76 76
             module.setDefaultbcode(module.getBelongcode());
77
+
78
+            //判断是否更改belongcode
79
+            if(module != null && !original.getBelongcode().equals(module.getBelongcode())){
80
+                moduleMapper.updateBelongcodeByModuleid(module);
81
+            }
82
+
77 83
         }
84
+
78 85
         return moduleMapper.updateByPrimaryKeySelective(module);
79 86
     }
80 87
 

+ 5
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/system/ModuledefaultService.java Näytä tiedosto

@@ -124,6 +124,11 @@ public class ModuledefaultService {
124 124
 
125 125
             //直接覆盖所有学校:适用终端、站内应用、应用地址、应用编码、应用描述
126 126
             moduleMapper.updateBatchFixed(model);
127
+
128
+            //区域更改终端类型时,更改模块对应的t_role_module对应belongcode
129
+            if(!originModule.getBelongcode().equals(model.getBelongcode())){
130
+                moduleMapper.updateBatchBelongcode(model);
131
+            }
127 132
         }
128 133
 
129 134
         moduledefaultMapper.updateByPrimaryKeySelective(model);//更新默认模块信息

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/vo/component/ExamInfoVo.java Näytä tiedosto

@@ -29,4 +29,7 @@ public class ExamInfoVo {
29 29
 
30 30
     //计划考试人数
31 31
     private Integer examnum;
32
+
33
+    //考试状态0未开始1已开始2已结束3已生成报告
34
+    private Integer examstate;
32 35
 }

+ 99
- 30
sapi/src/main/resources/mapper/component/ComponentMapper.xml Näytä tiedosto

@@ -28,6 +28,14 @@
28 28
         <collection property="schools" ofType="java.util.Map" javaType="java.util.List"
29 29
                     select="listClass" column="{paperid=paperid,createid=createid,checkid=checkid,checktype=checktype,logschoolid=logschoolid,classids=classids}">
30 30
         </collection>
31
+        <collection property="checklist" ofType="java.util.Map" javaType="java.util.List"
32
+                    select="listPaperCheckStu" column="{paperid=paperid,checktype=checktype,logschoolid=logschoolid,classids=classids}">
33
+            <result property="userid" column="userid"/>
34
+            <result property="username" column="username"/>
35
+            <result property="classid" column="classid"/>
36
+            <result property="classname" column="classname"/>
37
+            <result property="gradeid" column="gradeid"/>
38
+        </collection>
31 39
     </resultMap>
32 40
     <resultMap id="classResult" type="java.util.Map">
33 41
         <result property="schoolid" column="schoolid"/>
@@ -46,18 +54,21 @@
46 54
             <result property="checked" column="checked"/>
47 55
         </collection>
48 56
     </resultMap>
49
-    <select id="listCorrectPages" resultMap="paperResult">
50
-        select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb
51
-             ,#{schoolid} as logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{userid} as checkid
52
-             ,group_concat(pg.classid) classids,p.aftercommit
53
-        from t_paper p left join t_user u on p.createid=u.userid
54
-                       left join t_paper_class pg on p.paperid=pg.paperid
55
-                       left join t_paper_student ps on p.paperid=ps.paperid and pg.classid=ps.classid
56
-                       left join t_director d on p.directorid=d.directorid
57
-        where p.deleted=0 and (d.disabled=0 or p.directorid is null)
58
-          and (p.createid=#{userid} or ps.checkid=#{userid}) and ps.psstate in(1,2,4) and ps.pschecked!=1
59
-        group by p.paperid order by p.createtime desc limit #{limitSize}
60
-    </select>
57
+    <resultMap id="checkUserResult" type="java.util.Map">
58
+        <result property="schoolid" column="schoolid"/>
59
+        <result property="schoolname" column="schoolname"/>
60
+        <result property="checktype" column="checktype"/>
61
+        <collection property="classes" ofType="java.util.Map" javaType="java.util.List">
62
+            <result property="schoolid" column="schoolid"/>
63
+            <result property="classid" column="classid"/>
64
+            <result property="classname" column="classname"/>
65
+            <result property="gradeid" column="gradeid"/>
66
+            <collection property="users" ofType="java.util.Map" javaType="java.util.List">
67
+                <result property="userid" column="userid"/>
68
+                <result property="username" column="username"/>
69
+            </collection>
70
+        </collection>
71
+    </resultMap>
61 72
     <select id="listClass" resultMap="classResult">
62 73
         select count(*) as classnum,ps.classid,c.classname,c.gradeid,c.schoolid,s.schoolname
63 74
         ,count(distinct if(ps.psstate in(1,2,4), ps.psid, null))ytjnum
@@ -71,6 +82,62 @@
71 82
         group by ps.classid
72 83
         order by if(s.schoolid=#{logschoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder
73 84
     </select>
85
+    <select id="listPaperCheckStu" resultMap="checkUserResult">
86
+        <if test="checktype==1">
87
+            select pg.checkid as userid,u.username,c.classid,c.classname,c.gradeid,pg.schoolid,s.schoolname
88
+            from t_paper_class pg left join t_school s on pg.schoolid=s.schoolid
89
+            left join t_user u on pg.checkid=u.userid
90
+            left join t_class c on pg.classid=c.classid
91
+            where pg.paperid=#{paperid}
92
+            <if test="classids!=null and classids!=''">
93
+                and pg.classid in(${classids})
94
+            </if>
95
+            order by if(s.schoolid=#{logschoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
96
+        </if>
97
+        <if test="checktype==3">
98
+            select ps.checkid as userid,u.username,c.classid,c.classname,c.gradeid,ps.schoolid,s.schoolname
99
+            from t_paper_student ps left join t_school s on ps.schoolid=s.schoolid
100
+            left join t_user u on ps.checkid=u.userid
101
+            left join t_class c on ps.classid=c.classid
102
+            where ps.paperid=#{paperid}
103
+            <if test="classids!=null and classids!=''">
104
+                and ps.classid in(${classids})
105
+            </if>
106
+            group by ps.classid,ps.checkid
107
+            order by if(s.schoolid=#{logschoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
108
+        </if>
109
+        <if test="checktype!=1 and checktype!=3">
110
+            select checktype from t_paper where paperid=#{paperid}
111
+        </if>
112
+    </select>
113
+    <select id="listCorrectPages" resultMap="paperResult">
114
+        select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb
115
+        ,#{schoolid} as logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{userid} as checkid
116
+        ,group_concat(pg.classid) classids,p.aftercommit
117
+        from t_paper p left join t_user u on p.createid=u.userid
118
+        left join t_paper_class pg on p.paperid=pg.paperid
119
+        left join t_paper_student ps on p.paperid=ps.paperid and pg.classid=ps.classid
120
+        left join t_director d on p.directorid=d.directorid
121
+        where p.deleted=0 and (d.disabled=0 or p.directorid is null)
122
+        and (p.createid=#{userid} or ps.checkid=#{userid}) and ps.psstate in(1,2,4) and ps.pschecked!=1
123
+        group by p.paperid order by p.createtime desc limit #{limitSize}
124
+    </select>
125
+
126
+    <!--作业-我的-->
127
+    <select id="listPaperForMy" resultMap="paperResult">
128
+        select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb,
129
+        #{params.schoolid} logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{params.userid} as checkid
130
+        ,group_concat(pg.classid) classids,p.aftercommit
131
+        from t_paper p left join t_user u on p.createid=u.userid
132
+        left join t_paper_class pg on p.paperid=pg.paperid
133
+        left join t_director d on p.directorid=d.directorid
134
+        where p.deleted=0 and p.createid=#{params.userid} and (d.disabled=0 or p.directorid is null)
135
+        group by p.paperid
136
+        <!--<if test="params.psstate==0 || params.psstate==1">-->
137
+        <!--    having min(pg.checked)=#{params.psstate}-->
138
+        <!--</if>-->
139
+        order by p.createtime desc,p.paperid desc limit #{params.limitSize}
140
+    </select>
74 141
 
75 142
     <!--通知公告-->
76 143
     <select id="listNotices" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
@@ -110,7 +177,7 @@
110 177
         left join t_director d on rd.directorid=d.directorid
111 178
         left join t_teacher_powersb p on p.teacherid=r.createid and p.lsbid=d.lsbid
112 179
         where r.resourcestate=1 and r.`level`=1 and d.disabled=0
113
-        and (r.belong in(1,2) or (r.belong in(3,10) and r.schoolid=#{schoolid}) or (r.belong=4 and r.createid=#{userid}) )
180
+        and (r.belong in(1,2) or (r.belong in(3,10) and r.schoolid=#{schoolid}) or (r.belong=4 and r.createid=#{userid}))
114 181
         group by r.resourceid order by r.createtime desc limit #{limitSize}
115 182
     </select>
116 183
 
@@ -122,7 +189,7 @@
122 189
         left join t_director d on rd.directorid=d.directorid
123 190
         left join t_teacher_powersb p on p.teacherid=r.createid and p.lsbid=d.lsbid
124 191
         where r.resourcestate=1 and r.`level`=4 and d.disabled=0 and r.resourcetype=5
125
-        and (r.belong in(1,2) or (r.belong in(3,10) and r.schoolid=#{schoolid}) or (r.belong=4 and r.createid=#{userid}) )
192
+        and (r.belong in(1,2) or (r.belong in(3,10) and r.schoolid=#{schoolid}) or (r.belong=4 and r.createid=#{userid}))
126 193
         group by r.resourceid order by r.createtime desc limit #{limitSize}
127 194
     </select>
128 195
 
@@ -144,7 +211,7 @@
144 211
         ,count(DISTINCT gs.rgsid) totalnum,
145 212
         count(DISTINCT(if(gs.readtime is not null,gs.rgsid,null))) commitnum
146 213
         from t_guide g
147
-        left join t_guide_group_student gs on g.guideid=gs.guideid and g.schoolid=gs.schoolid
214
+        left join t_guide_group_student gs on g.guideid=gs.guideid
148 215
         left join t_director d on g.directorid=d.directorid
149 216
         left join t_teacher_powersb p on p.teacherid=g.createid and p.lsbid=g.lsbid
150 217
         where d.disabled=0 and g.createid=#{userid}
@@ -160,11 +227,11 @@
160 227
     <!--背诵-->
161 228
     <select id="listReciteds" resultType="java.util.Map">
162 229
         select r.reciteid,r.recitetitle,r.subjectid,r.createid,r.createtime,r.recitestate,r.recitecont
163
-        ,rg.starttime,rg.stoptime,count(DISTINCT rs.rsid) totalnum,
230
+        ,r.schoolid,r.hashb,rg.starttime,rg.stoptime,count(DISTINCT rs.rsid) totalnum,
164 231
         count(DISTINCT(if (rs.rsstate>0,rs.rsid,null))) commitnum
165 232
         from t_recite r left join t_recite_group rg on r.reciteid=rg.reciteid
166
-        left join t_recite_student rs on r.reciteid=rs.reciteid and r.schoolid=rs.schoolid
167
-        where r.createid=#{userid} and r.recitestate=22 group by r.reciteid order by r.createtime desc limit #{limitSize}
233
+        left join t_recite_student rs on r.reciteid=rs.reciteid
234
+        where r.createid=#{userid} group by r.reciteid order by r.createtime desc limit #{limitSize}
168 235
     </select>
169 236
 
170 237
     <!--课堂回顾-->
@@ -315,14 +382,16 @@
315 382
         count(DISTINCT(if(DATE(FROM_UNIXTIME(q.createtime)) = CURDATE(),q.questionid,null))) todaynum
316 383
         from t_question q
317 384
         left join t_subject s on q.subjectid=s.subjectid and s.`level`=#{params.schoollevel}
318
-        where q.belong and (q.belong in(1,2) or (q.belong in(3,10) and q.schoolid=#{params.schoolid})) and q.qlevel &lt; 3
385
+        where q.belong and (q.belong in(1,2) or (q.belong in(3,10) and q.schoolid=#{params.schoolid}) or (r.belong=4 and r.createid=#{params.userid}))
386
+        and q.qlevel &lt; 3
319 387
     </select>
320 388
     <!--校本题库-当前学科试题数量-->
321 389
     <select id="getQuestionStatisticSubejct" resultType="java.lang.Integer">
322 390
         select count(DISTINCT q.questionid) subjectnum
323 391
         from t_question q
324 392
         left join t_teacher_powersb tp on q.subjectid = tp.subjectid
325
-        where tp.teacherid=#{params.userid} and q.belong and (q.belong in(1,2) or (q.belong in(3,10) and q.schoolid=#{params.schoolid})) and q.qlevel &lt; 3
393
+        where tp.teacherid=#{params.userid}
394
+        and q.belong and (q.belong in(1,2) or (q.belong in(3,10) and q.schoolid=#{params.schoolid}) or (r.belong=4 and r.createid=#{params.userid})) and q.qlevel &lt; 3
326 395
     </select>
327 396
 
328 397
     <!--教学统计-班级学生教师数量-->
@@ -390,7 +459,7 @@
390 459
     <select id="listExamPaperGiv" resultType="java.util.Map">
391 460
         select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,
392 461
         es.esstate ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,
393
-        ep.scantronpdf,es.examid,e.examname,e.examtype,e.exammode,e.examstate,e.hashb,e.schoolid
462
+        ep.scantronpdf,es.examid,e.examname,e.examtype,e.exammode,e.examstate,e.gradeid,e.hashb,e.schoolid
394 463
         from e_subject es left join e_paper ep on es.esid=ep.esid
395 464
         left join e_base e on es.examid=e.examid
396 465
         left join t_user u on ep.handleid=u.userid
@@ -447,8 +516,8 @@
447 516
     </select>
448 517
     <!--考试-校级报告-获取最近一次生成报告的考试-->
449 518
     <select id="getExamReportSchoolBase" resultType="java.util.Map">
450
-        select re.*  from e_base e left join e_rbase re on e.examid=re.examid
451
-        where e.schoolid=#{schoolid} and e.deleted=1 and e.examstate=3 order by examdate desc limit 1
519
+        select re.*,e.teashowrank,e.examstate from e_base e left join e_rbase re on e.examid=re.examid
520
+        where e.schoolid=#{schoolid} and e.deleted=1 order by examdate desc limit 1
452 521
     </select>
453 522
     <!--考试-校级报告-成绩概况-->
454 523
     <select id="listExamReportSchoolStatistic" resultType="java.util.Map">
@@ -467,11 +536,11 @@
467 536
 
468 537
     <!--考试-班级报告-考试信息-->
469 538
     <select id="getExamReportClassInfo" resultType="com.xhkjedu.sapi.vo.component.ExamInfoVo">
470
-        select e.examid,e.teashowrank,c.classid,c.classname
539
+        select e.examid,e.teashowrank,e.examstate,c.classid,c.classname
471 540
         from e_base e left join e_class c on e.examid=c.examid
472 541
         left join t_class_teacher ct on c.classid=ct.classid
473
-        where e.examstate=3 and e.deleted=1 and ct.teacherid=#{params.userid} and c.schoolid=#{params.schoolid}
474
-        group by e.examid order by e.examdate desc limit 1
542
+        where e.deleted=1 and c.schoolid=#{params.schoolid} and ct.teacherid=#{params.userid}
543
+        group by e.examid order by e.examdate desc,e.examid desc,c.ecid limit 1
475 544
     </select>
476 545
     <!--考试-班级报告-学科成绩对比-->
477 546
     <select id="listExamReportClassScore" resultType="java.util.Map">
@@ -487,14 +556,14 @@
487 556
     </select>
488 557
     <!--考试-单科报告-单科考试信息-->
489 558
     <select id="getExamReportSingleInfo" resultType="com.xhkjedu.sapi.vo.component.ExamInfoVo">
490
-        select e.examid,e.teashowrank,e.stushowrank,s.subjectid,c.classid from e_base e
559
+        select e.examid,e.teashowrank,e.stushowrank,e.examstate,s.subjectid,c.classid from e_base e
491 560
         left join e_subject s on e.examid=s.examid
492 561
         left join t_teacher_powersb tp on tp.teacherid=#{params.userid} and tp.subjectid=s.subjectid
493 562
         left join e_class c on e.examid=c.examid
494 563
         left join t_class_teacher ct on c.classid=ct.classid and tp.teacherid=ct.teacherid
495
-        where e.examstate=3 and e.deleted=1 and ct.teacherid=#{params.userid}
496
-        and c.schoolid=#{params.schoolid}
497
-        group by e.examid order by e.examdate desc,e.examid desc limit 1
564
+        where e.deleted=1 and c.schoolid=#{params.schoolid} and ct.teacherid=#{params.userid}
565
+
566
+        group by e.examid order by e.examdate desc,e.examid desc,c.ecid limit 1
498 567
     </select>
499 568
     <!--考试-单科报告-单科概况-->
500 569
     <select id="getExamReportSingleBase" resultType="java.util.Map">

+ 10
- 0
sapi/src/main/resources/mapper/system/ModuleMapper.xml Näytä tiedosto

@@ -119,4 +119,14 @@
119 119
         update t_module set belongcode=#{module.belongcode},minout=#{module.minout},moduleurl=#{module.moduleurl},
120 120
         mabbrevname=#{module.mabbrevname},comm=#{module.comm},defaultbcode=#{module.belongcode} where defaultid=#{module.moduleid}
121 121
     </update>
122
+    <!--区域更改终端类型时,更改角色模块对应类型-->
123
+    <update id="updateBatchBelongcode">
124
+        update t_role_module rm,t_module m set rm.belongcode=#{module.belongcode}
125
+        where rm.moduleid=m.moduleid and m.defaultid=#{module.moduleid}
126
+    </update>
127
+
128
+    <!--学校修改终端类型时,更改对应模块角色终端类型-->
129
+    <update id="updateBelongcodeByModuleid">
130
+        update t_role_module set belongcode=#{module.belongcode} where moduleid=#{module.moduleid}
131
+    </update>
122 132
 </mapper>

+ 18
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java Näytä tiedosto

@@ -826,6 +826,24 @@ public class EPaperQtypeService {
826 826
                 List<Integer> eptqids = changelist.stream().map(EPaperQtypeQuestion::getEptqid).collect(Collectors.toList());
827 827
                 ePaperStudentQuestionMapper.updateBatchStuQuesNeeddeal(epid,eptqids);//批量设置学生提交试题为需要批改试题
828 828
             }
829
+
830
+            //判断答案中是否包含附件
831
+            List<EPaperFile> pfiles = ePaper.getPfiles();
832
+            if(N_Utils.isListNotEmpty(pfiles)){
833
+                //说明上传答案附件,先清空
834
+                ePaperFileMapper.delAnswerFile(epid);
835
+                Integer timestamp = N_Utils.getSecondTimestamp();
836
+                for(int i=0;i<pfiles.size(); i++){
837
+                    EPaperFile pfile = pfiles.get(i);
838
+                    pfile.setEpid(epid);
839
+                    pfile.setFileorder(i+1);
840
+                    pfile.setFileclass(2);
841
+                    pfile.setCreateid(ePaper.getHandleid());
842
+                    pfile.setCreatetime(timestamp);
843
+                }
844
+                ePaperFileMapper.insertList(pfiles);
845
+            }
846
+
829 847
         }catch (Exception e){
830 848
             log.error("保存试卷答案失败:"+e.getMessage());
831 849
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

Loading…
Peruuta
Tallenna