Переглянути джерело

作业补交

tags/正式3.13.6
雍文秀 8 місяці тому
джерело
коміт
9ceda7e489
19 змінених файлів з 219 додано та 100 видалено
  1. 8
    0
      scommons/src/main/java/com/xhkjedu/constant/PlatformConstant.java
  2. 16
    4
      sstudy/src/main/java/com/xhkjedu/sstudy/controller/paper/PaperController.java
  3. 10
    34
      sstudy/src/main/java/com/xhkjedu/sstudy/controller/paperstudent/PaperStudentController.java
  4. 11
    14
      sstudy/src/main/java/com/xhkjedu/sstudy/controller/paperstudent/PaperStudentWebController.java
  5. 3
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperMapper.java
  6. 12
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paperstudent/PaperStudentMapper.java
  7. 3
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/model/paper/TPaper.java
  8. 4
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/model/paperstudent/TPaperStudent.java
  9. 14
    8
      sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java
  10. 48
    21
      sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentService.java
  11. 13
    9
      sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentWebService.java
  12. 13
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/task/PaperStudentTask.java
  13. 14
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/utils/StudyUtil.java
  14. 5
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PaperListVo.java
  15. 3
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PaperTeacherAppVo.java
  16. 2
    0
      sstudy/src/main/java/com/xhkjedu/sstudy/vo/paperstudent/PaperGroupParam.java
  17. 23
    7
      sstudy/src/main/resources/mapper/paper/PaperMapper.xml
  18. 4
    3
      sstudy/src/main/resources/mapper/paper/PaperTeaAppMapper.xml
  19. 13
    0
      sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml

+ 8
- 0
scommons/src/main/java/com/xhkjedu/constant/PlatformConstant.java Переглянути файл

1
 package com.xhkjedu.constant;
1
 package com.xhkjedu.constant;
2
 
2
 
3
+import com.xhkjedu.vo.ResultVo;
4
+
3
 /*
5
 /*
4
  * @Description:项目常量
6
  * @Description:项目常量
5
  * @Author: WN
7
  * @Author: WN
25
     //请求头内容——版本号
27
     //请求头内容——版本号
26
     public static final String XH_VERSION = "Xh-Version";
28
     public static final String XH_VERSION = "Xh-Version";
27
 
29
 
30
+    public static final ResultVo AFTER_COMMIT = new ResultVo(3, "作业已过截止时间!");
31
+
32
+    public static final ResultVo PAPER_COMMIT = new ResultVo(3, "作业已提交!");
33
+
34
+    public static final ResultVo COMMIT_SUCCESS = new ResultVo(0, "提交成功!");
35
+
28
 }
36
 }

+ 16
- 4
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paper/PaperController.java Переглянути файл

213
     //作业列表
213
     //作业列表
214
     @PostMapping("/list")
214
     @PostMapping("/list")
215
     public ResultVo list(@RequestBody PaperSearchVo paper) {
215
     public ResultVo list(@RequestBody PaperSearchVo paper) {
216
-        String lsbid = paper.getLsbid();
217
         Integer createid = paper.getCreateid();
216
         Integer createid = paper.getCreateid();
218
         Integer page = paper.getPage();
217
         Integer page = paper.getPage();
219
         Integer pageSize = paper.getPageSize();
218
         Integer pageSize = paper.getPageSize();
220
-        N_Utils.validation(new Object[]{lsbid,"教材关联关系id",2,createid,"教师id",1,page,"显示页码",1,pageSize,"显示条数",1});
219
+        N_Utils.validation(new Object[]{createid,"教师id",1,page,"显示页码",1,pageSize,"显示条数",1});
221
         UserVo userVo = userMapper.getUserInfoForHandleLog(createid);
220
         UserVo userVo = userMapper.getUserInfoForHandleLog(createid);
222
         if (userVo != null && !userVo.getUsertype().equals(0)) {
221
         if (userVo != null && !userVo.getUsertype().equals(0)) {
223
             //获取当前教师权限班级
222
             //获取当前教师权限班级
234
 
233
 
235
     @PostMapping("/list_my")
234
     @PostMapping("/list_my")
236
     public ResultVo listMy(@RequestBody PaperSearchVo paper) {
235
     public ResultVo listMy(@RequestBody PaperSearchVo paper) {
237
-        String lsbid = paper.getLsbid();
238
         Integer createid = paper.getCreateid();
236
         Integer createid = paper.getCreateid();
239
         Integer page = paper.getPage();
237
         Integer page = paper.getPage();
240
         Integer pageSize = paper.getPageSize();
238
         Integer pageSize = paper.getPageSize();
241
-        N_Utils.validation(new Object[]{lsbid,"教材关联关系id",2,createid,"教师id",1,page,"显示页码",1,pageSize,"显示条数",1});
239
+        N_Utils.validation(new Object[]{createid,"教师id",1,page,"显示页码",1,pageSize,"显示条数",1});
242
         UserVo userVo = userMapper.getUserInfoForHandleLog(createid);
240
         UserVo userVo = userMapper.getUserInfoForHandleLog(createid);
243
         // if (userVo != null && !userVo.getUsertype().equals(0)) {
241
         // if (userVo != null && !userVo.getUsertype().equals(0)) {
244
         //     //获取当前教师权限班级
242
         //     //获取当前教师权限班级
385
         return new ResultVo(0, "成功获取作业教师和学生", rtnMap);
383
         return new ResultVo(0, "成功获取作业教师和学生", rtnMap);
386
     }
384
     }
387
 
385
 
386
+    /**
387
+     * @Description 修改补交状态
388
+     * @Date 2024/4/1 12:45
389
+     * @Author YWX
390
+     * @Param [paper]
391
+     * @Return com.xhkjedu.vo.ResultVo
392
+     **/
393
+    @PostMapping("/update_ac")
394
+    public ResultVo updateAfterCommit(@RequestBody TPaper paper) {
395
+        N_Utils.validation(new Object[]{paper.getPaperid(), "作业id", 1});
396
+        paperService.updateAfterCommit(paper);
397
+        return new ResultVo(0, "修改成功!");
398
+    }
399
+
388
 }
400
 }

+ 10
- 34
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paperstudent/PaperStudentController.java Переглянути файл

13
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentVo;
13
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentVo;
14
 import com.xhkjedu.utils.N_Utils;
14
 import com.xhkjedu.utils.N_Utils;
15
 import com.xhkjedu.vo.ResultVo;
15
 import com.xhkjedu.vo.ResultVo;
16
-import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.web.bind.annotation.*;
16
 import org.springframework.web.bind.annotation.*;
18
 
17
 
18
+import javax.annotation.Resource;
19
 import java.util.List;
19
 import java.util.List;
20
 import java.util.Map;
20
 import java.util.Map;
21
 
21
 
28
 @RestController
28
 @RestController
29
 @RequestMapping("/ps")
29
 @RequestMapping("/ps")
