Merge remote-tracking branch 'origin/master'

This commit is contained in:
wushaofeng 2020-12-30 16:39:53 +08:00
commit 6ab33b7c64
10 changed files with 94 additions and 61 deletions

View File

@ -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,

View File

@ -1,7 +1,7 @@
<template>
<div class="dashboard-container">
<el-row :gutter="40" class="panel-group">
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<!--<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel">
<div class="card-panel-icon-wrapper icon-people">
<svg-icon icon-class="exam" class-name="card-panel-icon"/>
@ -13,7 +13,7 @@
<count-to :start-val="0" :end-val="examPaperCount" :duration="2600" class="card-panel-num" v-loading="loading"/>
</div>
</div>
</el-col>
</el-col>-->
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" >
<div class="card-panel-icon-wrapper icon-message">
@ -27,6 +27,7 @@
</div>
</div>
</el-col>
<!--
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel">
<div class="card-panel-icon-wrapper icon-shopping">
@ -53,6 +54,7 @@
</div>
</div>
</el-col>
-->
</el-row>
<el-row class="echarts-line">
<div id="echarts-moth-user" style="width: 100%;height:400px;" v-loading="loading"/>

View File

@ -19,7 +19,7 @@
<el-table-column prop="name" label="industry"/>
<el-table-column width="220px" label="操作" align="center">
<template slot-scope="{row}">
<router-link :to="{path:'/education/subject/edit', query:{id:row.id}}" class="link-left">
<router-link :to="{path:'/education/industry/edit', query:{id:row.id}}" class="link-left">
<el-button size="mini">编辑</el-button>
</router-link>
<el-button size="mini" type="danger" @click="delSubject(row)" class="link-left">删除</el-button>

View File

@ -25,11 +25,11 @@
<el-form-item label="手机:">
<el-input v-model="form.phone"></el-input>
</el-form-item>
<el-form-item label="年级:" prop="userLevel" required>
<!--<el-form-item label="年级:" prop="userLevel" required>
<el-select v-model="form.userLevel" placeholder="年级">
<el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>
</el-select>
</el-form-item>
</el-form-item>-->
<el-form-item label="状态:" required>
<el-select v-model="form.status" placeholder="状态">
<el-option v-for="item in statusEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>
@ -61,7 +61,7 @@ export default {
sex: '',
birthDay: null,
phone: null,
userLevel: null
userLevel: '1'
},
formLoading: false,
rules: {
@ -125,7 +125,7 @@ export default {
sex: '',
birthDay: null,
phone: null,
userLevel: null
userLevel: '1'
}
},
...mapActions('tagsView', { delCurrentView: 'delCurrentView' })

View File

@ -16,7 +16,7 @@
<el-table-column prop="id" label="Id" />
<el-table-column prop="userName" label="用户名"/>
<el-table-column prop="realName" label="真实姓名" />
<el-table-column prop="userLevel" label="学级" :formatter="levelFormatter"/>
<!--<el-table-column prop="userLevel" label="学级" :formatter="levelFormatter"/>-->
<el-table-column prop="sex" label="性别" width="60px;" :formatter="sexFormatter"/>
<el-table-column prop="phone" label="手机号"/>
<el-table-column prop="createTime" label="创建时间" width="160px"/>

View File

@ -34,7 +34,7 @@ public class RestAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuc
User springUser = (User) authentication.getPrincipal();
com.mindskip.xzs.domain.User user = userService.getUserByUserName(springUser.getUsername());
UserEventLog userEventLog = new UserEventLog(user.getId(), user.getUserName(), user.getRealName(), new Date());
userEventLog.setContent(user.getUserName() + " 登录了学之思考试系统");
userEventLog.setContent(user.getUserName() + " 登录了Tek Systems出题系统");
eventPublisher.publishEvent(new UserEvent(userEventLog));
com.mindskip.xzs.domain.User newUser = new com.mindskip.xzs.domain.User();
newUser.setUserName(user.getUserName());

View File

