From e4b01330ae08b7a219027ee1dd077c1558f7aebc Mon Sep 17 00:00:00 2001 From: wushaofeng <846162692@qq.com> Date: Tue, 29 Dec 2020 16:42:57 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E6=96=B9=E6=B3=95--By=20Ternece?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExaminationPaperProductionController.java | 26 +++++++++++++++ .../xzs/repository/QuestionMapper.java | 7 ++-- .../ExaminationPaperProductionService.java | 12 +++++++ ...ExaminationPaperProductionServiceImpl.java | 33 +++++++++++++++++++ .../student/exam/ExaminationProductionVM.java | 18 ++++++++++ .../main/resources/mapper/QuestionMapper.xml | 29 +++++++++++++++- 6 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExaminationPaperProductionController.java create mode 100644 source/xzs/src/main/java/com/mindskip/xzs/service/ExaminationPaperProductionService.java create mode 100644 source/xzs/src/main/java/com/mindskip/xzs/service/impl/ExaminationPaperProductionServiceImpl.java create mode 100644 source/xzs/src/main/java/com/mindskip/xzs/viewmodel/student/exam/ExaminationProductionVM.java diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExaminationPaperProductionController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExaminationPaperProductionController.java new file mode 100644 index 0000000..9245ca4 --- /dev/null +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExaminationPaperProductionController.java @@ -0,0 +1,26 @@ +package com.mindskip.xzs.controller.student; + +import com.mindskip.xzs.base.BaseApiController; +import com.mindskip.xzs.base.RestResponse; +import com.mindskip.xzs.domain.Question; +import com.mindskip.xzs.service.ExaminationPaperProductionService; +import com.mindskip.xzs.viewmodel.student.exam.ExaminationProductionVM; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +@RestController("ExaminationPaperProductionController") +@RequestMapping(value = "/api/student/examination/paper") +@AllArgsConstructor +public class ExaminationPaperProductionController extends BaseApiController { + + private final ExaminationPaperProductionService examinationPaperProductionService; + + @RequestMapping(value = "/production", method = RequestMethod.GET) + public RestResponse paperProduction(@RequestBody @Valid ExaminationProductionVM examinationProductionVM){ + List questionList = examinationPaperProductionService.generation(examinationProductionVM); + return RestResponse.ok(questionList); + } +} diff --git a/source/xzs/src/main/java/com/mindskip/xzs/repository/QuestionMapper.java b/source/xzs/src/main/java/com/mindskip/xzs/repository/QuestionMapper.java index b175ce7..7114072 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/repository/QuestionMapper.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/repository/QuestionMapper.java @@ -1,8 +1,9 @@ package com.mindskip.xzs.repository; -import com.mindskip.xzs.domain.other.KeyValue; import com.mindskip.xzs.domain.Question; +import com.mindskip.xzs.domain.other.KeyValue; import com.mindskip.xzs.viewmodel.admin.question.QuestionPageRequestVM; +import com.mindskip.xzs.viewmodel.student.exam.ExaminationProductionVM; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -29,5 +30,7 @@ public interface QuestionMapper extends BaseMapper { Integer selectAllCount(); - List selectCountByDate(@Param("startTime") Date startTime,@Param("endTime") Date endTime); + List selectCountByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime); + + List selectQuestionsByQuestionsNumber(ExaminationProductionVM examinationProductionVM); } diff --git a/source/xzs/src/main/java/com/mindskip/xzs/service/ExaminationPaperProductionService.java b/source/xzs/src/main/java/com/mindskip/xzs/service/ExaminationPaperProductionService.java new file mode 100644 index 0000000..cc9e44c --- /dev/null +++ b/source/xzs/src/main/java/com/mindskip/xzs/service/ExaminationPaperProductionService.java @@ -0,0 +1,12 @@ +package com.mindskip.xzs.service; + +import com.mindskip.xzs.domain.Question; +import com.mindskip.xzs.viewmodel.student.exam.ExaminationProductionVM; + +import java.util.List; + +public interface ExaminationPaperProductionService extends BaseService{ + + + List generation(ExaminationProductionVM examinationProductionVM); +} diff --git a/source/xzs/src/main/java/com/mindskip/xzs/service/impl/ExaminationPaperProductionServiceImpl.java b/source/xzs/src/main/java/com/mindskip/xzs/service/impl/ExaminationPaperProductionServiceImpl.java new file mode 100644 index 0000000..c58ed98 --- /dev/null +++ b/source/xzs/src/main/java/com/mindskip/xzs/service/impl/ExaminationPaperProductionServiceImpl.java @@ -0,0 +1,33 @@ +package com.mindskip.xzs.service.impl; + +import com.github.pagehelper.PageHelper; +import com.mindskip.xzs.domain.Question; +import com.mindskip.xzs.repository.BaseMapper; +import com.mindskip.xzs.repository.QuestionMapper; +import com.mindskip.xzs.service.ExaminationPaperProductionService; +import com.mindskip.xzs.viewmodel.student.exam.ExaminationProductionVM; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service + +public class ExaminationPaperProductionServiceImpl extends BaseServiceImpl implements ExaminationPaperProductionService { + + private final QuestionMapper questionMapper; + + @Autowired + public ExaminationPaperProductionServiceImpl(BaseMapper baseMapper, QuestionMapper questionMapper) { + super(baseMapper); + this.questionMapper = questionMapper; + } + + + @Override + public List generation(ExaminationProductionVM examinationProductionVM) { + + return PageHelper.startPage(examinationProductionVM.getPageIndex(),examinationProductionVM.getPageSize()).doSelectPage(()-> + questionMapper.selectQuestionsByQuestionsNumber(examinationProductionVM)); + } +} diff --git a/source/xzs/src/main/java/com/mindskip/xzs/viewmodel/student/exam/ExaminationProductionVM.java b/source/xzs/src/main/java/com/mindskip/xzs/viewmodel/student/exam/ExaminationProductionVM.java new file mode 100644 index 0000000..9ffba5b --- /dev/null +++ b/source/xzs/src/main/java/com/mindskip/xzs/viewmodel/student/exam/ExaminationProductionVM.java @@ -0,0 +1,18 @@ +package com.mindskip.xzs.viewmodel.student.exam; + +import com.mindskip.xzs.base.BasePage; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +@Data +public class ExaminationProductionVM extends BasePage { + @NotNull + private int questionNumber; + + private Integer difficult; + private List skillIds; + private Integer industryId; + +} diff --git a/source/xzs/src/main/resources/mapper/QuestionMapper.xml b/source/xzs/src/main/resources/mapper/QuestionMapper.xml index c57141b..e263898 100644 --- a/source/xzs/src/main/resources/mapper/QuestionMapper.xml +++ b/source/xzs/src/main/resources/mapper/QuestionMapper.xml @@ -209,7 +209,7 @@ FROM t_question AS q LEFT JOIN t_industry AS i ON q.industry_id = i.id LEFT JOIN t_skill AS s ON s.id = q.skill_id - and q.deleted=0 + q.deleted=0 and q.id= #{id} @@ -231,6 +231,33 @@ + From 21ee444e3f0c01faa7c3ef34e2b01e8baab8f147 Mon Sep 17 00:00:00 2001 From: wushaofeng <846162692@qq.com> Date: Tue, 29 Dec 2020 17:34:50 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E6=96=B9=E6=B3=95=20test3--By=20Ter?= =?UTF-8?q?nece?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student/ExaminationPaperProductionController.java | 2 +- source/xzs/src/main/resources/mapper/QuestionMapper.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExaminationPaperProductionController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExaminationPaperProductionController.java index 9245ca4..f79a69b 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExaminationPaperProductionController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExaminationPaperProductionController.java @@ -18,7 +18,7 @@ public class ExaminationPaperProductionController extends BaseApiController { private final ExaminationPaperProductionService examinationPaperProductionService; - @RequestMapping(value = "/production", method = RequestMethod.GET) + @RequestMapping(value = "/production", method = RequestMethod.POST) public RestResponse paperProduction(@RequestBody @Valid ExaminationProductionVM examinationProductionVM){ List questionList = examinationPaperProductionService.generation(examinationProductionVM); return RestResponse.ok(questionList); diff --git a/source/xzs/src/main/resources/mapper/QuestionMapper.xml b/source/xzs/src/main/resources/mapper/QuestionMapper.xml index a37622f..7f69689 100644 --- a/source/xzs/src/main/resources/mapper/QuestionMapper.xml +++ b/source/xzs/src/main/resources/mapper/QuestionMapper.xml @@ -237,9 +237,9 @@ > select - from - q.deleted=0 + deleted=0 and difficult = #{difficult} From fa0eb26d9a2b9a979682755b59206317deec0ebb Mon Sep 17 00:00:00 2001 From: czm Date: Wed, 30 Dec 2020 14:41:49 +0800 Subject: [PATCH 04/28] admin page and log update --- source/vue/xzs-admin/src/router.js | 99 ++++++++++--------- .../xzs-admin/src/views/dashboard/index.vue | 6 +- .../src/views/education/industry/list.vue | 2 +- .../xzs-admin/src/views/user/student/edit.vue | 8 +- .../xzs-admin/src/views/user/student/list.vue | 2 +- .../controller/admin/QuestionController.java | 30 +++++- xzs-new.sql | 2 + 7 files changed, 91 insertions(+), 58 deletions(-) diff --git a/source/vue/xzs-admin/src/router.js b/source/vue/xzs-admin/src/router.js index aba2576..6202da4 100644 --- a/source/vue/xzs-admin/src/router.js +++ b/source/vue/xzs-admin/src/router.js @@ -86,7 +86,8 @@ const constantRoutes = [ path: 'paper/list', component: () => import('@/views/exam/paper/list'), name: 'ExamPaperPageList', - meta: { title: '试卷列表', noCache: true } + meta: { title: '试卷列表', noCache: true }, + hidden: true }, { path: 'paper/edit', @@ -138,30 +139,30 @@ const constantRoutes = [ } ] }, - { - path: '/task', - component: Layout, - name: 'TaskPage', - meta: { - title: '任务管理', - icon: 'task' - }, - alwaysShow: true, - children: [ - { - path: 'list', - component: () => import('@/views/task/list'), - name: 'TaskListPage', - meta: { title: '任务列表', noCache: true } - }, - { - path: 'edit', - component: () => import('@/views/task/edit'), - name: 'TaskEditPage', - meta: { title: '任务创建', noCache: true } - } - ] - }, + // { + // path: '/task', + // component: Layout, + // name: 'TaskPage', + // meta: { + // title: '任务管理', + // icon: 'task' + // }, + // alwaysShow: true, + // children: [ + // { + // path: 'list', + // component: () => import('@/views/task/list'), + // name: 'TaskListPage', + // meta: { title: '任务列表', noCache: true } + // }, + // { + // path: 'edit', + // component: () => import('@/views/task/edit'), + // name: 'TaskEditPage', + // meta: { title: '任务创建', noCache: true } + // } + // ] + // }, { path: '/education', component: Layout, @@ -200,30 +201,30 @@ const constantRoutes = [ } ] }, - { - path: '/message', - component: Layout, - name: 'MessagePage', - meta: { - title: '消息中心', - icon: 'message' - }, - alwaysShow: true, - children: [ - { - path: 'list', - component: () => import('@/views/message/list'), - name: 'MessageListPage', - meta: { title: '消息列表', noCache: true } - }, - { - path: 'send', - component: () => import('@/views/message/send'), - name: 'MessageSendPage', - meta: { title: '消息发送', noCache: true } - } - ] - }, + // { + // path: '/message', + // component: Layout, + // name: 'MessagePage', + // meta: { + // title: '消息中心', + // icon: 'message' + // }, + // alwaysShow: true, + // children: [ + // { + // path: 'list', + // component: () => import('@/views/message/list'), + // name: 'MessageListPage', + // meta: { title: '消息列表', noCache: true } + // }, + // { + // path: 'send', + // component: () => import('@/views/message/send'), + // name: 'MessageSendPage', + // meta: { title: '消息发送', noCache: true } + // } + // ] + // }, { path: '/log', component: Layout, diff --git a/source/vue/xzs-admin/src/views/dashboard/index.vue b/source/vue/xzs-admin/src/views/dashboard/index.vue index df4a797..c7d373b 100644 --- a/source/vue/xzs-admin/src/views/dashboard/index.vue +++ b/source/vue/xzs-admin/src/views/dashboard/index.vue @@ -1,7 +1,7 @@