30
 public class PaperStudentController {
30
 public class PaperStudentController {
31
-    @Autowired
31
+    @Resource
32
     private PaperStudentService paperStudentService;
32
     private PaperStudentService paperStudentService;
33
 
33
 
34
     /**
34
     /**
56
     public ResultVo startPaper(@RequestBody TPaperStudent paperStudent) {
56
     public ResultVo startPaper(@RequestBody TPaperStudent paperStudent) {
57
         Integer psid = paperStudent.getPsid();
57
         Integer psid = paperStudent.getPsid();
58
         N_Utils.validation(new Object[]{psid,"试卷学生id",1});
58
         N_Utils.validation(new Object[]{psid,"试卷学生id",1});
59
+        ResultVo vo = paperStudentService.checkPsStateByPsId(psid);
60
+        if (vo != null) return vo;
59
         List<PaperStudentQuestionVo> paperQuestionBeans = paperStudentService.startPaper(psid);
61
         List<PaperStudentQuestionVo> paperQuestionBeans = paperStudentService.startPaper(psid);
60
         return new ResultVo(0,"开始成功!",paperQuestionBeans);
62
         return new ResultVo(0,"开始成功!",paperQuestionBeans);
61
     }
63
     }
101
     @PostMapping("/submit_question")
103
     @PostMapping("/submit_question")
102
     public ResultVo submitQuestion(@RequestBody TPaperStudentQuestion psq) {
104
     public ResultVo submitQuestion(@RequestBody TPaperStudentQuestion psq) {
103
         N_Utils.validation(new Object[]{psq.getPsqid(),"试卷学生试题id",1});
105
         N_Utils.validation(new Object[]{psq.getPsqid(),"试卷学生试题id",1});
104
-        int result = 0;
105
-        try {
106
-            result = paperStudentService.submitQuestion(psq);
107
-        } catch (Exception e) {
108
-            new ResultVo(1, "提交失败!");
109
-        }
110
-        if (result >= 0) return new ResultVo(0, "提交成功!");
111
-        else return new ResultVo(1, "提交失败!");
106
+        return paperStudentService.submitQuestion(psq);
112
     }
107
     }
113
 
108
 
114
     /**
109
     /**
120
     @Action("作业管理-提交题库作业")
115
     @Action("作业管理-提交题库作业")
121
     public ResultVo submitPaper(@RequestBody TPaperStudent ps) {
116
     public ResultVo submitPaper(@RequestBody TPaperStudent ps) {
122
         N_Utils.validation(new Object[]{ps.getPsid(),"试卷学生id",1});
117
         N_Utils.validation(new Object[]{ps.getPsid(),"试卷学生id",1});
123
-        int result = 0;
124
-        try {
125
-            result = paperStudentService.submitPaper(ps.getPsid());
126
-        } catch (Exception e) {
127
-            return new ResultVo(1, "提交失败!");
128
-        }
129
-        if (result >= 0) return new ResultVo(0, "提交成功!");
130
-        else return new ResultVo(1, "提交失败!");
118
+        return paperStudentService.submitPaper(ps.getPsid());
131
     }
119
     }
132
 
120
 
133
     /**
121
     /**
262
     public ResultVo scantronStartPaper(@RequestBody TPaperStudent paperStudent) {
250
     public ResultVo scantronStartPaper(@RequestBody TPaperStudent paperStudent) {
263
         Integer psid = paperStudent.getPsid();
251
         Integer psid = paperStudent.getPsid();
264
         N_Utils.validation(new Object[]{psid,"试卷学生id",1});
252
         N_Utils.validation(new Object[]{psid,"试卷学生id",1});
253
+        ResultVo vo = paperStudentService.checkPsStateByPsId(psid);
254
+        if (vo != null) return vo;
265
         List<Map> psscanlst = paperStudentService.scantronStartPaper(psid);
255
         List<Map> psscanlst = paperStudentService.scantronStartPaper(psid);
266
         return new ResultVo(0,"开始成功!",psscanlst);
256
         return new ResultVo(0,"开始成功!",psscanlst);
267
     }
257
     }
300
     @PostMapping("/ssubmit_question")
290
     @PostMapping("/ssubmit_question")
301
     public ResultVo scantronSubmitQuestion(@RequestBody TPaperStudentScantron pss) {
291
     public ResultVo scantronSubmitQuestion(@RequestBody TPaperStudentScantron pss) {
302
         N_Utils.validation(new Object[]{pss.getPssid(),"试卷学生试题id",1});
292
         N_Utils.validation(new Object[]{pss.getPssid(),"试卷学生试题id",1});
303
-        int result = 0;
304
-        try {
305
-            result = paperStudentService.scantronSubmitQuestion(pss);
306
-        } catch (Exception e) {
307
-            return new ResultVo(1, "提交失败!");
308
-        }
309
-        if (result >= 0) return new ResultVo(0, "提交成功!");
310
-        else return new ResultVo(1, "提交失败!");
293
+        return paperStudentService.scantronSubmitQuestion(pss);
311
     }
294
     }
312
     /**
295
     /**
313
      *功能描述 图片作业--提交作业
296
      *功能描述 图片作业--提交作业
318
     @Action("作业管理-提交附件作业")
301
     @Action("作业管理-提交附件作业")
319
     public ResultVo scantronSubmitPaper(@RequestBody TPaperStudent ps) {
302
     public ResultVo scantronSubmitPaper(@RequestBody TPaperStudent ps) {
320
         N_Utils.validation(new Object[]{ps.getPsid(),"试卷学生id",1});
303
         N_Utils.validation(new Object[]{ps.getPsid(),"试卷学生id",1});
321
-        int result = 0;
322
-        try {
323
-            result = paperStudentService.scantronSubmitPaper(ps.getPsid());
324
-        } catch (Exception e) {
325
-            return new ResultVo(1, "提交失败!");
326
-        }
327
-        if (result >= 0) return new ResultVo(0, "提交成功!");
328
-        else return new ResultVo(1, "提交失败!");
304
+        return paperStudentService.scantronSubmitPaper(ps.getPsid());
329
     }
305
     }
330
 
306
 
331
     /**
307
     /**

+ 11
- 14
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paperstudent/PaperStudentWebController.java Переглянути файл

5
 import com.xhkjedu.sstudy.model.paperstudent.TPaperStudent;
5
 import com.xhkjedu.sstudy.model.paperstudent.TPaperStudent;
6
 import com.xhkjedu.sstudy.model.paperstudent.TPaperStudentQuestion;
6
 import com.xhkjedu.sstudy.model.paperstudent.TPaperStudentQuestion;
7
 import com.xhkjedu.sstudy.model.paperstudent.TPaperStudentScantron;
7
 import com.xhkjedu.sstudy.model.paperstudent.TPaperStudentScantron;
8
+import com.xhkjedu.sstudy.service.paperstudent.PaperStudentService;
8
 import com.xhkjedu.sstudy.service.paperstudent.PaperStudentWebService;
9
 import com.xhkjedu.sstudy.service.paperstudent.PaperStudentWebService;
9
 import com.xhkjedu.utils.N_Utils;
10
 import com.xhkjedu.utils.N_Utils;
10
 import com.xhkjedu.utils.PageUtil;
11
 import com.xhkjedu.utils.PageUtil;
14
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentVo;
15
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentVo;
15
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentWebVo;
16
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentWebVo;
16
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo;
17
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo;
17
-import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.web.bind.annotation.PostMapping;
18
 import org.springframework.web.bind.annotation.PostMapping;
19
 import org.springframework.web.bind.annotation.RequestBody;
19
 import org.springframework.web.bind.annotation.RequestBody;
20
 import org.springframework.web.bind.annotation.RequestMapping;
20
 import org.springframework.web.bind.annotation.RequestMapping;
21
 import org.springframework.web.bind.annotation.RestController;
21
 import org.springframework.web.bind.annotation.RestController;
22
 
22
 
23
+import javax.annotation.Resource;
23
 import java.util.List;
24
 import java.util.List;
24
 
25
 
25
 /**
26
 /**
31
 @RestController
32
 @RestController
32
 @RequestMapping("/psw")
33
 @RequestMapping("/psw")
33
 public class PaperStudentWebController {
34
 public class PaperStudentWebController {
34
-    @Autowired
35
+    @Resource
35
     private PaperStudentWebService paperStudentWebService;
36
     private PaperStudentWebService paperStudentWebService;
37
+    @Resource
38
+    private PaperStudentService paperStudentService;
36
 
39
 
37
     /**
40
     /**
38
      * 学生作业列表
41
      * 学生作业列表
64
     public ResultVo startPaper(@RequestBody TPaperStudent paperStudent) {
67
     public ResultVo startPaper(@RequestBody TPaperStudent paperStudent) {
65
         Integer psid = paperStudent.getPsid();
68
         Integer psid = paperStudent.getPsid();
66
         N_Utils.validation(new Object[]{psid,"试卷学生id",1});
69
         N_Utils.validation(new Object[]{psid,"试卷学生id",1});
70
+        ResultVo vo = paperStudentService.checkPsStateByPsId(psid);
71
+        if (vo != null) return vo;
67
         StudentPaperVo paper = paperStudentWebService.startPaper(psid);
72
         StudentPaperVo paper = paperStudentWebService.startPaper(psid);
68
         return new ResultVo(0,"开始成功!",paper);
73
         return new ResultVo(0,"开始成功!",paper);
69
     }
74
     }
79
     public ResultVo scantronStartPaper(@RequestBody TPaperStudent paperStudent) {
84
     public ResultVo scantronStartPaper(@RequestBody TPaperStudent paperStudent) {
80
         Integer psid = paperStudent.getPsid();
85
         Integer psid = paperStudent.getPsid();
81
         N_Utils.validation(new Object[]{psid,"试卷学生id",1});
86
         N_Utils.validation(new Object[]{psid,"试卷学生id",1});
87
+        ResultVo vo = paperStudentService.checkPsStateByPsId(psid);
88
+        if (vo != null) return vo;
82
         StudentPaperVo paper = paperStudentWebService.scantronStartPaper(psid);
89
         StudentPaperVo paper = paperStudentWebService.scantronStartPaper(psid);
83
         return new ResultVo(0,"开始成功!",paper);
90
         return new ResultVo(0,"开始成功!",paper);
84
     }
91
     }
96
         if (N_Utils.isListEmpty(psqs)){
103
         if (N_Utils.isListEmpty(psqs)){
97
             return new ResultVo(1, "作答详情不能为空");
104
             return new ResultVo(1, "作答详情不能为空");
98
         }
105
         }
99
-        try {
100
-            paperStudentWebService.submitPaper(paper);
101
-            return new ResultVo(0, "提交成功!");
102
-        } catch (Exception e) {
103
-            return new ResultVo(1, "提交失败!");
104
-        }
106
+        return paperStudentWebService.submitPaper(paper);
105
     }
107
     }
106
 
108
 
107
     @PostMapping("/ssubmit_paper")
109
     @PostMapping("/ssubmit_paper")
110
         if (N_Utils.isListEmpty(pss)){
112
         if (N_Utils.isListEmpty(pss)){
111
             return new ResultVo(1, "作答详情不能为空");
113
             return new ResultVo(1, "作答详情不能为空");
112
         }
114
         }
113
-        try {
114
-            paperStudentWebService.scantronSubmitPaper(paper);
115
-            return new ResultVo(0, "提交成功!");
116
-        } catch (Exception e) {
117
-            return new ResultVo(1, "提交失败!");
118
-        }
115
+        return paperStudentWebService.scantronSubmitPaper(paper);
119
     }
116
     }
120
 
117
 
121
     //学生作业详情——答题卡作业
118
     //学生作业详情——答题卡作业

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperMapper.java Переглянути файл

176
 
176
 
177
     //获取所有作业,处理学生试题关联关系
177
     //获取所有作业,处理学生试题关联关系
178
     List<TPaper> listPapersForAllFb();
178
     List<TPaper> listPapersForAllFb();
179
+
180
+    //修改补交状态
181
+    void updateAfterCommit(@Param("paper") TPaper paper);
179
 }
182
 }

+ 12
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paperstudent/PaperStudentMapper.java Переглянути файл

147
      */
147
      */
148
     void updateShowanswer(@Param("stoptime") int stoptime);
148
     void updateShowanswer(@Param("stoptime") int stoptime);
149
 
149
 
150
+    /**
151
+     * @Description 作业自动收卷
152
+     * @Date 2024/4/1 14:38
153
+     * @Author YWX
154
+     * @Param [stoptime]
155
+     * @Return void
156
+     **/
157
+    void updatePaperRollUp(@Param("stoptime") int stoptime);
158
+
150
 
159
 
151
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
160
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
152
     //获取作业列表
161
     //获取作业列表
224
 
233
 
225
     //批阅学生列表
234
     //批阅学生列表
226
     List<Map> listCorrectStu(@Param("ps") TPaperStudent ps);
235
     List<Map> listCorrectStu(@Param("ps") TPaperStudent ps);
236
+
237
+    //根据学生作业id获取提交状态
238
+    Integer getPsStateByPsId(@Param("psid") Integer psid);
227
 }
239
 }

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/model/paper/TPaper.java Переглянути файл