@ -5,9 +5,14 @@ import com.mindskip.xzs.base.RestResponse;
import com.mindskip.xzs.base.SystemCode;
import com.mindskip.xzs.domain.Question;
import com.mindskip.xzs.domain.TextContent;
import com.mindskip.xzs.domain.User;
import com.mindskip.xzs.domain.UserEventLog;
import com.mindskip.xzs.domain.enums.QuestionTypeEnum;
import com.mindskip.xzs.domain.question.QuestionObject;
import com.mindskip.xzs.event.UserEvent;
import com.mindskip.xzs.service.IndustryService;
import com.mindskip.xzs.service.QuestionService;
import com.mindskip.xzs.service.SkillService;
import com.mindskip.xzs.service.TextContentService;
import com.mindskip.xzs.utility.*;
import com.mindskip.xzs.viewmodel.admin.question.QuestionEditRequestVM;
@ -17,9 +22,11 @@ import com.github.pagehelper.PageInfo;
import com.mindskip.xzs.utility.*;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Date;
@RestController("AdminQuestionController")
@RequestMapping(value = "/api/admin/question")
@ -28,6 +35,9 @@ public class QuestionController extends BaseApiController {
private final QuestionService questionService;
private final TextContentService textContentService;
private final ApplicationEventPublisher eventPublisher;
private final IndustryService industryService;
private final SkillService skillService;
@RequestMapping(value = "/page", method = RequestMethod.POST)
public RestResponse<PageInfo<QuestionResponseVM>> pageList(@RequestBody QuestionPageRequestVM model) {
@ -51,13 +61,24 @@ public class QuestionController extends BaseApiController {
if (validQuestionEditRequestResult.getCode() != SystemCode.OK.getCode()) {
return validQuestionEditRequestResult;
}
User user = getCurrentUser();
UserEventLog userEventLog = new UserEventLog(user.getId(), user.getUserName(), user.getRealName(), new Date());
String content = "";
if (null == model.getId()) {
questionService.insertFullQuestion(model, getCurrentUser().getId());
Question question = questionService.insertFullQuestion(model, getCurrentUser().getId());
content = user.getUserName() + "增加 [题号——>"+question.getId()+"] " +
"[industry——>"+industryService.selectById(model.getIndustryId()).getName()+"] " +
"[skill——>"+skillService.selectById(model.getSkillId()).getName()+"]";
} else {
questionService.updateFullQuestion(model);
content = user.getUserName() + "更新 [题号——>"+model.getId()+"] " +
"[industry——>"+industryService.selectById(model.getIndustryId()).getName()+"] " +
"[skill——>"+skillService.selectById(model.getSkillId()).getName()+"]";
}
userEventLog.setContent(content);
eventPublisher.publishEvent(new UserEvent(userEventLog));
return RestResponse.ok();
}
@ -73,6 +94,13 @@ public class QuestionController extends BaseApiController {
Question question = questionService.selectById(id);
question.setDeleted(true);
questionService.updateByIdFilter(question);
User user = getCurrentUser();
UserEventLog userEventLog = new UserEventLog(user.getId(), user.getUserName(), user.getRealName(), new Date());
String content = user.getUserName() + "删除 [题号——>"+question.getId()+"] " +
"[industry——>"+industryService.selectById(question.getIndustryId()).getName()+"] " +
"[skill——>"+skillService.selectById(question.getSkillId()).getName()+"]";
userEventLog.setContent(content);
eventPublisher.publishEvent(new UserEvent(userEventLog));
return RestResponse.ok();
}

View File

@ -69,7 +69,7 @@ public class UserController extends BaseApiController {
user.setDeleted(false);
userService.insertByFilter(user);
UserEventLog userEventLog = new UserEventLog(user.getId(), user.getUserName(), user.getRealName(), new Date());
userEventLog.setContent("欢迎 " + user.getUserName() + " 注册来到学之思考试系统");
userEventLog.setContent("欢迎 " + user.getUserName() + " 注册来到Tek Systems出题系统");
eventPublisher.publishEvent(new UserEvent(userEventLog));
return RestResponse.ok();
}

View File

@ -71,7 +71,7 @@ public class UserController extends BaseWXApiController {
user.setDeleted(false);
userService.insertByFilter(user);
UserEventLog userEventLog = new UserEventLog(user.getId(), user.getUserName(), user.getRealName(), new Date());
userEventLog.setContent("欢迎 " + user.getUserName() + " 注册来到学之思考试系统");
userEventLog.setContent("欢迎 " + user.getUserName() + " 注册来到Tek Systems出题系统");
eventPublisher.publishEvent(new UserEvent(userEventLog));
return RestResponse.ok();
}

View File

@ -372,3 +372,5 @@ CREATE TABLE `t_user_token` (
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;
(SELECT * FROM t_question WHERE skill_id = 1 LIMIT 2) UNION (SELECT * FROM t_question WHERE skill_id = 11 LIMIT 2) ;