73
     //时间类型:1统一布置2分班布置
73
     //时间类型:1统一布置2分班布置
74
     private Integer timetype;
74
     private Integer timetype;
75
 
75
 
76
+    //补交:0不允许 1允许
77
+    private Integer aftercommit;
78
+
76
     //作业附件:0没有1有
79
     //作业附件:0没有1有
77
     private Integer hasfile;
80
     private Integer hasfile;
78
 
81
 

+ 4
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/model/paperstudent/TPaperStudent.java Переглянути файл

88
     //退回原因
88
     //退回原因
89
     private String comm;
89
     private String comm;
90
 
90
 
91
+    @Transient
92
+    //补交:0不允许 1允许
93
+    private Integer aftercommit;
94
+
91
 }
95
 }

+ 14
- 8
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java Переглянути файл

3
 import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSON;
4
 import com.xhkjedu.constant.PlatformConstant;
4
 import com.xhkjedu.constant.PlatformConstant;
5
 import com.xhkjedu.exception.MissingParametersException;
5
 import com.xhkjedu.exception.MissingParametersException;
6
-import com.xhkjedu.sstudy.listener.MessageSender;
7
 import com.xhkjedu.sstudy.mapper.gradeclass.ClassMapper;
6
 import com.xhkjedu.sstudy.mapper.gradeclass.ClassMapper;
8
 import com.xhkjedu.sstudy.mapper.paper.*;
7
 import com.xhkjedu.sstudy.mapper.paper.*;
9
 import com.xhkjedu.sstudy.mapper.paperstudent.PaperClassMapper;
8
 import com.xhkjedu.sstudy.mapper.paperstudent.PaperClassMapper;
22
 import com.xhkjedu.vo.ResultVo;
21
 import com.xhkjedu.vo.ResultVo;
23
 import com.xhkjedu.vo.system.UserVo;
22
 import com.xhkjedu.vo.system.UserVo;
24
 import lombok.extern.slf4j.Slf4j;
23
 import lombok.extern.slf4j.Slf4j;
25
-import org.springframework.beans.factory.annotation.Autowired;
26
 import org.springframework.stereotype.Service;
24
 import org.springframework.stereotype.Service;
27
 import org.springframework.transaction.annotation.Transactional;
25
 import org.springframework.transaction.annotation.Transactional;
28
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
26
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
41
 @Slf4j
39
 @Slf4j
42
 @Service
40
 @Service
43
 public class PaperService {
41
 public class PaperService {
44
-    @Autowired
42
+    @Resource
45
     private PaperMapper paperMapper;
43
     private PaperMapper paperMapper;
46
-    @Autowired
44
+    @Resource
47
     private PaperFileService paperFileService;
45
     private PaperFileService paperFileService;
48
-    @Autowired
46
+    @Resource
49
     private PaperScantronQtypeMapper paperScantronQtypeMapper;
47
     private PaperScantronQtypeMapper paperScantronQtypeMapper;
50
-    @Autowired
48
+    @Resource
51
     private PaperScantronMapper paperScantronMapper;
49
     private PaperScantronMapper paperScantronMapper;
52
     @Resource
50
     @Resource
53
     private PaperQtypeMapper paperQtypeMapper;
51
     private PaperQtypeMapper paperQtypeMapper;
57
     private PaperAnalyzeMapper paperAnalyzeMapper;
55
     private PaperAnalyzeMapper paperAnalyzeMapper;
58
     @Resource
56
     @Resource
59
     private PaperStudentMapper paperStudentMapper;
57
     private PaperStudentMapper paperStudentMapper;
60
-    @Autowired
61
-    private MessageSender messageSender;
62
     @Resource
58
     @Resource
63
     private ClassMapper classMapper;
59
     private ClassMapper classMapper;
64
     @Resource
60
     @Resource
1452
         return rtnMap;
1448
         return rtnMap;
1453
     }
1449
     }
1454
 
1450
 
1451
+    /**
1452
+     * @Description 修改补交状态
1453
+     * @Date 2024/4/1 12:45
1454
+     * @Author YWX
1455
+     * @Param [paper]
1456
+     * @Return void
1457
+     **/
1458
+    public void updateAfterCommit(TPaper paper) {
1459
+        paperMapper.updateAfterCommit(paper);
1460
+    }
1455
 }
1461
 }

+ 48
- 21
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentService.java Переглянути файл

1
 package com.xhkjedu.sstudy.service.paperstudent;
1
 package com.xhkjedu.sstudy.service.paperstudent;
2
 
2
 
3
 import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSON;
4
+import com.xhkjedu.constant.PlatformConstant;
5
+import com.xhkjedu.exception.MissingParametersException;
4
 import com.xhkjedu.sstudy.mapper.paper.PaperMapper;
6
 import com.xhkjedu.sstudy.mapper.paper.PaperMapper;
5
 import com.xhkjedu.sstudy.mapper.paper.PaperScantronMapper;
7
 import com.xhkjedu.sstudy.mapper.paper.PaperScantronMapper;
6
 import com.xhkjedu.sstudy.mapper.paperstudent.*;
8
 import com.xhkjedu.sstudy.mapper.paperstudent.*;
10
 import com.xhkjedu.sstudy.model.paperstudent.*;
12
 import com.xhkjedu.sstudy.model.paperstudent.*;
11
 import com.xhkjedu.sstudy.model.question.TQuestion;
13
 import com.xhkjedu.sstudy.model.question.TQuestion;
12
 import com.xhkjedu.sstudy.service.system.NoticeService;
14
 import com.xhkjedu.sstudy.service.system.NoticeService;
13
-import com.xhkjedu.sstudy.utils.ArithUtil;
14
-import com.xhkjedu.sstudy.utils.ConvertUtil;
15
+import com.xhkjedu.sstudy.utils.*;
15
 import com.xhkjedu.sstudy.vo.paperreport.PaperRQuestionVo;
16
 import com.xhkjedu.sstudy.vo.paperreport.PaperRQuestionVo;
16
 import com.xhkjedu.sstudy.vo.paperstudent.*;
17
 import com.xhkjedu.sstudy.vo.paperstudent.*;
17
 import com.xhkjedu.utils.N_Utils;
18
 import com.xhkjedu.utils.N_Utils;
187
         return paperStudentMapper.updateState(psstate, pschecked, psid, operate,timestamp);
188
         return paperStudentMapper.updateState(psstate, pschecked, psid, operate,timestamp);
188
     }
189
     }
189
 
190
 
190
-    public int submitQuestion(TPaperStudentQuestion psq) throws Exception {
191
+    public ResultVo submitQuestion(TPaperStudentQuestion psq) {
191
         try {
192
         try {
192
             //获取作业学生试题详情
193
             //获取作业学生试题详情
193
             TPaperStudentQuestion psq1 = paperStudentQuestionService.findById(psq.getPsqid());
194
             TPaperStudentQuestion psq1 = paperStudentQuestionService.findById(psq.getPsqid());
194
-            //获取试题详情
195
+            if (psq1 == null) throw new Exception("该学生作业不存在");
196
+            ResultVo vo = checkPsStateByPsId(psq1.getPsid());//根据学生作业id校验提交状态
197
+            if (vo != null) return vo;
198
+//获取试题详情
195
             TQuestion questionBean = questionMapper.selectByPrimaryKey(psq1.getQuestionid());
199
             TQuestion questionBean = questionMapper.selectByPrimaryKey(psq1.getQuestionid());
196
             psq.setChecked(0);
200
             psq.setChecked(0);
197
             psq.setAnswertime(N_Utils.getSecondTimestamp());
201
             psq.setAnswertime(N_Utils.getSecondTimestamp());
305
             if (costtime == null) costtime = 0;
309
             if (costtime == null) costtime = 0;
306
             psq.setCosttime(psq.getCosttime() + costtime);
310
             psq.setCosttime(psq.getCosttime() + costtime);
307
             psq.setConverted(converted);
311
             psq.setConverted(converted);
308
-            return paperStudentQuestionService.update(psq);
312
+            paperStudentQuestionService.update(psq);
309
 //            return updateStuScore(psq1.getPsid());//自动批改单题提交时修改学生总得分
313
 //            return updateStuScore(psq1.getPsid());//自动批改单题提交时修改学生总得分
310
         } catch (Exception e) {
314
         } catch (Exception e) {
311
             log.error("提交试题失败:"+e.getMessage());
315
             log.error("提交试题失败:"+e.getMessage());
312
-            throw new Exception("提交试题失败");
316
+            return new ResultVo(1, "提交失败!");
313
         }
317
         }
318
+        return new ResultVo(0, "提交成功!");
314
     }
319
     }
315
 
320
 
316
     /**
321
     /**
331
      * @Date 2020/6/11 10:44
336
      * @Date 2020/6/11 10:44
332
      * @return int
337
      * @return int
333
      **/
338
      **/
334
-    public int submitPaper(Integer psid) throws Exception {
339
+    public ResultVo submitPaper(Integer psid) {
335
         try {
340
         try {
336
             TPaperStudent ps = findById(psid);
341
             TPaperStudent ps = findById(psid);
337
             //如果学生作业不存在或是已提交,直接返回1提交成功
342
             //如果学生作业不存在或是已提交,直接返回1提交成功
338
-            Integer psstate = ps.getPsstate();
339
-            if (ps == null || (psstate != 0 && psstate != 3)) return 1;
343
+            ResultVo vo = StudyUtil.checkPsState(ps);//校验学生作业提交状态
344
+            if (vo != null) return vo;
340
             Integer paperid = ps.getPaperid();
345
             Integer paperid = ps.getPaperid();
341
             Integer classid = ps.getClassid();
346
             Integer classid = ps.getClassid();
342
             TPaperStudent paperStudentBean = new TPaperStudent();
347
             TPaperStudent paperStudentBean = new TPaperStudent();
369
                 }
374
                 }
370
             }
375
             }
371
 
376
 
372
-            return result;
373
         } catch (Exception e) {
377
         } catch (Exception e) {
374
             log.error("提交作业失败:"+e.getMessage());
378
             log.error("提交作业失败:"+e.getMessage());
375
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
379
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
376
-            throw new RuntimeException("提交失败");
380
+            return new ResultVo(1, "提交失败!");
377
         }
381
         }
382
+        return new ResultVo(0, "提交成功!");
383
+    }
384
+
385
+    //根据学生作业id校验提交状态
386
+    public ResultVo checkPsStateByPsId(Integer psid) {
387
+        Integer psstate = paperStudentMapper.getPsStateByPsId(psid);
388
+        if (psstate == null || psstate.equals(1) || psstate.equals(2)) return PlatformConstant.PAPER_COMMIT;
389
+        if (psstate.equals(4)) return PlatformConstant.AFTER_COMMIT;
390
+        return null;
378
     }
391
     }
379
 
392
 
380
     /**
393
     /**
571
      * @param  * @param pss
584
      * @param  * @param pss
572
      * @return int
585
      * @return int
573
      */
586
      */
574
-    public int scantronSubmitQuestion(TPaperStudentScantron pss) throws Exception {
587
+    public ResultVo scantronSubmitQuestion(TPaperStudentScantron pss) {
575
         try {
588
         try {
576
             //学生作业试题
589
             //学生作业试题
577
             TPaperStudentScantron pss1 = paperStudentScantronService.getObjById(pss.getPssid());
590
             TPaperStudentScantron pss1 = paperStudentScantronService.getObjById(pss.getPssid());
578
             if (pss1 == null) throw new Exception("该学生作业不存在");
591
             if (pss1 == null) throw new Exception("该学生作业不存在");
592
+            ResultVo vo = checkPsStateByPsId(pss1.getPsid());//根据学生作业id校验提交状态
593
+            if (vo != null) return vo;
579
             //获取原试题情况
594
             //获取原试题情况
580
             TPaperScantron scantronBean = paperScantronMapper.findById(pss1.getPscaid());
595
             TPaperScantron scantronBean = paperScantronMapper.findById(pss1.getPscaid());
581
             pss.setChecked(0);
596
             pss.setChecked(0);
691
             if (costtime == null) costtime = 0;
706
             if (costtime == null) costtime = 0;
692
             pss.setCosttime(pss.getCosttime() + costtime);
707
             pss.setCosttime(pss.getCosttime() + costtime);
693
             pss.setConverted(converted);
708
             pss.setConverted(converted);
694
-            return paperStudentScantronService.updateStudentScantron(pss);
709
+            paperStudentScantronService.updateStudentScantron(pss);
695
 //            updateScantronStuScore(pss1.getPsid());//自动批改单题提交时修改学生总得分
710
 //            updateScantronStuScore(pss1.getPsid());//自动批改单题提交时修改学生总得分
696
         } catch (Exception e) {
711
         } catch (Exception e) {
697
             log.error("图片作业提交单题失败:"+e.getMessage());
712
             log.error("图片作业提交单题失败:"+e.getMessage());
698
-            throw new Exception("提交失败");
713
+            return new ResultVo(1, "提交失败!");
699
         }
714
         }
715
+        return new ResultVo(0, "提交成功!");
700
     }
716
     }
701
 
717
 
702
     /**
718
     /**
706
      * @param  * @param psid
722
      * @param  * @param psid
707
      * @return int
723
      * @return int
708
      */
724
      */
709
-    public int scantronSubmitPaper(Integer psid) throws Exception {
725
+    public ResultVo scantronSubmitPaper(Integer psid) {
710
         try {
726
         try {
711
             TPaperStudent ps = findById(psid);
727
             TPaperStudent ps = findById(psid);
712
-            //如果学生作业不存在或是已提交,直接返回1提交成功
713
-            Integer psstate = ps.getPsstate();
714
-            if (ps == null || (psstate != 0 && psstate != 3)) return 1;
728
+            ResultVo vo = StudyUtil.checkPsState(ps);//校验学生作业提交状态
729
+            if (vo != null) return vo;
715
             Integer paperid = ps.getPaperid();
730
             Integer paperid = ps.getPaperid();
716
             Integer classid = ps.getClassid();
731
             Integer classid = ps.getClassid();
717
             TPaperStudent paperStudentBean = new TPaperStudent();
732
             TPaperStudent paperStudentBean = new TPaperStudent();
730
                 showanswer = 1;
745
                 showanswer = 1;
731
             }
746
             }
732
             paperStudentBean.setShowanswer(showanswer);
747
             paperStudentBean.setShowanswer(showanswer);
733
-            Integer result = updateSPaper(psid, paperStudentBean, pg);
748
+            updateSPaper(psid, paperStudentBean, pg);
734
             //获取未合并的学生答案
749
             //获取未合并的学生答案
735
             List<TPaperStudentScantron> list = paperStudentScantronService.listNoMergeUserAnswer(psid);
750
             List<TPaperStudentScantron> list = paperStudentScantronService.listNoMergeUserAnswer(psid);
736
             if (N_Utils.isListNotEmpty(list)) {
751
             if (N_Utils.isListNotEmpty(list)) {
741
                     }
756
                     }
742
                 }
757
                 }
743
             }
758
             }
744
-            return result;
745
         } catch (Exception e) {
759
         } catch (Exception e) {
746
             log.error("图片作业提交作业失败:"+e.getMessage());
760
             log.error("图片作业提交作业失败:"+e.getMessage());
747
-            throw new Exception("提交失败");
761
+            return new ResultVo(1, "提交失败!");
748
         }
762
         }
763
+        return new ResultVo(0, "提交成功!");
749
     }
764
     }
750
 
765
 
751
     /**
766
     /**
864
         paperStudentMapper.updateShowanswer(timestamp);
879
         paperStudentMapper.updateShowanswer(timestamp);
865
     }
880
     }
866
 
881
 
882
+    /**
883
+     * @Description 作业自动收卷
884
+     * @Date 2024/4/1 14:39
885
+     * @Author YWX
886
+     * @Param []
887
+     * @Return void
888
+     **/
889
+    public void updatePaperRollUp(){
890
+        int timestamp = N_Utils.getSecondTimestamp();
891
+        paperStudentMapper.updatePaperRollUp(timestamp);
892
+    }
893
+
867
 
894
 
868
 
895
 
869
     //////////////////////////////////////////////图片作业 end//////////////////////////////////////////////////////////////////////
896
     //////////////////////////////////////////////图片作业 end//////////////////////////////////////////////////////////////////////

+ 13
- 9
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentWebService.java Переглянути файл

1
 package com.xhkjedu.sstudy.service.paperstudent;
1
 package com.xhkjedu.sstudy.service.paperstudent;
2
 
2
 
3
 import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSON;
4
+import com.xhkjedu.constant.PlatformConstant;
5
+import com.xhkjedu.exception.MissingParametersException;
4
 import com.xhkjedu.sstudy.mapper.paper.PaperAnalyzeMapper;
6
 import com.xhkjedu.sstudy.mapper.paper.PaperAnalyzeMapper;
5
 import com.xhkjedu.sstudy.mapper.paper.PaperMapper;
7
 import com.xhkjedu.sstudy.mapper.paper.PaperMapper;
6
 import com.xhkjedu.sstudy.mapper.paper.PaperQtypeQuestionMapper;
8
 import com.xhkjedu.sstudy.mapper.paper.PaperQtypeQuestionMapper;
21
 import com.xhkjedu.sstudy.utils.StudyUtil;
23
 import com.xhkjedu.sstudy.utils.StudyUtil;
22
 import com.xhkjedu.sstudy.vo.paperstudent.*;
24
 import com.xhkjedu.sstudy.vo.paperstudent.*;
23
 import com.xhkjedu.utils.N_Utils;
25
 import com.xhkjedu.utils.N_Utils;
26
+import com.xhkjedu.vo.ResultVo;
24
 import lombok.extern.slf4j.Slf4j;
27
 import lombok.extern.slf4j.Slf4j;
25
 import org.springframework.stereotype.Service;
28
 import org.springframework.stereotype.Service;
26
 import org.springframework.transaction.annotation.Transactional;
29
 import org.springframework.transaction.annotation.Transactional;
146
      * @return void
149
      * @return void
147
      **/
150
      **/
148
     @Transactional(rollbackFor = Exception.class)
151
     @Transactional(rollbackFor = Exception.class)
149
-    public void submitPaper(PaperStudentWebVo paper) throws Exception {
152
+    public ResultVo submitPaper(PaperStudentWebVo paper) {
150
         try {
153
         try {
151
             List<TPaperStudentQuestion> psqs = paper.getPsqs();
154
             List<TPaperStudentQuestion> psqs = paper.getPsqs();
152
             TPaperStudentQuestion psq = psqs.get(0);
155
             TPaperStudentQuestion psq = psqs.get(0);
156
             Integer psid = psq.getPsid();
159
             Integer psid = psq.getPsid();
157
             TPaperStudent ps2 = paperStudentMapper.findById(psid);
160
             TPaperStudent ps2 = paperStudentMapper.findById(psid);
158
             //学生作业不存在或是已提交不处理
161
             //学生作业不存在或是已提交不处理
159
-            Integer psstate = ps2.getPsstate();
160
-            if (ps2 == null || (psstate != 0 && psstate != 3)) return;
162
+            ResultVo vo = StudyUtil.checkPsState(ps2);//校验学生作业提交状态
163
+            if (vo != null) return vo;
161
             Integer paperid = psq.getPaperid();
164
             Integer paperid = psq.getPaperid();
162
             Integer classid = paper.getClassid();
165
             Integer classid = paper.getClassid();
163
             int nowTime = N_Utils.getSecondTimestamp();
166
             int nowTime = N_Utils.getSecondTimestamp();
319
         } catch (Exception e) {
322
         } catch (Exception e) {
320
             log.error("提交试卷失败:"+e.getMessage());
323
             log.error("提交试卷失败:"+e.getMessage());
321
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
324
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
322
-            throw new RuntimeException("提交试卷失败");
325
+            return new ResultVo(1, "提交失败!");
323
         }
326
         }
327
+        return new ResultVo(0, "提交成功!");
324
     }
328
     }
325
 
329
 
326
     /**
330
     /**
331
      * @return void
335
      * @return void
332
      **/
336
      **/
333
     @Transactional(rollbackFor = Exception.class)
337
     @Transactional(rollbackFor = Exception.class)
334
-    public void scantronSubmitPaper(PaperStudentWebVo paper) throws Exception {
338
+    public ResultVo scantronSubmitPaper(PaperStudentWebVo paper) {
335
         try {
339
         try {
336
             List<TPaperStudentScantron> psqs = paper.getPss();
340
             List<TPaperStudentScantron> psqs = paper.getPss();
337
             TPaperStudentScantron pss = psqs.get(0);
341
             TPaperStudentScantron pss = psqs.get(0);
340
             Integer checknum = 0;
344
             Integer checknum = 0;
341
             Integer psid = pss.getPsid();
345
             Integer psid = pss.getPsid();
342
             TPaperStudent ps2 = paperStudentMapper.findById(psid);
346
             TPaperStudent ps2 = paperStudentMapper.findById(psid);
343
-            //学生作业不存在或是已提交不处理
344
-            Integer psstate = ps2.getPsstate();
345
-            if (ps2 == null || (psstate != 0 && psstate != 3)) return;
347
+            ResultVo vo = StudyUtil.checkPsState(ps2);//校验学生作业提交状态
348
+            if (vo != null) return vo;
346
             Integer paperid = pss.getPaperid();
349
             Integer paperid = pss.getPaperid();
347
             Integer classid = paper.getClassid();
350
             Integer classid = paper.getClassid();
348
             int nowTime = N_Utils.getSecondTimestamp();
351
             int nowTime = N_Utils.getSecondTimestamp();
505
         } catch (Exception e) {
508
         } catch (Exception e) {
506
             log.error("图片作业提交失败:"+e.getMessage());
509
             log.error("图片作业提交失败:"+e.getMessage());
507
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
510
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
508
-            throw new RuntimeException("图片作业提交失败");
511
+            return new ResultVo(1, "提交失败!");
509
         }
512
         }
513
+        return new ResultVo(0, "提交成功!");
510
     }
514
     }
511
 
515
 
512
     /**
516
     /**

+ 13
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/task/PaperStudentTask.java Переглянути файл

26
         paperStudentService.updateShowanswer();
26
         paperStudentService.updateShowanswer();
27
     }
27
     }
28
 
28
 
29
+    /**
30
+     * @Description 作业自动收卷
31
+     * @Date 2024/4/1 14:39
32
+     * @Author YWX
33
+     * @Param []
34
+     * @Return void
35
+     **/
36
+    @Async("threadPoolTaskScheduler")
37
+    @Scheduled(cron = "${cron.updatePaperStuShowanswer}")
38
+    public void updatePaperRollUp() {
39
+        paperStudentService.updatePaperRollUp();
40
+    }
41
+
29
     /**
42
     /**
30
      * 合并学生答案-题库作业
43
      * 合并学生答案-题库作业
31
      *
44
      *

+ 14
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/utils/StudyUtil.java Переглянути файл

1
 package com.xhkjedu.sstudy.utils;
1
 package com.xhkjedu.sstudy.utils;
2
 
2
 
3
+import com.xhkjedu.constant.PlatformConstant;
4
+import com.xhkjedu.exception.MissingParametersException;
3
 import com.xhkjedu.sstudy.config.ConfigKey;
5
 import com.xhkjedu.sstudy.config.ConfigKey;
4
 import com.xhkjedu.sstudy.mapper.paper.PaperAnalyzeMapper;
6
 import com.xhkjedu.sstudy.mapper.paper.PaperAnalyzeMapper;
7
+import com.xhkjedu.sstudy.model.paperstudent.TPaperStudent;
5
 import com.xhkjedu.sstudy.vo.paper.PaperClassVo;
8
 import com.xhkjedu.sstudy.vo.paper.PaperClassVo;
6
 import com.xhkjedu.sstudy.vo.paper.PaperListVo;
9
 import com.xhkjedu.sstudy.vo.paper.PaperListVo;
7
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo;
10
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo;
8
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
11
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
9
 import com.xhkjedu.utils.N_Utils;
12
 import com.xhkjedu.utils.N_Utils;
13
+import com.xhkjedu.vo.ResultVo;
10
 import lombok.extern.slf4j.Slf4j;
14
 import lombok.extern.slf4j.Slf4j;
11
 import org.apache.commons.lang3.StringUtils;
15
 import org.apache.commons.lang3.StringUtils;
12
 import org.springframework.http.HttpEntity;
16
 import org.springframework.http.HttpEntity;
269
         rtnmap.put("bxclassids",bxclassids);
273
         rtnmap.put("bxclassids",bxclassids);
270
         return rtnmap;
274
         return rtnmap;
271
     }
275
     }
276
+
277
+    //校验学生作业提交状态
278
+    public static ResultVo checkPsState(TPaperStudent ps) {
279
+        //如果学生作业不存在或是已提交,直接返回提交成功
280
+        if (ps == null) return PlatformConstant.COMMIT_SUCCESS;
281
+        Integer psstate = ps.getPsstate();
282
+        if (psstate.equals(1) || psstate.equals(2)) return PlatformConstant.COMMIT_SUCCESS;
283
+        if (psstate.equals(4)) return PlatformConstant.AFTER_COMMIT;
284
+        return null;
285
+    }
272
 }
286
 }

+ 5
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PaperListVo.java Переглянути файл

2
 
2
 
3
 import lombok.Data;
3
 import lombok.Data;
4
 
4
 
5
+import javax.persistence.Transient;
5
 import java.util.List;
6
 import java.util.List;
6
 import java.util.Map;
7
 import java.util.Map;
7
 
8
 
77
 
78
 
78
     //是否有伙伴学校:0没有1有
79
     //是否有伙伴学校:0没有1有
79
     private Integer hashb;
80
     private Integer hashb;
81
+
82
+    @Transient
83
+    //补交:0不允许 1允许
84
+    private Integer aftercommit;
80
 }
85
 }

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PaperTeacherAppVo.java Переглянути файл

77
 
77
 
78
     //是否有伙伴学校:0没有1有
78
     //是否有伙伴学校:0没有1有
79
     private Integer hashb;
79
     private Integer hashb;
80
+
81
+    //补交:0不允许 1允许
82
+    private Integer aftercommit;
80
 }
83
 }

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paperstudent/PaperGroupParam.java Переглянути файл

56
     //发布年份
56
     //发布年份
57
     private Integer year;
57
     private Integer year;
58
 
58
 
59
+    //补交:0不允许 1允许
60
+    private Integer aftercommit;
59
 }
61
 }

+ 23
- 7
sstudy/src/main/resources/mapper/paper/PaperMapper.xml Переглянути файл

40
     <!-- 修改作业状态 -->
40
     <!-- 修改作业状态 -->
41
     <update id="updatePaperState">
41
     <update id="updatePaperState">
42
         UPDATE t_paper SET paperstate=#{pg.paperstate},hashb=#{pg.hashb},committype=#{pg.committype},timetype=#{pg.timetype}
42
         UPDATE t_paper SET paperstate=#{pg.paperstate},hashb=#{pg.hashb},committype=#{pg.committype},timetype=#{pg.timetype}
43
+        ,aftercommit=#{pg.aftercommit}
43
         <if test="ctypecount==0">,checktype=4</if>
44
         <if test="ctypecount==0">,checktype=4</if>
44
         WHERE paperid= #{pg.paperid}
45
         WHERE paperid= #{pg.paperid}
45
     </update>
46
     </update>
88
         <result property="ytjnum" column="ytjnum"/>
89
         <result property="ytjnum" column="ytjnum"/>
89
         <result property="ypgnum" column="ypgnum"/>
90
         <result property="ypgnum" column="ypgnum"/>
90
         <result property="hashb" column="hashb"/>
91
         <result property="hashb" column="hashb"/>
92
+        <result property="aftercommit" column="aftercommit"/>
91
         <collection property="schools" ofType="java.util.Map" javaType="java.util.List"
93
         <collection property="schools" ofType="java.util.Map" javaType="java.util.List"
92
                     select="listClass" column="{paperid=paperid,createid=createid,checkid=checkid,checktype=checktype,logschoolid=logschoolid,classids=classids}">
94
                     select="listClass" column="{paperid=paperid,createid=createid,checkid=checkid,checktype=checktype,logschoolid=logschoolid,classids=classids}">
93
         </collection>
95
         </collection>
199
     <select id="listAll" resultMap="paperResult">
201
     <select id="listAll" resultMap="paperResult">
200
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb,
202
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb,
201
         #{paper.schoolid} logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{paper.createid} as checkid
203
         #{paper.schoolid} logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{paper.createid} as checkid
202
-        ,group_concat(pg.classid) classids
204
+        ,group_concat(pg.classid) classids,p.aftercommit
203
         from t_paper p left join t_user u on p.createid=u.userid
205
         from t_paper p left join t_user u on p.createid=u.userid
204
         left join t_paper_class pg on p.paperid=pg.paperid
206
         left join t_paper_class pg on p.paperid=pg.paperid
205
         left join t_director d on p.directorid=d.directorid
207
         left join t_director d on p.directorid=d.directorid
206
-        where p.deleted=0 and p.lsbid=#{paper.lsbid} and (d.disabled=0 or p.directorid is null)
208
+        where p.deleted=0 and (d.disabled=0 or p.directorid is null)
207
         <if test="userVo.usertype!=null and userVo.usertype==0">
209
         <if test="userVo.usertype!=null and userVo.usertype==0">
208
             and p.schoolid=#{userVo.schoolid}
210
             and p.schoolid=#{userVo.schoolid}
209
         </if>
211
         </if>
212
             (p.hashb=1 and p.schoolid=#{paper.schoolid} and pg.classid in (${paper.classids})) or
214
             (p.hashb=1 and p.schoolid=#{paper.schoolid} and pg.classid in (${paper.classids})) or
213
             (pg.classid in (${paper.bxclassids})))
215
             (pg.classid in (${paper.bxclassids})))
214
         </if>
216
         </if>
217
+        <if test="paper.lsbid!=null and paper.lsbid!='0'.toString() and paper.lsbid!=''">
218
+            and p.lsbid=#{paper.lsbid}
219
+        </if>
215
         <if test="paper.directorid!=null and paper.directorid!='0'.toString() and paper.directorid!=''">
220
         <if test="paper.directorid!=null and paper.directorid!='0'.toString() and paper.directorid!=''">
216
             and p.directorid=#{paper.directorid}
221
             and p.directorid=#{paper.directorid}
217
         </if>
222
         </if>
236
     <select id="listAllMy" resultMap="paperResult">
241
     <select id="listAllMy" resultMap="paperResult">
237
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb,
242
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb,
238
         #{paper.schoolid} logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{paper.createid} as checkid
243
         #{paper.schoolid} logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{paper.createid} as checkid
239
-        ,group_concat(pg.classid) classids
244
+        ,group_concat(pg.classid) classids,p.aftercommit
240
         from t_paper p left join t_user u on p.createid=u.userid
245
         from t_paper p left join t_user u on p.createid=u.userid
241
         left join t_paper_class pg on p.paperid=pg.paperid
246
         left join t_paper_class pg on p.paperid=pg.paperid
242
         left join t_director d on p.directorid=d.directorid
247
         left join t_director d on p.directorid=d.directorid
243
-        where p.deleted=0 and p.lsbid=#{paper.lsbid} and p.createid=#{paper.createid} and (d.disabled=0 or p.directorid is null)
248
+        where p.deleted=0 and p.createid=#{paper.createid} and (d.disabled=0 or p.directorid is null)
249
+        <if test="paper.lsbid!=null and paper.lsbid!='0'.toString() and paper.lsbid!=''">
250
+            and p.lsbid=#{paper.lsbid}
251
+        </if>
244
         <if test="paper.directorid!=null and paper.directorid!='0'.toString() and paper.directorid!=''">
252
         <if test="paper.directorid!=null and paper.directorid!='0'.toString() and paper.directorid!=''">
245
             and p.directorid=#{paper.directorid}
253
             and p.directorid=#{paper.directorid}
246
         </if>
254
         </if>
266
     <select id="listWfbPapers" resultType="com.xhkjedu.sstudy.vo.paper.PaperListVo">
274
     <select id="listWfbPapers" resultType="com.xhkjedu.sstudy.vo.paper.PaperListVo">
267
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.createid,p.hasreport,p.schoolid
275
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.createid,p.hasreport,p.schoolid
268
         ,(select u.username from t_user u where u.userid=p.createid)createname
276
         ,(select u.username from t_user u where u.userid=p.createid)createname
277
+        ,p.aftercommit
269
         from t_paper p left join t_director d on p.directorid=d.directorid
278
         from t_paper p left join t_director d on p.directorid=d.directorid
270
-        where p.deleted=0 and p.lsbid=#{paper.lsbid} and p.paperstate=21 and (d.disabled=0 or p.directorid is null)
279
+        where p.deleted=0 and p.paperstate=21 and (d.disabled=0 or p.directorid is null)
271
         <if test="userVo.usertype!=null and userVo.usertype==0">
280
         <if test="userVo.usertype!=null and userVo.usertype==0">
272
             and p.schoolid=#{userVo.schoolid}
281
             and p.schoolid=#{userVo.schoolid}
273
         </if>
282
         </if>
274
         <if test="userVo.usertype!=0">
283
         <if test="userVo.usertype!=0">
275
             and p.createid=#{paper.createid}
284
             and p.createid=#{paper.createid}
276
         </if>
285
         </if>
286
+        <if test="paper.lsbid!=null and paper.lsbid!='0'.toString() and paper.lsbid!=''">
287
+            and p.lsbid=#{paper.lsbid}
288
+        </if>
277
         <if test="paper.directorid!=null and paper.directorid!='0'.toString() and paper.directorid!=''">
289
         <if test="paper.directorid!=null and paper.directorid!='0'.toString() and paper.directorid!=''">
278
             and p.directorid=#{paper.directorid}
290
             and p.directorid=#{paper.directorid}
279
         </if>
291
         </if>
306
     <select id="correctList" resultMap="paperResult">
318
     <select id="correctList" resultMap="paperResult">
307
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb
319
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,p.hashb
308
         ,#{schoolid} as logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{checkid} as checkid
320
         ,#{schoolid} as logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{checkid} as checkid
309
-        ,group_concat(pg.classid) classids
321
+        ,group_concat(pg.classid) classids,p.aftercommit
310
         from t_paper p left join t_user u on p.createid=u.userid
322
         from t_paper p left join t_user u on p.createid=u.userid
311
         left join t_paper_class pg on p.paperid=pg.paperid
323
         left join t_paper_class pg on p.paperid=pg.paperid
312
         left join t_paper_student ps on p.paperid=ps.paperid and pg.classid=ps.classid
324
         left join t_paper_student ps on p.paperid=ps.paperid and pg.classid=ps.classid
361
     <select id="listPaper" resultMap="paperResult">
373
     <select id="listPaper" resultMap="paperResult">
362
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.timetype
374
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.timetype
363
         ,pg.starttime,pg.stoptime,p.papernum,p.createid,#{paper.teacherid} as checkid,p.schoolid,#{paper.schoolid} as logschoolid
375
         ,pg.starttime,pg.stoptime,p.papernum,p.createid,#{paper.teacherid} as checkid,p.schoolid,#{paper.schoolid} as logschoolid
364
-        ,pg.showtype,p.hasreport,p.hashb,group_concat(pg.classid) classids
376
+        ,pg.showtype,p.hasreport,p.hashb,group_concat(pg.classid) classids,p.aftercommit
365
         ,(select u.username from t_user u where u.userid=p.createid)createname
377
         ,(select u.username from t_user u where u.userid=p.createid)createname
366
         from t_paper p left join t_paper_class pg on p.paperid=pg.paperid
378
         from t_paper p left join t_paper_class pg on p.paperid=pg.paperid
367
         left join t_class c on pg.classid=c.classid
379
         left join t_class c on pg.classid=c.classid
399
     <update id="updatePaperDeleted">
411
     <update id="updatePaperDeleted">
400
         update t_paper set deleted=#{deleted} where paperid=#{paperid}
412
         update t_paper set deleted=#{deleted} where paperid=#{paperid}
401
     </update>
413
     </update>
414
+    <!--修改补交状态-->
415
+    <update id="updateAfterCommit">
416
+        update t_paper set aftercommit=#{paper.aftercommit} where paperid=#{paper.paperid}
417
+    </update>
402
 
418
 
403
     <!--获取作业原文件保存地址列表-->
419
     <!--获取作业原文件保存地址列表-->
404
     <select id="listSourcePath" resultType="java.lang.String">
420
     <select id="listSourcePath" resultType="java.lang.String">

+ 4
- 3
sstudy/src/main/resources/mapper/paper/PaperTeaAppMapper.xml Переглянути файл

14
         <result property="logschoolid" column="logschoolid"/>
14
         <result property="logschoolid" column="logschoolid"/>
15
         <result property="createname" column="createname"/>
15
         <result property="createname" column="createname"/>
16
         <result property="hashb" column="hashb"/>
16
         <result property="hashb" column="hashb"/>
17
+        <result property="aftercommit" column="aftercommit"/>
17
         <collection property="students" ofType="com.xhkjedu.sstudy.vo.paperstudent.StudentVo"
18
         <collection property="students" ofType="com.xhkjedu.sstudy.vo.paperstudent.StudentVo"
18
                     select="listPaperStu" column="{paperid=paperid,createid=createid,checkid=checkid,logschoolid=logschoolid,classids=classids}">
19
                     select="listPaperStu" column="{paperid=paperid,createid=createid,checkid=checkid,logschoolid=logschoolid,classids=classids}">
19
         </collection>
20
         </collection>
29
     <select id="listTeacherApp" resultMap="paperResult">
30
     <select id="listTeacherApp" resultMap="paperResult">
30
         select p.paperid,p.papername,p.papernum,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createid,#{paper.teacherid} as checkid
31
         select p.paperid,p.papername,p.papernum,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createid,#{paper.teacherid} as checkid
31
         ,min(pg.starttime) as starttime,min(pg.stoptime) as stoptime,pg.checked,p.subjectid,p.paperscore,p.schoolid,#{paper.schoolid} logschoolid
32
         ,min(pg.starttime) as starttime,min(pg.stoptime) as stoptime,pg.checked,p.subjectid,p.paperscore,p.schoolid,#{paper.schoolid} logschoolid
32
-        ,group_concat(pg.classid) classids,p.hashb
33
+        ,group_concat(pg.classid) classids,p.hashb,p.aftercommit
33
         ,(select u.username from t_user u where u.userid=p.createid)createname
34
         ,(select u.username from t_user u where u.userid=p.createid)createname
34
         from t_paper p left join t_paper_class pg on p.paperid=pg.paperid
35
         from t_paper p left join t_paper_class pg on p.paperid=pg.paperid
35
         left join t_director d on p.directorid=d.directorid
36
         left join t_director d on p.directorid=d.directorid
54
     <select id="listMyTeacherApp" resultMap="paperResult">
55
     <select id="listMyTeacherApp" resultMap="paperResult">
55
         select p.paperid,p.papername,p.papernum,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createid,#{paper.teacherid} as checkid
56
         select p.paperid,p.papername,p.papernum,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createid,#{paper.teacherid} as checkid
56
         ,min(pg.starttime) as starttime,min(pg.stoptime) as stoptime,pg.checked,p.subjectid,p.paperscore,p.schoolid,#{paper.schoolid} logschoolid
57
         ,min(pg.starttime) as starttime,min(pg.stoptime) as stoptime,pg.checked,p.subjectid,p.paperscore,p.schoolid,#{paper.schoolid} logschoolid
57
-        ,group_concat(pg.classid) classids,p.hashb
58
+        ,group_concat(pg.classid) classids,p.hashb,p.aftercommit
58
         ,(select u.username from t_user u where u.userid=p.createid)createname
59
         ,(select u.username from t_user u where u.userid=p.createid)createname
59
         from t_paper p left join t_paper_class pg on p.paperid=pg.paperid
60
         from t_paper p left join t_paper_class pg on p.paperid=pg.paperid
60
         left join t_director d on p.directorid=d.directorid
61
         left join t_director d on p.directorid=d.directorid
75
     <!--未布置作业列表-->
76
     <!--未布置作业列表-->
76
     <select id="listWbz" resultType="com.xhkjedu.sstudy.vo.paper.PaperTeacherAppVo">
77
     <select id="listWbz" resultType="com.xhkjedu.sstudy.vo.paper.PaperTeacherAppVo">
77
         select p.paperid,p.papername,p.papernum,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createid
78
         select p.paperid,p.papername,p.papernum,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createid
78
-        ,p.subjectid,p.paperscore,p.schoolid
79
+        ,p.subjectid,p.paperscore,p.schoolid,p.aftercommit
79
         ,(select u.username from t_user u where u.userid=p.createid)createname
80
         ,(select u.username from t_user u where u.userid=p.createid)createname
80
         from t_paper p left join t_director d on p.directorid=d.directorid
81
         from t_paper p left join t_director d on p.directorid=d.directorid
81
         where p.deleted=0 and p.createid=#{paper.teacherid} and p.paperstate=#{paper.psstate} and (d.disabled=0 or p.directorid is null)
82
         where p.deleted=0 and p.createid=#{paper.teacherid} and p.paperstate=#{paper.psstate} and (d.disabled=0 or p.directorid is null)

+ 13
- 0
sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml Переглянути файл

192
         update t_paper_student ps left join t_paper_class pg on ps.paperid=pg.paperid and ps.classid=pg.classid
192
         update t_paper_student ps left join t_paper_class pg on ps.paperid=pg.paperid and ps.classid=pg.classid
193
         set ps.showanswer=1 where pg.pgstate=22 AND pg.showtype=1 and ps.showanswer=0 and pg.stoptime <![CDATA[ <= ]]> #{stoptime}
193
         set ps.showanswer=1 where pg.pgstate=22 AND pg.showtype=1 and ps.showanswer=0 and pg.stoptime <![CDATA[ <= ]]> #{stoptime}
194
     </update>
194
     </update>
195
+    <!--作业自动收卷-->
196
+    <update id="updatePaperRollUp">
197
+        update t_paper p left join t_paper_class pg on p.paperid=pg.paperid
198
+        left join t_paper_student ps on ps.paperid=pg.paperid and ps.classid=pg.classid
199
+        set ps.psstate=4,ps.stoptime=#{stoptime},pg.rollup=1
200
+        ,ps.userscore=if(p.papertype=2,(select sum(q.stuscore) from t_paper_student_scantron q where q.psid=ps.psid)
201
+            ,(select sum(q.stuscore) from t_paper_student_question q where q.psid=ps.psid))
202
+        where p.aftercommit=0 and pg.pgstate=22 and pg.rollup=0 and ps.psstate=0 and pg.stoptime <![CDATA[ <= ]]> #{stoptime}
203
+    </update>
195
 
204
 
196
 
205
 
197
 
206
 
418
         <if test="ps.psstate!=null and ps.psstate==2">and ps.psstate in(1,2)</if>
427
         <if test="ps.psstate!=null and ps.psstate==2">and ps.psstate in(1,2)</if>
419
         order by field(ps.psstate,1,2,0,3)
428
         order by field(ps.psstate,1,2,0,3)
420
     </select>
429
     </select>
430
+    <!--根据学生作业id获取提交状态-->
431
+    <select id="getPsStateByPsId" resultType="java.lang.Integer">
432
+        select ps.psstate from t_paper_student ps where ps.psid=#{psid}
433
+    </select>
421
 </mapper>
434
 </mapper>

Завантаження…
Відмінити
Зберегти