parent
53d6cee45c
commit
5e5e9da5f3
@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "client",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
|
||||
|
||||
"dependencies": {
|
||||
"axios": "^0.24.0",
|
||||
"core-js": "^3.6.5",
|
||||
"element-ui": "^2.15.6",
|
||||
"font-awesome": "^4.7.0",
|
||||
"qs": "^6.10.3",
|
||||
"solc": "^0.8.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-router": "^3.5.3",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
},
|
||||
"rules": {}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
|
||||
}
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,8 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
</style>
|
@ -0,0 +1,212 @@
|
||||
import http from "../utils/http.js";
|
||||
|
||||
/** 系统请求地址 */
|
||||
export function getSysNoticeList(token){
|
||||
|
||||
return http.get('/sys/notices', {params: {token: token}});
|
||||
}
|
||||
export function login(param){
|
||||
|
||||
return http.post('/login', param);
|
||||
}
|
||||
export function exit(token){
|
||||
|
||||
return http.get('/exit', {params: {token: token}});
|
||||
}
|
||||
export function getLoginUser(token){
|
||||
|
||||
return http.get('/info', {params: {token: token}});
|
||||
}
|
||||
export function checkUserPwd(token, oldPwd){
|
||||
|
||||
return http.get('/checkPwd', {params: {token: token, oldPwd: oldPwd}});
|
||||
}
|
||||
export function updLoginUserInfo(params){
|
||||
|
||||
return http.post('/info', params);
|
||||
}
|
||||
export function updLoginUserPwd(token, newPwd){
|
||||
|
||||
return http.post('/pwd', {token: token, password: newPwd});
|
||||
}
|
||||
|
||||
/** 通知记录接口 */
|
||||
export function getPageNotices(pageIndex, pageSize, token, title, teamName){
|
||||
|
||||
return http.get('/notices/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, token: token, title: title, teamName: teamName}});
|
||||
}
|
||||
export function addNotices(params){
|
||||
|
||||
return http.post('/notices/add', params);
|
||||
}
|
||||
export function updNotices(params){
|
||||
|
||||
return http.post('/notices/upd', params);
|
||||
}
|
||||
export function delNotices(id){
|
||||
|
||||
return http.post('/notices/del', {id: id});
|
||||
}
|
||||
/** 社团类型接口 */
|
||||
export function getAllTypes(){
|
||||
|
||||
return http.get('/teamTypes/all');
|
||||
}
|
||||
export function getPageTeamTypes(pageIndex, pageSize, name){
|
||||
|
||||
return http.get('/teamTypes/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, name: name}});
|
||||
}
|
||||
export function addTeamTypes(params){
|
||||
|
||||
return http.post('/teamTypes/add', params);
|
||||
}
|
||||
export function updTeamTypes(params){
|
||||
|
||||
return http.post('/teamTypes/upd', params);
|
||||
}
|
||||
export function delTeamTypes(id){
|
||||
|
||||
return http.post('/teamTypes/del', {id: id});
|
||||
}
|
||||
/** 社团信息接口 */
|
||||
export function getAllTeamList(){
|
||||
|
||||
return http.get('/teams/all');
|
||||
}
|
||||
export function getManTeamList(manId){
|
||||
|
||||
return http.get('/teams/man', {params: {manId: manId}});
|
||||
}
|
||||
export function getPageTeams(pageIndex, pageSize, token, name, typeId){
|
||||
|
||||
return http.get('/teams/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, token: token, name: name, typeId: typeId}});
|
||||
}
|
||||
export function addTeams(params){
|
||||
|
||||
return http.post('/teams/add', params);
|
||||
}
|
||||
export function updTeams(params){
|
||||
|
||||
return http.post('/teams/upd', params);
|
||||
}
|
||||
export function delTeams(id){
|
||||
|
||||
return http.post('/teams/del', {id: id});
|
||||
}
|
||||
/** 活动信息接口 */
|
||||
export function getPageActivities(pageIndex, pageSize, token, teamName, activeName){
|
||||
|
||||
return http.get('/activities/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, token: token, teamName: teamName, activeName: activeName}});
|
||||
}
|
||||
export function addActivities(params){
|
||||
|
||||
return http.post('/activities/add', params);
|
||||
}
|
||||
export function updActivities(params){
|
||||
|
||||
return http.post('/activities/upd', params);
|
||||
}
|
||||
export function delActivities(id){
|
||||
|
||||
return http.post('/activities/del', {id: id});
|
||||
}
|
||||
/** 报名记录接口 */
|
||||
export function getActiveLogs(activeId){
|
||||
|
||||
return http.get('/activeLogs/list', {params: {activeId: activeId}});
|
||||
}
|
||||
export function getPageActiveLogs(pageIndex, pageSize, name){
|
||||
|
||||
return http.get('/activeLogs/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, name: name}});
|
||||
}
|
||||
export function addActiveLogs(params){
|
||||
|
||||
return http.post('/activeLogs/add', params);
|
||||
}
|
||||
export function updActiveLogs(params){
|
||||
|
||||
return http.post('/activeLogs/upd', params);
|
||||
}
|
||||
export function delActiveLogs(id){
|
||||
|
||||
return http.post('/activeLogs/del', {id: id});
|
||||
}
|
||||
/** 申请记录接口 */
|
||||
export function getPageApplyLogs(pageIndex, pageSize, token, teamName, userName){
|
||||
|
||||
return http.get('/applyLogs/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, token: token, teamName: teamName, userName: userName}});
|
||||
}
|
||||
export function addApplyLogs(params){
|
||||
|
||||
return http.post('/applyLogs/add', params);
|
||||
}
|
||||
export function updApplyLogs(params){
|
||||
|
||||
return http.post('/applyLogs/upd', params);
|
||||
}
|
||||
export function delApplyLogs(id){
|
||||
|
||||
return http.post('/applyLogs/del', {id: id});
|
||||
}
|
||||
/** 成员信息接口 */
|
||||
export function getPageMembers(pageIndex, pageSize, token, teamName, userName){
|
||||
|
||||
return http.get('/members/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, token: token, teamName: teamName, userName: userName}});
|
||||
}
|
||||
export function addMembers(params){
|
||||
|
||||
return http.post('/members/add', params);
|
||||
}
|
||||
export function updMembers(params){
|
||||
|
||||
return http.post('/members/upd', params);
|
||||
}
|
||||
export function delMembers(id){
|
||||
|
||||
return http.post('/members/del', {id: id});
|
||||
}
|
||||
/** 缴费记录接口 */
|
||||
export function getPagePayLogs(pageIndex, pageSize, token, teamName, userName){
|
||||
|
||||
return http.get('/payLogs/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, token: token, teamName: teamName, userName: userName}});
|
||||
}
|
||||
export function addPayLogs(params){
|
||||
|
||||
return http.post('/payLogs/add', params);
|
||||
}
|
||||
export function updPayLogs(params){
|
||||
|
||||
return http.post('/payLogs/upd', params);
|
||||
}
|
||||
export function delPayLogs(id){
|
||||
|
||||
return http.post('/payLogs/del', {id: id});
|
||||
}
|
||||
|
||||
|
||||
/** 系统用户接口 */
|
||||
export function getPageUsers(pageIndex, pageSize, userName, name, phone){
|
||||
|
||||
return http.get('/users/page',
|
||||
{params: {pageIndex: pageIndex, pageSize: pageSize, userName: userName, name: name, phone: phone}});
|
||||
}
|
||||
export function addUsers(params){
|
||||
|
||||
return http.post('/users/add', params);
|
||||
}
|
||||
export function updUsers(params){
|
||||
|
||||
return http.post('/users/upd', params);
|
||||
}
|
||||
export function delUsers(id){
|
||||
|
||||
return http.post('/users/del', {id: id});
|
||||
}
|
After Width: | Height: | Size: 122 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,135 @@
|
||||
*{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
|
||||
}
|
||||
|
||||
.text-blue{
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.fater-header {
|
||||
position: fixed;
|
||||
left: 0px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 70px !important;
|
||||
line-height: 70px;
|
||||
background-color: #009999;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.fater-header-logo {
|
||||
position: absolute;
|
||||
left: 25px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
.fater-header-user{
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fater-left{
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 200px !important;
|
||||
border-right: 1px solid #eee;
|
||||
background-color: #fff;
|
||||
}
|
||||
.fater-left .el-menu{
|
||||
|
||||
border-right: none;
|
||||
}
|
||||
.fater-left .fa{
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.fater-body{
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
right: 0;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
background-color: #F2F2F2;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.fater-body-breadcrumb{
|
||||
margin: -15px;
|
||||
margin-bottom: 15px;
|
||||
padding: 10px 15px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
cursor: pointer;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.fater-body-show .el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.fater-body-show .el-card__header{
|
||||
padding: 10px 15px;
|
||||
}
|
||||
.fater-body-show .el-card__body{
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.fater-index-panle{
|
||||
position: relative;
|
||||
height: 120px;
|
||||
}
|
||||
.fater-index-panle-num{
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
font-size: 52px;
|
||||
font-weight: bold;
|
||||
color: #409EFF;
|
||||
}
|
||||
.fater-index-panle-desc{
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.fater-index-panle-unit{
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
right: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.fater-welcome-panel{
|
||||
height: 290px;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 5px;
|
||||
background-image: url("./1.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.el-button--primary {
|
||||
color: #FFF;
|
||||
background-color: #009999;
|
||||
border-color: #009999;
|
||||
}
|
||||
|
||||
.el-button--primary:link{
|
||||
background-color: #009999;
|
||||
border-color: #009999;
|
||||
}
|
||||
.el-button--primary:visited{
|
||||
background-color: #009999;
|
||||
border-color: #009999;
|
||||
}
|
||||
.el-button--primary:hover{
|
||||
background-color: #009999;
|
||||
border-color: #009999;
|
||||
}
|
||||
.el-button--primary:active{
|
||||
background-color: #009999;
|
||||
border-color: #009999;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<el-aside class="fater-left">
|
||||
<el-menu active-text-color="#009999" :default-active="this.$router.currentRoute.path" router>
|
||||
<template v-for="(item, index) in menuList">
|
||||
<el-menu-item :key="index" :index="item.path">
|
||||
<span :class="item.icon"></span>
|
||||
<span slot="title">{{ item.name }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
export default{
|
||||
props: {
|
||||
menuList: []
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<el-header class="fater-header">
|
||||
<div class="fater-header-logo">校园社团管理系统</div>
|
||||
<el-dropdown @command="handleUser" class="fater-header-user">
|
||||
<span class="el-dropdown-link">个人中心</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="info">个人信息</el-dropdown-item>
|
||||
<el-dropdown-item command="pwd">修改密码</el-dropdown-item>
|
||||
<el-dropdown-item command="exit">退出系统</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
<el-dialog title="修改信息" width="700px" :append-to-body="true" :visible.sync="showUpdInfoFlag">
|
||||
<el-form label-width="80px" :model="userForm">
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户账号">
|
||||
<el-input v-model="userForm.userName"
|
||||
placeholder="请输入用户账号…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户密码">
|
||||
<el-input v-model="userForm.passWord" type="password"
|
||||
placeholder="请输入用户密码…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户姓名">
|
||||
<el-input v-model="userForm.name"
|
||||
placeholder="请输入用户姓名…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户年龄">
|
||||
<el-input v-model="userForm.age"
|
||||
placeholder="请输入用户年龄…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-radio-group v-model="userForm.gender">
|
||||
<el-radio label="男"></el-radio>
|
||||
<el-radio label="女"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话">
|
||||
<el-input v-model="userForm.phone"
|
||||
placeholder="请输入联系电话…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="联系地址">
|
||||
<el-input rows="4" type="textarea" v-model="userForm.address"
|
||||
placeholder="请输入联系地址…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showUpdInfoFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="修改密码" width="600px" :append-to-body="true" :visible.sync="showUpdPwdFlag">
|
||||
<el-form label-width="80px" ref="userPwd" :model="userPwd" :rules="userPwdFormRules">
|
||||
<el-form-item label="原始密码" prop="oldPwd">
|
||||
<el-input type="password" v-model="userPwd.oldPwd" placeholder="请输入原始密码……" autocomplete="off">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="修改密码" prop="newPwd">
|
||||
<el-input type="password" v-model="userPwd.newPwd" placeholder="请输入修改密码……" autocomplete="off">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="rePwd">
|
||||
<el-input type="password" v-model="userPwd.rePwd" placeholder="请再次确认密码……" autocomplete="off">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showUpdPwdFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updPwd('userPwd')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-header>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
exit,
|
||||
getLoginUser,
|
||||
checkUserPwd,
|
||||
updLoginUserInfo,
|
||||
updLoginUserPwd,
|
||||
} from "../api";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
var checkOldPwd = async (rule, value, callback) => {
|
||||
if (value) {
|
||||
await checkUserPwd(this.$store.state.token, value).then((resp) => {
|
||||
if (resp.code != 0) {
|
||||
callback(new Error("原始密码输入错误"));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback(new Error("原始密码必须输入"));
|
||||
}
|
||||
callback();
|
||||
};
|
||||
var checkNewPwd = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error("修改密码必须输入"));
|
||||
}
|
||||
|
||||
callback();
|
||||
};
|
||||
var checkRePwd = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error("确认密码必须输入"));
|
||||
}
|
||||
|
||||
if (value != this.userPwd.newPwd) {
|
||||
callback(new Error("两次输入密码不一致"));
|
||||
}
|
||||
|
||||
callback();
|
||||
};
|
||||
return {
|
||||
showUpdInfoFlag: false,
|
||||
showUpdPwdFlag: false,
|
||||
userPwd: {
|
||||
oldPwd: "",
|
||||
newPwd: "",
|
||||
rePwd: "",
|
||||
},
|
||||
userPwdFormRules: {
|
||||
oldPwd: [{
|
||||
validator: checkOldPwd,
|
||||
trigger: "blur",
|
||||
}, ],
|
||||
newPwd: [{
|
||||
validator: checkNewPwd,
|
||||
trigger: "blur",
|
||||
}, ],
|
||||
rePwd: [{
|
||||
validator: checkRePwd,
|
||||
trigger: "blur",
|
||||
}, ],
|
||||
},
|
||||
userForm: {
|
||||
id: "",
|
||||
userName: "",
|
||||
passWord: "",
|
||||
name: "",
|
||||
gender: "",
|
||||
age: "",
|
||||
phone: "",
|
||||
address: "",
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleUser(comm) {
|
||||
if (comm == "info") {
|
||||
this.showUpdInfoWin();
|
||||
}
|
||||
|
||||
if (comm == "pwd") {
|
||||
this.showUpdPwdWin();
|
||||
}
|
||||
|
||||
if (comm == "exit") {
|
||||
this.$confirm("确认要退出吗?", "系统提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
exit(this.$store.state.token).then(() => {
|
||||
this.$store.commit("clearToken");
|
||||
this.$store.commit("clearMenus");
|
||||
sessionStorage.clear();
|
||||
this.$router.push("/");
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
initUserPwd() {
|
||||
this.userPwd = {
|
||||
oldPwd: "",
|
||||
newPwd: "",
|
||||
rePwd: "",
|
||||
};
|
||||
},
|
||||
initUserForm() {
|
||||
this.userForm = {
|
||||
id: "",
|
||||
userName: "",
|
||||
};
|
||||
},
|
||||
showUpdInfoWin() {
|
||||
getLoginUser(this.$store.state.token).then((resp) => {
|
||||
this.initUserForm();
|
||||
this.userForm = resp.data;
|
||||
this.showUpdInfoFlag = true;
|
||||
});
|
||||
},
|
||||
showUpdPwdWin() {
|
||||
this.initUserPwd();
|
||||
this.showUpdPwdFlag = true;
|
||||
},
|
||||
updInfo() {
|
||||
|
||||
|
||||
this.userForm.token = this.$store.state.token;
|
||||
updLoginUserInfo(this.userForm).then((resp) => {
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: "success",
|
||||
});
|
||||
|
||||
this.showUpdInfoFlag = false;
|
||||
this.initUserForm();
|
||||
});
|
||||
},
|
||||
updPwd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
updLoginUserPwd(this.$store.state.token, this.userPwd.newPwd).then((resp) => {
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: "success",
|
||||
});
|
||||
|
||||
this.showUpdPwdFlag = false;
|
||||
this.initUserPwd();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,40 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
|
||||
import ElementUI from 'element-ui';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
|
||||
import 'font-awesome/css/font-awesome.min.css';
|
||||
|
||||
import "./assets/style.css";
|
||||
|
||||
Vue.use(ElementUI);
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
|
||||
import initMenu from "./utils/menus";
|
||||
|
||||
router.beforeEach((to,from,next)=>{
|
||||
|
||||
if(to.path == '/'){
|
||||
next();
|
||||
}else{
|
||||
if(store.state.menus == null){
|
||||
|
||||
initMenu(router, store);
|
||||
next();
|
||||
}else{
|
||||
|
||||
next();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: function (h) { return h(App) }
|
||||
}).$mount('#app')
|
@ -0,0 +1,15 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
export default new VueRouter({
|
||||
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'login',
|
||||
component: require("../views/login.vue").default
|
||||
}
|
||||
]
|
||||
});
|
@ -0,0 +1,35 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
state:{
|
||||
token: null,
|
||||
menus: null,
|
||||
},
|
||||
getters: {
|
||||
|
||||
getToken: state => {
|
||||
return state.token
|
||||
},
|
||||
|
||||
getMenus: state => {
|
||||
return state.menus
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
setToken: (state, newToken) =>{
|
||||
state.token = newToken;
|
||||
},
|
||||
clearToken: (state) =>{
|
||||
state.token = null;
|
||||
},
|
||||
setMenus: (state, menus) =>{
|
||||
state.menus = menus;
|
||||
},
|
||||
clearMenus: (state) =>{
|
||||
state.menus = null;
|
||||
},
|
||||
}
|
||||
})
|
@ -0,0 +1,54 @@
|
||||
import axios from 'axios'
|
||||
import qs from 'qs'
|
||||
import {
|
||||
Message
|
||||
} from 'element-ui'
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
|
||||
const service = axios.create({
|
||||
// withCredentials: true,
|
||||
baseURL: 'http://localhost:9999/teams',
|
||||
timeout: 15000 // 请求超时时间
|
||||
})
|
||||
|
||||
service.interceptors.request.use(config => {
|
||||
|
||||
if(config.method === "post"){
|
||||
|
||||
config.data = qs.stringify(config.data, { indices: false });
|
||||
}
|
||||
|
||||
return config;
|
||||
}, error => {
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// respone拦截器
|
||||
service.interceptors.response.use(
|
||||
resp => {
|
||||
|
||||
if (resp.data.code != 2) {
|
||||
|
||||
return resp.data;
|
||||
} else {
|
||||
|
||||
Message({
|
||||
message: resp.data.msg,
|
||||
type: 'error',
|
||||
center: true
|
||||
});
|
||||
return Promise.reject(resp);
|
||||
}
|
||||
},
|
||||
error => {
|
||||
Message({
|
||||
message: '系统异常,请求中断',
|
||||
type: 'error',
|
||||
center: true
|
||||
});
|
||||
return Promise.reject(error);
|
||||
}
|
||||
)
|
||||
|
||||
export default service
|
@ -0,0 +1,208 @@
|
||||
import {getLoginUser} from "../api";
|
||||
|
||||
// 系统管理员
|
||||
export const adminMenus = {
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: require("../views/home.vue").default,
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
name: '系统首页',
|
||||
icon: "fa fa-home",
|
||||
component: require("../views/pages/Index.vue").default
|
||||
},
|
||||
{
|
||||
path: '/users',
|
||||
name: '系统用户管理',
|
||||
icon: "fa fa-address-book-o",
|
||||
component: require("../views/pages/Users.vue").default
|
||||
},
|
||||
{
|
||||
path: '/teamTypes',
|
||||
name: '社团类型管理',
|
||||
icon: "fa fa-building-o",
|
||||
component: require("../views/pages/TeamTypes.vue").default
|
||||
},
|
||||
{
|
||||
path: '/teams',
|
||||
name: '社团信息管理',
|
||||
icon: "fa fa-subway",
|
||||
component: require("../views/pages/Teams.vue").default
|
||||
},
|
||||
{
|
||||
path: '/members',
|
||||
name: '社团成员管理',
|
||||
icon: "fa fa-cubes",
|
||||
component: require("../views/pages/Members.vue").default
|
||||
},
|
||||
{
|
||||
path: '/activities',
|
||||
name: '社团活动管理',
|
||||
icon: "fa fa-calculator",
|
||||
component: require("../views/pages/Activities.vue").default
|
||||
},
|
||||
{
|
||||
path: '/notices',
|
||||
name: '通知信息管理',
|
||||
icon: "fa fa-bullhorn",
|
||||
component: require("../views/pages/Notices.vue").default
|
||||
},
|
||||
{
|
||||
path: '/applyLogs',
|
||||
name: '入团申请记录',
|
||||
icon: "fa fa-envelope-open",
|
||||
component: require("../views/pages/ApplyLogs.vue").default
|
||||
},
|
||||
{
|
||||
path: '/payLogs',
|
||||
name: '费用记录管理',
|
||||
icon: "fa fa-clock-o",
|
||||
component: require("../views/pages/PayLogs.vue").default
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// 社团管理员
|
||||
export const manMenus = {
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: require("../views/home.vue").default,
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
name: '系统首页',
|
||||
icon: "fa fa-home",
|
||||
component: require("../views/pages/Index.vue").default
|
||||
},
|
||||
{
|
||||
path: '/teams',
|
||||
name: '社团信息浏览',
|
||||
icon: "fa fa-subway",
|
||||
component: require("../views/pages/Teams.vue").default
|
||||
},
|
||||
{
|
||||
path: '/members',
|
||||
name: '社团成员管理',
|
||||
icon: "fa fa-cubes",
|
||||
component: require("../views/pages/Members.vue").default
|
||||
},
|
||||
{
|
||||
path: '/applyLogs',
|
||||
name: '入团申请处理',
|
||||
icon: "fa fa-envelope-open",
|
||||
component: require("../views/pages/ApplyLogs.vue").default
|
||||
},
|
||||
{
|
||||
path: '/activities',
|
||||
name: '社团活动浏览',
|
||||
icon: "fa fa-calculator",
|
||||
component: require("../views/pages/Activities.vue").default
|
||||
},
|
||||
{
|
||||
path: '/notices',
|
||||
name: '通知信息管理',
|
||||
icon: "fa fa-bullhorn",
|
||||
component: require("../views/pages/Notices.vue").default
|
||||
},
|
||||
{
|
||||
path: '/payLogs',
|
||||
name: '费用记录管理',
|
||||
icon: "fa fa-clock-o",
|
||||
component: require("../views/pages/PayLogs.vue").default
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const memYMenus = {
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: require("../views/home.vue").default,
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
name: '系统首页',
|
||||
icon: "fa fa-home",
|
||||
component: require("../views/pages/Index.vue").default
|
||||
},
|
||||
{
|
||||
path: '/teams',
|
||||
name: '社团信息浏览',
|
||||
icon: "fa fa-subway",
|
||||
component: require("../views/pages/Teams.vue").default
|
||||
},
|
||||
{
|
||||
path: '/activities',
|
||||
name: '社团活动浏览',
|
||||
icon: "fa fa-calculator",
|
||||
component: require("../views/pages/Activities.vue").default
|
||||
},
|
||||
{
|
||||
path: '/applyLogs',
|
||||
name: '入团申请记录',
|
||||
icon: "fa fa-envelope-open",
|
||||
component: require("../views/pages/ApplyLogs.vue").default
|
||||
},
|
||||
{
|
||||
path: '/payLogs',
|
||||
name: '社团费用记录',
|
||||
icon: "fa fa-clock-o",
|
||||
component: require("../views/pages/PayLogs.vue").default
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const memNMenus = {
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: require("../views/home.vue").default,
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
name: '系统首页',
|
||||
icon: "fa fa-home",
|
||||
component: require("../views/pages/Index.vue").default
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default function initMenu(router, store){
|
||||
|
||||
let token = null;
|
||||
if(store.state.token){
|
||||
|
||||
token = store.state.token;
|
||||
}else{
|
||||
|
||||
token = sessionStorage.getItem("token");
|
||||
store.state.token = sessionStorage.getItem("token");
|
||||
}
|
||||
|
||||
getLoginUser(token).then(resp =>{
|
||||
|
||||
if(resp.data.type == 0){
|
||||
router.addRoute(adminMenus);
|
||||
store.commit("setMenus", adminMenus);
|
||||
}
|
||||
|
||||
if(resp.data.type == 1){
|
||||
router.addRoute(manMenus);
|
||||
store.commit("setMenus", manMenus);
|
||||
}
|
||||
|
||||
if(resp.data.type == 2){
|
||||
|
||||
if(resp.data.status == 0){
|
||||
|
||||
router.addRoute(memNMenus);
|
||||
store.commit("setMenus", memNMenus);
|
||||
}else{
|
||||
|
||||
router.addRoute(memYMenus);
|
||||
store.commit("setMenus", memYMenus);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<Nav></Nav>
|
||||
<el-container>
|
||||
<Menu :menuList="this.$store.state.menus.children"></Menu>
|
||||
<el-main class="fater-body">
|
||||
<el-breadcrumb v-if="this.$router.currentRoute.path != '/index' " class="fater-body-breadcrumb">
|
||||
<el-breadcrumb-item>系统首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{{ this.$router.currentRoute.name }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<router-view></router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import Nav from "../components/nav.vue";
|
||||
import Menu from "../components/menu.vue";
|
||||
|
||||
export default{
|
||||
|
||||
data(){
|
||||
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
components: {
|
||||
Nav,
|
||||
Menu
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,239 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.name"
|
||||
placeholder="输入…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
<el-button type="primary" size="mini"
|
||||
icon="el-icon-plus" @click="showAddWin()"></el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="createTime" label="报名时间"></el-table-column>
|
||||
<el-table-column align="center" prop="activeId" label="活动编号"></el-table-column>
|
||||
<el-table-column align="center" prop="userId" label="报名用户"></el-table-column>
|
||||
<el-table-column align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-edit"
|
||||
type="primary" size="mini" @click="showUpdWin(scope.row)"></el-button>
|
||||
<el-button icon="el-icon-delete" type="danger" size="mini"
|
||||
@click="delInfo(scope.row.id)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex" :page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="添加信息" width="600px" :visible.sync="showAddFlag">
|
||||
<el-form label-width="90px" :model="activeLogsForm">
|
||||
<el-form-item label="报名时间">
|
||||
<el-input v-model="activeLogsForm.createTime"
|
||||
placeholder="请输入报名时间…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动编号">
|
||||
<el-input v-model="activeLogsForm.activeId"
|
||||
placeholder="请输入活动编号…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报名用户">
|
||||
<el-input v-model="activeLogsForm.userId"
|
||||
placeholder="请输入报名用户…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showAddFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="修改信息" width="600px" :visible.sync="showUpdFlag">
|
||||
<el-form label-width="90px" :model="activeLogsForm">
|
||||
<el-form-item label="报名时间">
|
||||
<el-input v-model="activeLogsForm.createTime"
|
||||
placeholder="请输入报名时间…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动编号">
|
||||
<el-input v-model="activeLogsForm.activeId"
|
||||
placeholder="请输入活动编号…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报名用户">
|
||||
<el-input v-model="activeLogsForm.userId"
|
||||
placeholder="请输入报名用户…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showUpdFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPageActiveLogs,
|
||||
addActiveLogs,
|
||||
updActiveLogs,
|
||||
delActiveLogs
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
showAddFlag: false,
|
||||
showUpdFlag: false,
|
||||
qryForm: {
|
||||
name: "",
|
||||
},
|
||||
activeLogsForm: {
|
||||
id: "",
|
||||
createTime: "",
|
||||
activeId: "",
|
||||
userId: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPageActiveLogs(pageIndex, pageSize).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPageActiveLogs(1, this.pageSize, this.qryForm.name).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.name);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.name);
|
||||
},
|
||||
initForm() {
|
||||
|
||||
this.activeLogsForm = {
|
||||
id: "",
|
||||
createTime: "",
|
||||
activeId: "",
|
||||
userId: "",
|
||||
};
|
||||
},
|
||||
showAddWin() {
|
||||
|
||||
this.showAddFlag = true;
|
||||
},
|
||||
showUpdWin(row) {
|
||||
|
||||
this.activeLogsForm = row;
|
||||
this.showUpdFlag = true;
|
||||
},
|
||||
addInfo() {
|
||||
|
||||
addActiveLogs(this.activeLogsForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
|
||||
this.showAddFlag = false;
|
||||
|
||||
this.initForm();
|
||||
});
|
||||
},
|
||||
updInfo() {
|
||||
|
||||
updActiveLogs(this.activeLogsForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
|
||||
this.showUpdFlag = false;
|
||||
|
||||
this.initForm();
|
||||
});
|
||||
},
|
||||
delInfo(id){
|
||||
this.$confirm('即将删除相关信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
delActiveLogs(id).then(resp =>{
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,318 @@
|
||||
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.teamName"
|
||||
placeholder="输入团队名称"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.activeName"
|
||||
placeholder="输入活动名称…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div v-if="userType == 1" slot="header">
|
||||
<el-button type="primary" size="mini"
|
||||
icon="el-icon-plus" @click="showAddWin()"></el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="name" label="活动名称"></el-table-column>
|
||||
<el-table-column align="center" prop="teamName" label="发布社团"></el-table-column>
|
||||
<el-table-column align="center" prop="activeTime" label="活动时间"></el-table-column>
|
||||
<el-table-column align="center" prop="total" label="报名人数"></el-table-column>
|
||||
<el-table-column align="center" label="参与人员">
|
||||
<template slot-scope="scope">
|
||||
<el-popover title="活动参与人员" trigger="click"
|
||||
@show="getActivePeople(scope.row.id)" :width="550" placement="left">
|
||||
<el-table :data="activeLogs" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="userName" label="参与人员"></el-table-column>
|
||||
<el-table-column align="center" prop="userPhone" label="联系电话"></el-table-column>
|
||||
<el-table-column align="center" prop="createTime" label="报名时间"></el-table-column>
|
||||
</el-table>
|
||||
<el-button type="text" size="mini" slot="reference">参与人员</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="userType == 0" align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-delete" type="danger" size="mini"
|
||||
@click="delInfo(scope.row.id)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-else align="center" label="了解更多">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="click" :width="700" placement="left">
|
||||
<el-button @click="active(scope.row.id)" style="margin-bottom:15px;" type="primary" size="mini">我要报名</el-button>
|
||||
<el-descriptions :column="1" size="small" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">活动标题</template>
|
||||
{{ scope.row.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">发布社团</template>
|
||||
{{ scope.row.teamName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">活动时间</template>
|
||||
{{ scope.row.activeTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">活动概述</template>
|
||||
{{ scope.row.comm }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">活动要求</template>
|
||||
{{ scope.row.ask }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">活动详情</template>
|
||||
{{ scope.row.detail }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-button type="text" size="mini" slot="reference">查看详情</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex" :page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="添加信息" :fullscreen="true" :visible.sync="showAddFlag">
|
||||
<el-form label-width="90px" :model="activitiesForm">
|
||||
<el-form-item label="活动名称">
|
||||
<el-input v-model="activitiesForm.name"
|
||||
placeholder="请输入活动名称…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动时间">
|
||||
<el-date-picker style="width:100%;" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-model="activitiesForm.activeTime"
|
||||
type="datetime" placeholder="选择活动时间…"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="发布社团">
|
||||
<el-select style="width:100%;" v-model="activitiesForm.teamId" placeholder="请选择发布社团…">
|
||||
<el-option v-for="(item, index) in teams"
|
||||
:key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动概述">
|
||||
<el-input type="textarea" rows="6" v-model="activitiesForm.comm"
|
||||
placeholder="请输入活动概述…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动要求">
|
||||
<el-input type="textarea" rows="6" v-model="activitiesForm.ask"
|
||||
placeholder="请输入活动要求…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动详情">
|
||||
<el-input type="textarea" rows="10" v-model="activitiesForm.detail"
|
||||
placeholder="请输入活动详情…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showAddFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addActiveLogs,
|
||||
getManTeamList,
|
||||
getLoginUser,
|
||||
getActiveLogs,
|
||||
getPageActivities,
|
||||
addActivities,
|
||||
delActivities
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
teams: [],
|
||||
userType: "",
|
||||
activeLogs: [],
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
showAddFlag: false,
|
||||
qryForm: {
|
||||
token: this.$store.state.token,
|
||||
teamName: "",
|
||||
activeName: "",
|
||||
},
|
||||
activitiesForm: {
|
||||
id: "",
|
||||
name: "",
|
||||
comm: "",
|
||||
detail: "",
|
||||
ask: "",
|
||||
total: 1,
|
||||
activeTime: "",
|
||||
teamId: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getActivePeople(activeId){
|
||||
|
||||
getActiveLogs(activeId).then(resp =>{
|
||||
|
||||
this.activeLogs = [];
|
||||
this.activeLogs = resp.data;
|
||||
});
|
||||
},
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPageActivities(pageIndex, pageSize, this.qryForm.token).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPageActivities(1, this.pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.activeName).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.activeName);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.activeName);
|
||||
},
|
||||
initForm() {
|
||||
|
||||
this.activitiesForm = {
|
||||
id: "",
|
||||
name: "",
|
||||
comm: "",
|
||||
detail: "",
|
||||
ask: "",
|
||||
total: 1,
|
||||
activeTime: "",
|
||||
teamId: "",
|
||||
};
|
||||
},
|
||||
showAddWin() {
|
||||
|
||||
this.initForm();
|
||||
this.showAddFlag = true;
|
||||
},
|
||||
active(id){
|
||||
|
||||
addActiveLogs({token: this.$store.state.token, activeId: id}).then(resp =>{
|
||||
|
||||
if(resp.code == 0){
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
}else{
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addInfo() {
|
||||
|
||||
addActivities(this.activitiesForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
this.showAddFlag = false;
|
||||
|
||||
});
|
||||
},
|
||||
delInfo(id){
|
||||
this.$confirm('删除活动将同时删除报名记录, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
delActivities(id).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
getLoginUser(this.$store.state.token).then(resp =>{
|
||||
|
||||
this.userType = resp.data.type;
|
||||
|
||||
getManTeamList(resp.data.id).then(resp =>{
|
||||
|
||||
this.teams = resp.data;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.teamName"
|
||||
placeholder="输入团队名称…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.userName"
|
||||
placeholder="输入成员姓名…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div>
|
||||
<el-table v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="teamName" label="社团名称"></el-table-column>
|
||||
<el-table-column align="center" prop="userName" label="申请人姓名"></el-table-column>
|
||||
<el-table-column align="center" prop="userGender" label="申请人性别"></el-table-column>
|
||||
<el-table-column align="center" prop="userPhone" label="申请人电话"></el-table-column>
|
||||
<el-table-column align="center" prop="createTime" label="申请时间"></el-table-column>
|
||||
<el-table-column v-if="userType == 1" align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.status == 0"
|
||||
type="primary" size="mini" @click="updInfo(scope.row, 1)">通过</el-button>
|
||||
<el-button v-if="scope.row.status == 0"
|
||||
type="danger" size="mini" @click="updInfo(scope.row, 2)">驳回</el-button>
|
||||
<el-tag effect="plain" type="success" v-if="scope.row.status == 1">已通过</el-tag>
|
||||
<el-tag effect="plain" type="danger" v-if="scope.row.status == 2">已驳回</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-else align="center" label="申请状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag effect="plain" type="warning" v-if="scope.row.status == 0">审核中</el-tag>
|
||||
<el-tag effect="plain" type="success" v-if="scope.row.status == 1">已通过</el-tag>
|
||||
<el-tag effect="plain" type="danger" v-if="scope.row.status == 2">已驳回</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex" :page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getLoginUser,
|
||||
getPageApplyLogs,
|
||||
updApplyLogs
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
userType: "",
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
qryForm: {
|
||||
token: this.$store.state.token,
|
||||
teamName: "",
|
||||
userName: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPageApplyLogs(pageIndex, pageSize, this.qryForm.token).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPageApplyLogs(1, this.pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName);
|
||||
},
|
||||
updInfo(data, status) {
|
||||
|
||||
data['status'] = status;
|
||||
updApplyLogs(data).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
|
||||
this.initForm();
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
getLoginUser(this.$store.state.token).then(resp =>{
|
||||
|
||||
this.userType = resp.data.type;
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="16">
|
||||
<div class="fater-welcome-panel"></div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="never">
|
||||
<div>
|
||||
<el-descriptions title="个人资料" :column="1" size="small" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
用户ID
|
||||
</template>
|
||||
{{ loginUser.id }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
用户姓名
|
||||
</template>
|
||||
{{ loginUser.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
用户性别
|
||||
</template>
|
||||
{{ loginUser.gender }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
用户年龄
|
||||
</template>
|
||||
{{ loginUser.age }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
联系电话
|
||||
</template>
|
||||
{{ loginUser.phone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
联系地址
|
||||
</template>
|
||||
{{ loginUser.address }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">系统通知</div>
|
||||
<div>
|
||||
<el-timeline>
|
||||
<el-timeline-item color="#E6A23C" v-for="(item, index) in sysNotices" :key="index"
|
||||
:timestamp="item.createTime" placement="top">
|
||||
<el-card>
|
||||
<h4 style="font-size: 16px; line-height:28px;margin-bottom:15px;">{{ item.title }}</h4>
|
||||
<p style="font-size: 14px; line-height:28px;">{{ item.detail }}</p>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">系统信息</div>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
import {
|
||||
getLoginUser,
|
||||
getSysNoticeList
|
||||
} from "../../api";
|
||||
|
||||
export default{
|
||||
data(){
|
||||
|
||||
return{
|
||||
loginUser: {},
|
||||
sysNotices: [],
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
||||
getLoginUser(this.$store.state.token).then(resp =>{
|
||||
|
||||
this.loginUser = resp.data;
|
||||
});
|
||||
|
||||
getSysNoticeList(this.$store.state.token).then(resp =>{
|
||||
|
||||
this.sysNotices = resp.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.teamName"
|
||||
placeholder="输入社团名称…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.userName"
|
||||
placeholder="输入用户姓名…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div>
|
||||
<el-table v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="userId" label="成员ID"></el-table-column>
|
||||
<el-table-column align="center" prop="userName" label="成员姓名"></el-table-column>
|
||||
<el-table-column align="center" prop="userGender" label="成员性别"></el-table-column>
|
||||
<el-table-column align="center" prop="userAge" label="成员年龄"></el-table-column>
|
||||
<el-table-column align="center" prop="userPhone" label="成员电话"></el-table-column>
|
||||
<el-table-column align="center" prop="teamName" label="社团名称"></el-table-column>
|
||||
<el-table-column align="center" prop="createTime" label="入团时间"></el-table-column>
|
||||
<el-table-column align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="mini"
|
||||
@click="delInfo(scope.row.id)">移除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex" :page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPageMembers,
|
||||
delMembers
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
qryForm: {
|
||||
token: this.$store.state.token,
|
||||
teamName: "",
|
||||
userName: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPageMembers(pageIndex, pageSize, this.qryForm.token).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPageMembers(1, this.pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName);
|
||||
},
|
||||
delInfo(id){
|
||||
this.$confirm('移除成员将移除相关记录,确认继续吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
delMembers(id).then(resp => {
|
||||
|
||||
if(resp.code == 0){
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
}else{
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.title"
|
||||
placeholder="输入通知标题…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.teamName"
|
||||
placeholder="输入团队名称"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div v-if="userType != 2" slot="header">
|
||||
<el-button type="primary" size="mini"
|
||||
icon="el-icon-plus" @click="showAddWin()"></el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="title" label="通知标题"></el-table-column>
|
||||
<el-table-column align="center" prop="teamId" label="发布社团">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.teamName" type="success">{{scope.row.teamName}}</el-tag>
|
||||
<el-tag v-else type="warning">系统通知</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="createTime" label="发布时间"></el-table-column>
|
||||
<el-table-column align="center" prop="detail" label="通知详情"></el-table-column>
|
||||
<el-table-column v-if="userType == 0" align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-delete" type="danger" size="mini"
|
||||
@click="delInfo(scope.row.id)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="userType == 1" align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.teamId" icon="el-icon-delete" type="danger" size="mini"
|
||||
@click="delInfo(scope.row.id)"></el-button>
|
||||
<el-button v-else icon="el-icon-delete" type="danger" size="mini"
|
||||
disabled></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex" :page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="添加信息" width="600px" :visible.sync="showAddFlag">
|
||||
<el-form label-width="90px" :model="noticesForm">
|
||||
<el-form-item label="通知标题">
|
||||
<el-input v-model="noticesForm.title"
|
||||
placeholder="请输入通知标题…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="userType == 1" label="发布社团">
|
||||
<el-select style="width:100%;" v-model="noticesForm.teamId" placeholder="请选择发布社团…">
|
||||
<el-option v-for="(item, index) in teams"
|
||||
:key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通知详情">
|
||||
<el-input type="textarea" rows="5" v-model="noticesForm.detail"
|
||||
placeholder="请输入通知详情…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showAddFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getManTeamList,
|
||||
getLoginUser,
|
||||
getPageNotices,
|
||||
addNotices,
|
||||
delNotices
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
teams: [],
|
||||
userType: "",
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
showAddFlag: false,
|
||||
qryForm: {
|
||||
token: this.$store.state.token,
|
||||
teamName: "",
|
||||
title: "",
|
||||
},
|
||||
noticesForm: {
|
||||
id: "",
|
||||
title: "",
|
||||
detail: "",
|
||||
teamId: null,
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPageNotices(pageIndex, pageSize, this.qryForm.token).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPageNotices(1, this.pageSize, this.qryForm.token, this.qryForm.title, this.qryForm.teamName).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.token, this.qryForm.title, this.qryForm.teamName);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.token, this.qryForm.title, this.qryForm.teamName);
|
||||
},
|
||||
initForm() {
|
||||
|
||||
this.noticesForm = {
|
||||
id: "",
|
||||
title: "",
|
||||
detail: "",
|
||||
teamId: null,
|
||||
};
|
||||
},
|
||||
showAddWin() {
|
||||
|
||||
this.initForm();
|
||||
this.showAddFlag = true;
|
||||
},
|
||||
addInfo() {
|
||||
|
||||
addNotices(this.noticesForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
this.showAddFlag = false;
|
||||
});
|
||||
},
|
||||
delInfo(id){
|
||||
this.$confirm('即将删除相关信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
delNotices(id).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
getLoginUser(this.$store.state.token).then(resp =>{
|
||||
|
||||
this.userType = resp.data.type;
|
||||
|
||||
getManTeamList(resp.data.id).then(resp =>{
|
||||
|
||||
this.teams = resp.data;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.teamName"
|
||||
placeholder="输入团队名称…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.userName"
|
||||
placeholder="输入成员姓名…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div v-if="userType == 1" slot="header">
|
||||
<el-button type="primary" size="mini"
|
||||
icon="el-icon-plus" @click="showAddWin()"></el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="teamName" label="社团名称"></el-table-column>
|
||||
<el-table-column align="center" prop="userName" label="成员姓名"></el-table-column>
|
||||
<el-table-column align="center" prop="userGender" label="成员性别"></el-table-column>
|
||||
<el-table-column align="center" prop="userPhone" label="成员电话"></el-table-column>
|
||||
<el-table-column align="center" prop="createTime" label="缴费时间"></el-table-column>
|
||||
<el-table-column align="center" prop="total" label="缴纳费用"></el-table-column>>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex" :page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="添加信息" width="600px" :visible.sync="showAddFlag">
|
||||
<el-form label-width="90px" :model="payLogsForm">
|
||||
<el-form-item label="缴纳费用">
|
||||
<el-input v-model="payLogsForm.total"
|
||||
placeholder="请输入缴纳费用…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="收费社团">
|
||||
<el-select style="width:100%;" v-model="payLogsForm.teamId" placeholder="请输入收费社团…">
|
||||
<el-option v-for="(item, index) in teams"
|
||||
:key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="缴费用户">
|
||||
<el-input v-model="payLogsForm.userId"
|
||||
placeholder="请输入缴费用户ID…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showAddFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="修改信息" width="600px" :visible.sync="showUpdFlag">
|
||||
<el-form label-width="90px" :model="payLogsForm">
|
||||
<el-form-item label="缴纳费用">
|
||||
<el-input v-model="payLogsForm.total"
|
||||
placeholder="请输入缴纳费用…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="收费社团">
|
||||
<el-select style="width:100%;" v-model="payLogsForm.teamId" placeholder="请输入收费社团…">
|
||||
<el-option v-for="(item, index) in teams"
|
||||
:key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="缴费用户">
|
||||
<el-input v-model="payLogsForm.userId"
|
||||
placeholder="请输入缴费用户ID…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showUpdFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getAllTeamList,
|
||||
getManTeamList,
|
||||
getLoginUser,
|
||||
getPagePayLogs,
|
||||
addPayLogs,
|
||||
updPayLogs,
|
||||
delPayLogs
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
teams: [],
|
||||
userType: "",
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
showAddFlag: false,
|
||||
showUpdFlag: false,
|
||||
qryForm: {
|
||||
token: this.$store.state.token,
|
||||
teamName: "",
|
||||
userName: "",
|
||||
},
|
||||
payLogsForm: {
|
||||
id: "",
|
||||
total: "",
|
||||
teamId: "",
|
||||
userId: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPagePayLogs(pageIndex, pageSize, this.qryForm.token).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPagePayLogs(1, this.pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.token, this.qryForm.teamName, this.qryForm.userName);
|
||||
},
|
||||
initForm() {
|
||||
|
||||
this.payLogsForm = {
|
||||
id: "",
|
||||
total: "",
|
||||
teamId: "",
|
||||
userId: "",
|
||||
};
|
||||
},
|
||||
showAddWin() {
|
||||
|
||||
this.initForm();
|
||||
this.showAddFlag = true;
|
||||
},
|
||||
showUpdWin(row) {
|
||||
|
||||
this.payLogsForm = row;
|
||||
this.showUpdFlag = true;
|
||||
},
|
||||
addInfo() {
|
||||
|
||||
addPayLogs(this.payLogsForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
this.showAddFlag = false;
|
||||
});
|
||||
},
|
||||
updInfo() {
|
||||
|
||||
updPayLogs(this.payLogsForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
this.showUpdFlag = false;
|
||||
});
|
||||
},
|
||||
delInfo(id){
|
||||
this.$confirm('即将删除相关信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
delPayLogs(id).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
getLoginUser(this.$store.state.token).then(resp =>{
|
||||
|
||||
this.userType = resp.data.type;
|
||||
|
||||
if(resp.data.type == 1){
|
||||
|
||||
getManTeamList(resp.data.id).then(resp =>{
|
||||
|
||||
this.teams = resp.data;
|
||||
});
|
||||
}else{
|
||||
|
||||
getAllTeamList().then(resp =>{
|
||||
|
||||
this.teams = resp.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item>
|
||||
<el-input v-model="qryForm.name" placeholder="输入社团类型名称…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
<el-button type="primary" size="mini" icon="el-icon-plus" @click="showAddWin()"></el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="name" label="类型名称"></el-table-column>
|
||||
<el-table-column align="center" prop="createTime" label="创建时间"></el-table-column>
|
||||
<el-table-column align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-edit" type="primary" size="mini" @click="showUpdWin(scope.row)">
|
||||
</el-button>
|
||||
<el-button icon="el-icon-delete" type="danger" size="mini" @click="delInfo(scope.row.id)">
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex" :page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="添加信息" width="600px" :visible.sync="showAddFlag">
|
||||
<el-form label-width="90px" :model="teamTypesForm">
|
||||
<el-form-item label="类型名称">
|
||||
<el-input v-model="teamTypesForm.name" placeholder="请输入类型名称…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showAddFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="修改信息" width="600px" :visible.sync="showUpdFlag">
|
||||
<el-form label-width="90px" :model="teamTypesForm">
|
||||
<el-form-item label="类型名称">
|
||||
<el-input v-model="teamTypesForm.name" placeholder="请输入类型名称…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showUpdFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPageTeamTypes,
|
||||
addTeamTypes,
|
||||
updTeamTypes,
|
||||
delTeamTypes
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
showAddFlag: false,
|
||||
showUpdFlag: false,
|
||||
qryForm: {
|
||||
name: "",
|
||||
},
|
||||
teamTypesForm: {
|
||||
id: "",
|
||||
name: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPageTeamTypes(pageIndex, pageSize).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPageTeamTypes(1, this.pageSize, this.qryForm.name).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.name);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.name);
|
||||
},
|
||||
initForm() {
|
||||
|
||||
this.teamTypesForm = {
|
||||
id: "",
|
||||
name: "",
|
||||
};
|
||||
},
|
||||
showAddWin() {
|
||||
|
||||
this.showAddFlag = true;
|
||||
},
|
||||
showUpdWin(row) {
|
||||
|
||||
this.teamTypesForm = row;
|
||||
this.showUpdFlag = true;
|
||||
},
|
||||
addInfo() {
|
||||
|
||||
addTeamTypes(this.teamTypesForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
|
||||
this.showAddFlag = false;
|
||||
|
||||
this.initForm();
|
||||
});
|
||||
},
|
||||
updInfo() {
|
||||
|
||||
updTeamTypes(this.teamTypesForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
|
||||
this.showUpdFlag = false;
|
||||
|
||||
this.initForm();
|
||||
});
|
||||
},
|
||||
delInfo(id) {
|
||||
this.$confirm('即将删除相关信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
delTeamTypes(id).then(resp => {
|
||||
|
||||
if(resp.code == 0){
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
}else{
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item >
|
||||
<el-input v-model="qryForm.name"
|
||||
placeholder="输入社团名称…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item >
|
||||
<el-select v-model="qryForm.typeId" placeholder="请选择社团类型">
|
||||
<el-option label="查看全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in teamTypes"
|
||||
:key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div v-if="userType == 0" slot="header">
|
||||
<el-button type="primary" size="mini"
|
||||
icon="el-icon-plus" @click="showAddWin()"></el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="name" label="社团名称"></el-table-column>
|
||||
<el-table-column align="center" prop="typeName" label="社团类型"></el-table-column>
|
||||
<el-table-column align="center" prop="managerName" label="社团团长"></el-table-column>
|
||||
<el-table-column align="center" prop="createTime" label="建立时间"></el-table-column>
|
||||
<el-table-column align="center" prop="total" label="社团人数"></el-table-column>
|
||||
<el-table-column v-if="userType == 0" align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-edit"
|
||||
type="primary" size="mini" @click="showUpdWin(scope.row)"></el-button>
|
||||
<el-button icon="el-icon-delete" type="danger" size="mini"
|
||||
@click="delInfo(scope.row.id)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="userType == 2" align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="primary" size="mini"
|
||||
@click="apply(scope.row.id)">申请</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex" :page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="添加信息" width="600px" :visible.sync="showAddFlag">
|
||||
<el-form label-width="90px" :model="teamsForm">
|
||||
<el-form-item label="社团名称">
|
||||
<el-input v-model="teamsForm.name"
|
||||
placeholder="请输入社团名称…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="社团类型">
|
||||
<el-select style="width:100%;" v-model="teamsForm.typeId" placeholder="请选择社团类型">
|
||||
<el-option v-for="(item, index) in teamTypes"
|
||||
:key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="社团团长">
|
||||
<el-input v-model="teamsForm.manager"
|
||||
placeholder="请输入社团管理员ID…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showAddFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="修改信息" width="600px" :visible.sync="showUpdFlag">
|
||||
<el-form label-width="90px" :model="teamsForm">
|
||||
<el-form-item label="社团名称">
|
||||
<el-input v-model="teamsForm.name"
|
||||
placeholder="请输入社团名称…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="社团类型">
|
||||
<el-select style="width:100%;" v-model="teamsForm.typeId" placeholder="请选择社团类型">
|
||||
<el-option v-for="(item, index) in teamTypes"
|
||||
:key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="社团团长">
|
||||
<el-input v-model="teamsForm.manager"
|
||||
placeholder="请输入社团管理员ID…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showUpdFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getAllTypes,
|
||||
getPageTeams,
|
||||
getLoginUser,
|
||||
addTeams,
|
||||
updTeams,
|
||||
delTeams,
|
||||
addApplyLogs
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
teamTypes: [],
|
||||
userType: "",
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
showAddFlag: false,
|
||||
showUpdFlag: false,
|
||||
qryForm: {
|
||||
name: "",
|
||||
typeId: "",
|
||||
token: this.$store.state.token,
|
||||
},
|
||||
teamsForm: {
|
||||
id: "",
|
||||
name: "",
|
||||
total: 1,
|
||||
manager: "",
|
||||
typeId: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPageTeams(pageIndex, pageSize, this.qryForm.token).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPageTeams(1, this.pageSize, this.qryForm.token, this.qryForm.name, this.qryForm.typeId).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.token, this.qryForm.name, this.qryForm.typeId);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.token, this.qryForm.name, this.qryForm.typeId);
|
||||
},
|
||||
initForm() {
|
||||
|
||||
this.teamsForm = {
|
||||
id: "",
|
||||
name: "",
|
||||
total: 1,
|
||||
manager: "",
|
||||
typeId: "",
|
||||
};
|
||||
},
|
||||
showAddWin() {
|
||||
|
||||
this.initForm();
|
||||
this.showAddFlag = true;
|
||||
},
|
||||
showUpdWin(row) {
|
||||
|
||||
this.teamsForm = row;
|
||||
this.showUpdFlag = true;
|
||||
},
|
||||
addInfo() {
|
||||
|
||||
addTeams(this.teamsForm).then(resp => {
|
||||
|
||||
if(resp.code == 0){
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
this.showAddFlag = false;
|
||||
}else{
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
updInfo() {
|
||||
|
||||
updTeams(this.teamsForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
this.showUpdFlag = false;
|
||||
});
|
||||
},
|
||||
delInfo(id){
|
||||
this.$confirm('即将删除相关信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
delTeams(id).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
});
|
||||
});
|
||||
},
|
||||
apply(id){
|
||||
|
||||
this.$confirm('确认申请加入社团吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
addApplyLogs({teamId: id, status: 0, token: this.$store.state.token}).then(resp => {
|
||||
|
||||
if(resp.code == 0){
|
||||
|
||||
this.$message({
|
||||
message: '申请已提交,请耐心等待',
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
}else{
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize, this.qryForm.token);
|
||||
|
||||
getAllTypes().then(resp =>{
|
||||
|
||||
this.teamTypes = resp.data;
|
||||
});
|
||||
|
||||
getLoginUser(this.$store.state.token).then(resp =>{
|
||||
|
||||
this.userType = resp.data.type;
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<div class="fater-body-show">
|
||||
<el-card shadow="never">
|
||||
<div slot="header">
|
||||
信息查询
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="qryForm">
|
||||
<el-form-item>
|
||||
<el-input v-model="qryForm.userName"
|
||||
placeholder="输入用户账号…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="qryForm.name"
|
||||
placeholder="输入用户姓名…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="qryForm.phone"
|
||||
placeholder="输入用户联系电话…"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
icon="el-icon-search" @click="getPageLikeInfo()"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div>
|
||||
<el-table
|
||||
v-loading="loading" element-loading-text="拼命加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(124, 124, 124, 0.8)" :data="pageInfos" border>
|
||||
<el-table-column align="center" type="index"></el-table-column>
|
||||
<el-table-column align="center" prop="id" label="用户ID"></el-table-column>
|
||||
<el-table-column align="center" prop="userName" label="用户账号"></el-table-column>
|
||||
<el-table-column align="center" prop="name" label="用户姓名"></el-table-column>
|
||||
<el-table-column align="center" prop="gender" label="用户性别"></el-table-column>
|
||||
<el-table-column align="center" prop="age" label="用户年龄"></el-table-column>
|
||||
<el-table-column align="center" prop="phone" label="联系电话"></el-table-column>
|
||||
<el-table-column align="center" prop="address" label="联系地址"></el-table-column>
|
||||
<el-table-column align="center" label="用户身份">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.type == 0">系统管理员</span>
|
||||
<span v-if="scope.row.type == 1">社团团长</span>
|
||||
<span v-if="scope.row.type == 2">社团成员</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作处理">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-edit"
|
||||
type="primary" size="mini" @click="showUpdWin(scope.row)"></el-button>
|
||||
<el-button icon="el-icon-delete" type="danger" size="mini"
|
||||
@click="delInfo(scope.row.id)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="pageTotal > 1" style="margin-top: 15px;" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" :current-page="pageIndex"
|
||||
:page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="totalInfo">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="修改信息" width="600px" :visible.sync="showUpdFlag">
|
||||
<el-form label-width="90px" :model="usersForm">
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户账号">
|
||||
<el-input v-model="usersForm.userName"
|
||||
placeholder="请输入用户账号…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户密码">
|
||||
<el-input v-model="usersForm.passWord" type="password"
|
||||
placeholder="请输入用户密码…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户姓名">
|
||||
<el-input v-model="usersForm.name"
|
||||
placeholder="请输入用户姓名…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户年龄">
|
||||
<el-input v-model="usersForm.age"
|
||||
placeholder="请输入用户年龄…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-radio-group v-model="usersForm.gender">
|
||||
<el-radio label="男"></el-radio>
|
||||
<el-radio label="女"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话">
|
||||
<el-input v-model="usersForm.phone"
|
||||
placeholder="请输入联系电话…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="联系地址">
|
||||
<el-input rows="4" type="textarea" v-model="usersForm.address"
|
||||
placeholder="请输入联系地址…" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="showUpdFlag = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updInfo()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPageUsers,
|
||||
addUsers,
|
||||
updUsers,
|
||||
delUsers
|
||||
} from "../../api";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
||||
return {
|
||||
pageInfos: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
pageTotal: 0,
|
||||
totalInfo: 0,
|
||||
loading: true,
|
||||
showAddFlag: false,
|
||||
showUpdFlag: false,
|
||||
qryForm: {
|
||||
userName: "",
|
||||
name: "",
|
||||
phone: "",
|
||||
},
|
||||
usersForm: {
|
||||
id: "",
|
||||
userName: "",
|
||||
passWord: "",
|
||||
name: "",
|
||||
gender: "",
|
||||
age: "",
|
||||
phone: "",
|
||||
address: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getPageInfo(pageIndex, pageSize) {
|
||||
|
||||
getPageUsers(pageIndex, pageSize).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.totalInfo = resp.data.count;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getPageLikeInfo() {
|
||||
|
||||
getPageUsers(1, this.pageSize, this.qryForm.userName, this.qryForm.name, this.qryForm.phone).then(resp => {
|
||||
|
||||
this.pageInfos = resp.data.data;
|
||||
this.pageIndex = resp.data.pageIndex;
|
||||
this.pageSize = resp.data.pageSize;
|
||||
this.totalInfo = resp.data.count;
|
||||
this.pageTotal = resp.data.pageTotal;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
|
||||
this.getPageInfo(this.pageIndex, pageSize, this.qryForm.userName, this.qryForm.name, this.qryForm.phone);
|
||||
},
|
||||
handleCurrentChange(pageIndex) {
|
||||
|
||||
this.getPageInfo(pageIndex, this.pageSize, this.qryForm.userName, this.qryForm.name, this.qryForm.phone);
|
||||
},
|
||||
initForm() {
|
||||
|
||||
this.usersForm = {
|
||||
id: "",
|
||||
userName: "",
|
||||
passWord: "",
|
||||
name: "",
|
||||
gender: "",
|
||||
age: "",
|
||||
phone: "",
|
||||
address: "",
|
||||
};
|
||||
},
|
||||
showUpdWin(row) {
|
||||
|
||||
this.usersForm = row;
|
||||
this.showUpdFlag = true;
|
||||
},
|
||||
addInfo() {
|
||||
|
||||
this.usersForm['type'] = 2;
|
||||
this.usersForm['status'] = 0;
|
||||
|
||||
addUsers(this.usersForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
|
||||
this.showAddFlag = false;
|
||||
});
|
||||
},
|
||||
updInfo() {
|
||||
|
||||
updUsers(this.usersForm).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
|
||||
this.showUpdFlag = false;
|
||||
});
|
||||
},
|
||||
delInfo(id){
|
||||
this.$confirm('即将删除相关信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
delUsers(id).then(resp => {
|
||||
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getPageInfo(1, this.pageSize);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1 @@
|
||||
server
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="server" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="server" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,68 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliArrayNamingShouldHaveBracket" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliEqualsAvoidNull" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliMissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliWrapperTypeEquality" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAbstractClassShouldStartWithAbstractNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidApacheBeanUtilsCopy" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidCallStaticSimpleDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidCommentBehindStatement" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidComplexCondition" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidConcurrentCompetitionRandom" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidDoubleOrFloatEqualCompare" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidManuallyCreateThread" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidMissUseOfMathRandom" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidNegationOperator" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidNewDateGetTime" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidPatternCompileInMethod" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidReturnInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidStartWithDollarAndUnderLineNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidUseTimer" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaBigDecimalAvoidDoubleConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaBooleanPropertyShouldNotStartWithIs" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassCastExceptionWithSubListToArrayList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassCastExceptionWithToArray" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassMustHaveAuthor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassNamingShouldBeCamel" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCollectionInitShouldAssignCapacity" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCommentsMustBeJavadocFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaConcurrentExceptionWithModifyOriginSubList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaConstantFieldShouldBeUpperCase" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCountDownShouldInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaDontModifyInForeachCircle" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaEnumConstantsMustHaveComment" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaExceptionClassShouldEndWithException" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaIbatisMethodQueryForList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaLockShouldWithTryFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaLowerCamelCaseVariableNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaMethodReturnWrapperType" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaMethodTooLong" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPackageNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoMustOverrideToString" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoMustUsePrimitiveField" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoNoDefaultValue" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaRemoveCommentedCode" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaServiceOrDaoClassShouldEndWithImpl" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSneakyThrowsWithoutExceptionType" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaStringConcat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSwitchExpression" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSwitchStatement" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaTestClassShouldEndWithTestNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadLocalShouldRemove" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadPoolCreation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadShouldSetName" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaTransactionMustHaveRollback" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUndefineMagicConstant" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUnsupportedExceptionWithModifyAsList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUseQuietReferenceNotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUseRightCaseForDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/repositories/central/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$" dumb="true">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>self.cases</groupId>
|
||||
<artifactId>server</artifactId>
|
||||
<version>1.0.0</version>
|
||||
|
||||
<!-- SpringBoot 依赖 -->
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.4.RELEASE</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<ehcache.version>3.8.1</ehcache.version>
|
||||
<druid.version>1.2.1</druid.version>
|
||||
<fastjson.version>1.2.72</fastjson.version>
|
||||
<slf4j.version>1.7.30</slf4j.version>
|
||||
<log4j2.version>2.13.3</log4j2.version>
|
||||
<mysql.version>8.0.17</mysql.version>
|
||||
<mybatis.version>3.4.2</mybatis.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- SpringBoot -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- SpringBoot Test模块 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-launcher</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- SpringBoot mybatis模块 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatis.version}</version>
|
||||
</dependency>
|
||||
<!-- SpringBoot Web模块 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringBoot log4j2模块 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
</dependency>
|
||||
<!--devtools热部署 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional>
|
||||
<scope>true</scope>
|
||||
</dependency>
|
||||
<!-- ehcache缓存 -->
|
||||
<dependency>
|
||||
<groupId>org.ehcache</groupId>
|
||||
<artifactId>ehcache</artifactId>
|
||||
<version>${ehcache.version}</version>
|
||||
</dependency>
|
||||
<!-- MySQL数据库驱动 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.version}</version>
|
||||
</dependency>
|
||||
<!-- 数据连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<!-- slf4j依赖程序 -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
</dependency>
|
||||
<!-- lo4j2依赖程序 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<!-- FastJSON 处理响应数据格式 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<!-- 设置静态资源 -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>application.yml</include>
|
||||
<include>log4j2.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
<sourceRoots>
|
||||
<root url="file://$MODULE_DIR$/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/src/main/resources" />
|
||||
</sourceRoots>
|
||||
</configuration>
|
||||
</facet>
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.16.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.6.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-launcher:1.6.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.6.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.38" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.38" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-jul:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-devtools:2.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.ehcache:ehcache:3.8.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish.jaxb:jaxb-runtime:2.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish.jaxb:txw2:2.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.istack:istack-commons-runtime:3.0.11" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.activation:jakarta.activation:1.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.72" level="project" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,78 @@
|
||||
package self.cases.teams;
|
||||
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan({"self.cases.teams.dao"})
|
||||
@EnableCaching
|
||||
public class Application implements WebMvcConfigurer{
|
||||
|
||||
/**
|
||||
* JSON格式转换器
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public HttpMessageConverters fastJsonHttpMessageConverters() {
|
||||
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
|
||||
FastJsonConfig fastJsonConfig = new FastJsonConfig();
|
||||
fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat);
|
||||
List<MediaType> fastMedisTypes = new ArrayList<>();
|
||||
fastMedisTypes.add(MediaType.APPLICATION_JSON);
|
||||
fastConverter.setSupportedMediaTypes(fastMedisTypes);
|
||||
fastConverter.setFastJsonConfig(fastJsonConfig);
|
||||
HttpMessageConverter<?> converter = fastConverter;
|
||||
return new HttpMessageConverters(converter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加MySQL分页查询
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebMvcConfigurer corsConfigurer() {
|
||||
return new WebMvcConfigurer() {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("*")
|
||||
.allowCredentials(true)
|
||||
.allowedMethods("GET", "POST", "DELETE", "PUT","PATCH")
|
||||
.maxAge(3600);
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package self.cases.teams.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import self.cases.teams.msg.R;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
/**
|
||||
* 系统控制器抽象类
|
||||
* 其他控制器需要继承这个控制器
|
||||
*/
|
||||
public abstract class BaseController {
|
||||
|
||||
protected static final String SESSION_USER = "user";
|
||||
|
||||
/**
|
||||
* 获取登录用户的信息
|
||||
* @param session 会话对象
|
||||
* @return
|
||||
*/
|
||||
protected Object getSessionUser(HttpSession session) {
|
||||
|
||||
return session.getAttribute(SESSION_USER);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将登录用户信息记录到会话对象中
|
||||
* @param session 会话对象
|
||||
* @param user 登录用户信息
|
||||
*/
|
||||
protected void setSessionUser(HttpSession session, Object user) {
|
||||
|
||||
session.setAttribute(SESSION_USER, user);
|
||||
}
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
@ResponseBody
|
||||
public R exception(Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
return R.error();
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.ActiveLogs;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 报名记录
|
||||
*/
|
||||
@Repository("activeLogsDao")
|
||||
public interface ActiveLogsDao extends BaseMapper<ActiveLogs> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.Activities;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 活动信息
|
||||
*/
|
||||
@Repository("activitiesDao")
|
||||
public interface ActivitiesDao extends BaseMapper<Activities> {
|
||||
|
||||
/**
|
||||
* 分页查看全部活动信息
|
||||
* @param page 分页信息
|
||||
* @param activeName 活动名称
|
||||
* @param teamName 团队名称
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"a.id, a.name, a.comm, a.detail, a.ask, a.total, " +
|
||||
"a.active_time activeTime, a.team_id teamId, t.name teamName " +
|
||||
"FROM activities a, teams t " +
|
||||
"<where>" +
|
||||
"a.team_id = t.id " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='activeName != null and activeName.trim() != "" '>" +
|
||||
"AND a.name LIKE CONCAT('%', #{activeName}, '%') " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY a.active_time DESC" +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryPageAll(Page<Map<String, Object>> page,
|
||||
@Param("activeName") String activeName,
|
||||
@Param("teamName") String teamName);
|
||||
|
||||
/**
|
||||
* 分页查询指定成员相关的活动信息
|
||||
* @param page 分页信息
|
||||
* @param memId 成员ID
|
||||
* @param activeName 活动名称
|
||||
* @param teamName 团队名称
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"a.id, a.name, a.comm, a.detail, a.ask, a.total, " +
|
||||
"a.active_time activeTime, a.team_id teamId, t.name teamName " +
|
||||
"FROM activities a, teams t " +
|
||||
"<where>" +
|
||||
"a.team_id = t.id AND a.team_id IN (SELECT team_id FROM members WHERE user_id = #{memId}) " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='activeName != null and activeName.trim() != "" '>" +
|
||||
"AND a.name LIKE CONCAT('%', #{activeName}, '%') " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY a.active_time DESC" +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryPageByMemId(Page<Map<String, Object>> page,
|
||||
@Param("memId") String memId,
|
||||
@Param("activeName") String activeName,
|
||||
@Param("teamName") String teamName);
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.ApplyLogs;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 申请记录
|
||||
*/
|
||||
@Repository("applyLogsDao")
|
||||
public interface ApplyLogsDao extends BaseMapper<ApplyLogs> {
|
||||
|
||||
/**
|
||||
* 分页查询申请记录
|
||||
* @param page 分页参数
|
||||
* @param userId 用户ID
|
||||
* @param teamName 社团名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"al.id, al.status, al.create_time createTime, al.team_id teamId, al.user_id userId, " +
|
||||
"t.name teamName, u.name userName, u.gender userGender, u.age userAge, u.phone userPhone " +
|
||||
"FROM apply_logs al, teams t, users u " +
|
||||
"<where> " +
|
||||
"al.user_id = u.id AND al.team_id = t.id " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userName != null and userName.trim() != "" '>" +
|
||||
"AND u.name LIKE CONCAT('%', #{userName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userId != null and userId.trim() != "" '>" +
|
||||
"AND al.user_id = #{userId} " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY al.create_time DESC " +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryPageInfo(Page<Map<String, Object>> page,
|
||||
@Param("userId") String userId,
|
||||
@Param("teamName") String teamName,
|
||||
@Param("userName") String userName);
|
||||
|
||||
/**
|
||||
* 分页查询申请记录
|
||||
* @param page 分页参数
|
||||
* @param userId 用户ID
|
||||
* @param teamName 社团名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"al.id, al.status, al.create_time createTime, al.team_id teamId, al.user_id userId, " +
|
||||
"t.name teamName, u.name userName, u.gender userGender, u.age userAge, u.phone userPhone " +
|
||||
"FROM apply_logs al, teams t, users u " +
|
||||
"<where> " +
|
||||
"al.user_id = u.id AND al.team_id = t.id " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userName != null and userName.trim() != "" '>" +
|
||||
"AND u.name LIKE CONCAT('%', #{userName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userId != null and userId.trim() != "" '>" +
|
||||
"AND (al.user_id = #{userId} OR t.manager = #{userId}) " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY al.create_time DESC " +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryManPageInfo(Page<Map<String, Object>> page,
|
||||
@Param("userId") String userId,
|
||||
@Param("teamName") String teamName,
|
||||
@Param("userName") String userName);
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.Members;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 成员信息
|
||||
*/
|
||||
@Repository("membersDao")
|
||||
public interface MembersDao extends BaseMapper<Members> {
|
||||
|
||||
/**
|
||||
* 分页查看社团成员信息
|
||||
* @param page 分页参数
|
||||
* @param teamName 社团名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"m.id, m.create_time createTime, m.team_id teamId, m.user_id userId, " +
|
||||
"t.name teamName, t.total, u.name userName, u.gender userGender, u.age userAge, u.phone userPhone " +
|
||||
"FROM members m, teams t, users u " +
|
||||
"<where> " +
|
||||
"m.user_id = u.id AND m.team_id = t.id " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userName != null and userName.trim() != "" '>" +
|
||||
"AND u.name LIKE CONCAT('%', #{userName}, '%') " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY m.create_time DESC" +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryPageAll(Page<Map<String, Object>> page,
|
||||
@Param("teamName") String teamName,
|
||||
@Param("userName") String userName);
|
||||
|
||||
/**
|
||||
* 依据社团管理员ID获取社团成员信息
|
||||
* @param page 分页参数
|
||||
* @param manId 管理员ID
|
||||
* @param teamName 社团名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"m.id, m.create_time createTime, m.team_id teamId, m.user_id userId, " +
|
||||
"t.name teamName, t.total, u.name userName, u.gender userGender, u.age userAge, u.phone userPhone " +
|
||||
"FROM members m, teams t, users u " +
|
||||
"<where> " +
|
||||
"m.user_id = u.id AND m.team_id = t.id AND t.manager = #{manId} " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userName != null and userName.trim() != "" '>" +
|
||||
"AND u.name LIKE CONCAT('%', #{userName}, '%') " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY m.create_time DESC" +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryPageByManId(Page<Map<String, Object>> page,
|
||||
@Param("manId") String manId,
|
||||
@Param("teamName") String teamName,
|
||||
@Param("userName") String userName);
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.Notices;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 通知记录
|
||||
*/
|
||||
@Repository("noticesDao")
|
||||
public interface NoticesDao extends BaseMapper<Notices> {
|
||||
|
||||
/**
|
||||
* 获取系统通知
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"id, title, detail, create_time createTime, team_id teamId " +
|
||||
"FROM notices " +
|
||||
"WHERE team_id IS NULL " +
|
||||
"ORDER BY create_time DESC " +
|
||||
"</script>")
|
||||
public List<Notices> qrySysNotices();
|
||||
|
||||
/**
|
||||
* 查询指定社团管理员相关通知信息列表
|
||||
* @param manId 社团管理ID
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"id, title, detail, create_time createTime, team_id teamId " +
|
||||
"FROM notices " +
|
||||
"WHERE (team_id IS NULL) OR (team_id IN (SELECT team_id FROM members WHERE user_id = #{manId})) " +
|
||||
"ORDER BY create_time DESC " +
|
||||
"</script>")
|
||||
public List<Notices> qryManNotices(String manId);
|
||||
|
||||
/**
|
||||
* 查询指定社团成员相关通知信息列表
|
||||
* @param memId 社团成员ID
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"id, title, detail, create_time createTime, team_id teamId " +
|
||||
"FROM notices " +
|
||||
"WHERE (team_id IS NULL) OR (team_id IN (SELECT team_id FROM members WHERE user_id = #{memId})) " +
|
||||
"ORDER BY create_time DESC " +
|
||||
"</script>")
|
||||
public List<Notices> qryMemNotices(String memId);
|
||||
|
||||
/**
|
||||
* 分页查找全部通知信息
|
||||
* @param page 分页参数
|
||||
* @param title 通知标题
|
||||
* @param teamName 团队名称
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"n.id, n.title, n.detail, n.create_time createTime, n.team_id teamId, t.name teamName " +
|
||||
"FROM notices n LEFT JOIN teams t ON n.team_id = t.id " +
|
||||
"<where>" +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='title != null and title.trim() != "" '>" +
|
||||
"AND n.title LIKE CONCAT('%', #{title}, '%') " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY n.create_time DESC " +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryPageAll(Page<Map<String, Object>> page,
|
||||
@Param("title") String title,
|
||||
@Param("teamName") String teamName);
|
||||
|
||||
/**
|
||||
* 获取指定用户相关的通知信息
|
||||
* @param page 分页参数
|
||||
* @param userId 指定用户ID
|
||||
* @param title 通知标题
|
||||
* @param teamName 团队名称
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"n.id, n.title, n.detail, n.create_time createTime, n.team_id teamId, t.name teamName " +
|
||||
"FROM notices n JOIN teams t ON n.team_id = t.id " +
|
||||
"<where>" +
|
||||
"team_id IN (SELECT team_id FROM members WHERE user_id = #{userId}) " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='title != null and title.trim() != "" '>" +
|
||||
"AND n.title LIKE CONCAT('%', #{title}, '%') " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY n.create_time DESC " +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryPageById(Page<Map<String, Object>> page,
|
||||
@Param("userId") String userId,
|
||||
@Param("title") String title,
|
||||
@Param("teamName") String teamName);
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.PayLogs;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 缴费记录
|
||||
*/
|
||||
@Repository("payLogsDao")
|
||||
public interface PayLogsDao extends BaseMapper<PayLogs> {
|
||||
|
||||
/**
|
||||
* 分页查询费用记录
|
||||
* @param page 分页参数
|
||||
* @param userId 用户ID
|
||||
* @param teamName 社团名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"pl.id, pl.create_time createTime, pl.total, pl.team_id teamId, pl.user_id userId, " +
|
||||
"t.name teamName, u.name userName, u.gender userGender, u.age userAge, u.phone userPhone " +
|
||||
"FROM pay_logs pl, teams t, users u " +
|
||||
"<where> " +
|
||||
"pl.user_id = u.id AND pl.team_id = t.id " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userName != null and userName.trim() != "" '>" +
|
||||
"AND u.name LIKE CONCAT('%', #{userName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userId != null and userId.trim() != "" '>" +
|
||||
"AND pl.user_id = #{userId} " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY pl.create_time DESC " +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryPageInfo(Page<Map<String, Object>> page,
|
||||
@Param("userId") String userId,
|
||||
@Param("teamName") String teamName,
|
||||
@Param("userName") String userName);
|
||||
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
"pl.id, pl.create_time createTime, pl.total, pl.team_id teamId, pl.user_id userId, " +
|
||||
"t.name teamName, u.name userName, u.gender userGender, u.age userAge, u.phone userPhone " +
|
||||
"FROM pay_logs pl, teams t, users u " +
|
||||
"<where> " +
|
||||
"pl.user_id = u.id AND pl.team_id = t.id " +
|
||||
"<if test='teamName != null and teamName.trim() != "" '>" +
|
||||
"AND t.name LIKE CONCAT('%', #{teamName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userName != null and userName.trim() != "" '>" +
|
||||
"AND u.name LIKE CONCAT('%', #{userName}, '%') " +
|
||||
"</if>" +
|
||||
"<if test='userId != null and userId.trim() != "" '>" +
|
||||
"AND (pl.user_id = #{userId} OR t.manager = #{userId}) " +
|
||||
"</if>" +
|
||||
"</where>" +
|
||||
"ORDER BY pl.create_time DESC " +
|
||||
"</script>")
|
||||
public Page<Map<String, Object>> qryManPageInfo(Page<Map<String, Object>> page,
|
||||
@Param("userId") String userId,
|
||||
@Param("teamName") String teamName,
|
||||
@Param("userName") String userName);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.TeamTypes;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 社团类型
|
||||
*/
|
||||
@Repository("teamTypesDao")
|
||||
public interface TeamTypesDao extends BaseMapper<TeamTypes> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.Teams;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 社团信息
|
||||
*/
|
||||
@Repository("teamsDao")
|
||||
public interface TeamsDao extends BaseMapper<Teams> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package self.cases.teams.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import self.cases.teams.entity.Users;
|
||||
|
||||
/**
|
||||
* 数据层处理接口
|
||||
* 系统用户
|
||||
*/
|
||||
@Repository("usersDao")
|
||||
public interface UsersDao extends BaseMapper<Users> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 报名记录
|
||||
*/
|
||||
@TableName(value = "active_logs")
|
||||
public class ActiveLogs implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 报名时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 活动编号
|
||||
*/
|
||||
@TableField(value = "active_id")
|
||||
private String activeId;
|
||||
|
||||
/**
|
||||
* 报名用户
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private String userId;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime(){
|
||||
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime){
|
||||
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
public String getActiveId(){
|
||||
|
||||
return activeId;
|
||||
}
|
||||
|
||||
public void setActiveId(String activeId){
|
||||
|
||||
this.activeId = activeId;
|
||||
}
|
||||
|
||||
|
||||
public String getUserId(){
|
||||
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId){
|
||||
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "ActiveLogs [id=" + id
|
||||
+ ", createTime=" + createTime
|
||||
+ ", activeId=" + activeId
|
||||
+ ", userId=" + userId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 活动信息
|
||||
*/
|
||||
@TableName(value = "activities")
|
||||
public class Activities implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 活动概述
|
||||
*/
|
||||
@TableField(value = "comm")
|
||||
private String comm;
|
||||
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
@TableField(value = "detail")
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 活动要求
|
||||
*/
|
||||
@TableField(value = "ask")
|
||||
private String ask;
|
||||
|
||||
/**
|
||||
* 报名人数
|
||||
*/
|
||||
@TableField(value = "total")
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 活动时间
|
||||
*/
|
||||
@TableField(value = "active_time")
|
||||
private String activeTime;
|
||||
|
||||
/**
|
||||
* 发布社团
|
||||
*/
|
||||
@TableField(value = "team_id")
|
||||
private String teamId;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getName(){
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name){
|
||||
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public String getComm(){
|
||||
|
||||
return comm;
|
||||
}
|
||||
|
||||
public void setComm(String comm){
|
||||
|
||||
this.comm = comm;
|
||||
}
|
||||
|
||||
|
||||
public String getDetail(){
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
public void setDetail(String detail){
|
||||
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
|
||||
public String getAsk(){
|
||||
|
||||
return ask;
|
||||
}
|
||||
|
||||
public void setAsk(String ask){
|
||||
|
||||
this.ask = ask;
|
||||
}
|
||||
|
||||
|
||||
public Integer getTotal(){
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Integer total){
|
||||
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
|
||||
public String getActiveTime(){
|
||||
|
||||
return activeTime;
|
||||
}
|
||||
|
||||
public void setActiveTime(String activeTime){
|
||||
|
||||
this.activeTime = activeTime;
|
||||
}
|
||||
|
||||
|
||||
public String getTeamId(){
|
||||
|
||||
return teamId;
|
||||
}
|
||||
|
||||
public void setTeamId(String teamId){
|
||||
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "Activities [id=" + id
|
||||
+ ", name=" + name
|
||||
+ ", comm=" + comm
|
||||
+ ", detail=" + detail
|
||||
+ ", ask=" + ask
|
||||
+ ", total=" + total
|
||||
+ ", activeTime=" + activeTime
|
||||
+ ", teamId=" + teamId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 申请记录
|
||||
*/
|
||||
@TableName(value = "apply_logs")
|
||||
public class ApplyLogs implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 处理状态
|
||||
*/
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 申请社团
|
||||
*/
|
||||
@TableField(value = "team_id")
|
||||
private String teamId;
|
||||
|
||||
/**
|
||||
* 申请用户
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private String userId;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Integer getStatus(){
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status){
|
||||
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime(){
|
||||
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime){
|
||||
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
public String getTeamId(){
|
||||
|
||||
return teamId;
|
||||
}
|
||||
|
||||
public void setTeamId(String teamId){
|
||||
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
|
||||
public String getUserId(){
|
||||
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId){
|
||||
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "ApplyLogs [id=" + id
|
||||
+ ", status=" + status
|
||||
+ ", createTime=" + createTime
|
||||
+ ", teamId=" + teamId
|
||||
+ ", userId=" + userId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 成员信息
|
||||
*/
|
||||
@TableName(value = "members")
|
||||
public class Members implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 入团时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 加入社团
|
||||
*/
|
||||
@TableField(value = "team_id")
|
||||
private String teamId;
|
||||
|
||||
/**
|
||||
* 申请用户
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private String userId;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime(){
|
||||
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime){
|
||||
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
public String getTeamId(){
|
||||
|
||||
return teamId;
|
||||
}
|
||||
|
||||
public void setTeamId(String teamId){
|
||||
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
|
||||
public String getUserId(){
|
||||
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId){
|
||||
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "Members [id=" + id
|
||||
+ ", createTime=" + createTime
|
||||
+ ", teamId=" + teamId
|
||||
+ ", userId=" + userId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 通知记录
|
||||
*/
|
||||
@TableName(value = "notices")
|
||||
public class Notices implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 通知标题
|
||||
*/
|
||||
@TableField(value = "title")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 通知详情
|
||||
*/
|
||||
@TableField(value = "detail")
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 发布社团
|
||||
*/
|
||||
@TableField(value = "team_id")
|
||||
private String teamId;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getTitle(){
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title){
|
||||
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
||||
public String getDetail(){
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
public void setDetail(String detail){
|
||||
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime(){
|
||||
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime){
|
||||
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
public String getTeamId(){
|
||||
|
||||
return teamId;
|
||||
}
|
||||
|
||||
public void setTeamId(String teamId){
|
||||
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "Notices [id=" + id
|
||||
+ ", title=" + title
|
||||
+ ", detail=" + detail
|
||||
+ ", createTime=" + createTime
|
||||
+ ", teamId=" + teamId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 缴费记录
|
||||
*/
|
||||
@TableName(value = "pay_logs")
|
||||
public class PayLogs implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 缴费时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 缴纳费用
|
||||
*/
|
||||
@TableField(value = "total")
|
||||
private Double total;
|
||||
|
||||
/**
|
||||
* 收费社团
|
||||
*/
|
||||
@TableField(value = "team_id")
|
||||
private String teamId;
|
||||
|
||||
/**
|
||||
* 缴费用户
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private String userId;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime(){
|
||||
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime){
|
||||
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
public Double getTotal(){
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Double total){
|
||||
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
|
||||
public String getTeamId(){
|
||||
|
||||
return teamId;
|
||||
}
|
||||
|
||||
public void setTeamId(String teamId){
|
||||
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
|
||||
public String getUserId(){
|
||||
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId){
|
||||
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "PayLogs [id=" + id
|
||||
+ ", createTime=" + createTime
|
||||
+ ", total=" + total
|
||||
+ ", teamId=" + teamId
|
||||
+ ", userId=" + userId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 社团类型
|
||||
*/
|
||||
@TableName(value = "team_types")
|
||||
public class TeamTypes implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private String createTime;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getName(){
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name){
|
||||
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime(){
|
||||
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime){
|
||||
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "TeamTypes [id=" + id
|
||||
+ ", name=" + name
|
||||
+ ", createTime=" + createTime
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 社团信息
|
||||
*/
|
||||
@TableName(value = "teams")
|
||||
public class Teams implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 社团名称
|
||||
*/
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 建立时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 社团人数
|
||||
*/
|
||||
@TableField(value = "total")
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 社团团长
|
||||
*/
|
||||
@TableField(value = "manager")
|
||||
private String manager;
|
||||
|
||||
/**
|
||||
* 社团编号
|
||||
*/
|
||||
@TableField(value = "type_id")
|
||||
private String typeId;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getName(){
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name){
|
||||
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime(){
|
||||
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime){
|
||||
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
public Integer getTotal(){
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Integer total){
|
||||
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
|
||||
public String getManager(){
|
||||
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setManager(String manager){
|
||||
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
|
||||
public String getTypeId(){
|
||||
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(String typeId){
|
||||
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "Teams [id=" + id
|
||||
+ ", name=" + name
|
||||
+ ", createTime=" + createTime
|
||||
+ ", total=" + total
|
||||
+ ", manager=" + manager
|
||||
+ ", typeId=" + typeId
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,223 @@
|
||||
package self.cases.teams.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据实体类
|
||||
* 系统用户
|
||||
*/
|
||||
@TableName(value = "users")
|
||||
public class Users implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@TableField(value = "user_name")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
@TableField(value = "pass_word")
|
||||
private String passWord;
|
||||
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
*/
|
||||
@TableField(value = "gender")
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 用户年龄
|
||||
*/
|
||||
@TableField(value = "age")
|
||||
private Integer age;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@TableField(value = "phone")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 联系地址
|
||||
*/
|
||||
@TableField(value = "address")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 信息状态
|
||||
*/
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 用户身份
|
||||
*/
|
||||
@TableField(value = "type")
|
||||
private Integer type;
|
||||
|
||||
|
||||
public String getId(){
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id){
|
||||
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getUserName(){
|
||||
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName){
|
||||
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
|
||||
public String getPassWord(){
|
||||
|
||||
return passWord;
|
||||
}
|
||||
|
||||
public void setPassWord(String passWord){
|
||||
|
||||
this.passWord = passWord;
|
||||
}
|
||||
|
||||
|
||||
public String getName(){
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name){
|
||||
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public String getGender(){
|
||||
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender){
|
||||
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
|
||||
public Integer getAge(){
|
||||
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(Integer age){
|
||||
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
|
||||
public String getPhone(){
|
||||
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone){
|
||||
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
|
||||
public String getAddress(){
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address){
|
||||
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
|
||||
public Integer getStatus(){
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status){
|
||||
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime(){
|
||||
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime){
|
||||
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
public Integer getType(){
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type){
|
||||
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return "Users [id=" + id
|
||||
+ ", userName=" + userName
|
||||
+ ", passWord=" + passWord
|
||||
+ ", name=" + name
|
||||
+ ", gender=" + gender
|
||||
+ ", age=" + age
|
||||
+ ", phone=" + phone
|
||||
+ ", address=" + address
|
||||
+ ", status=" + status
|
||||
+ ", createTime=" + createTime
|
||||
+ ", type=" + type
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package self.cases.teams.handle;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import self.cases.teams.entity.Users;
|
||||
|
||||
/**
|
||||
* 缓存处理
|
||||
*/
|
||||
@Component("cacheHandle")
|
||||
public class CacheHandle {
|
||||
|
||||
@Autowired
|
||||
private CacheManager cacheManager;
|
||||
|
||||
private final String USER_KEY = "users";
|
||||
|
||||
/**
|
||||
* 获取用户缓存对象
|
||||
* @return
|
||||
*/
|
||||
public Cache getUserCache(){
|
||||
|
||||
Cache cache = cacheManager.getCache(USER_KEY);
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储登录用户信息
|
||||
* @param key 缓存用户 token
|
||||
* @param val 登录用户 信息
|
||||
*/
|
||||
public void addUserCache(String key, Object val) {
|
||||
|
||||
Cache cache = getUserCache();
|
||||
|
||||
cache.put(key, val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除缓存登录用户信息
|
||||
* @param key 缓存用户 token
|
||||
*/
|
||||
public void removeUserCache(String key){
|
||||
|
||||
Cache cache = getUserCache();
|
||||
|
||||
cache.evict(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存的登录用户信息
|
||||
* @param key 缓存用户 token
|
||||
* @return
|
||||
*/
|
||||
public String getUserInfoCache(String key){
|
||||
|
||||
Cache cache = getUserCache();
|
||||
|
||||
String userId = cache.get(key, String.class);
|
||||
|
||||
return userId;
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package self.cases.teams.msg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PageData {
|
||||
|
||||
// 当前页码
|
||||
private Long pageIndex;
|
||||
|
||||
// 每页数据量
|
||||
private Long pageSize;
|
||||
|
||||
// 查询的总页数
|
||||
private Long pageTotal;
|
||||
|
||||
// 符合条件的总记录数
|
||||
private Long count;
|
||||
|
||||
// 分页查询包含的结果集
|
||||
private List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
|
||||
|
||||
public Long getPageIndex() {
|
||||
return pageIndex;
|
||||
}
|
||||
|
||||
public void setPageIndex(Long pageIndex) {
|
||||
this.pageIndex = pageIndex;
|
||||
}
|
||||
|
||||
public Long getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Long pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Long getPageTotal() {
|
||||
return pageTotal;
|
||||
}
|
||||
|
||||
public void setPageTotal(Long pageTotal) {
|
||||
this.pageTotal = pageTotal;
|
||||
}
|
||||
|
||||
public Long getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(long count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<Map<String, Object>> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public PageData() {
|
||||
|
||||
super();
|
||||
}
|
||||
|
||||
public PageData(Long pageIndex, Long pageSize, Long count, List<Map<String, Object>> data) {
|
||||
|
||||
this.pageIndex = pageIndex;
|
||||
this.pageSize = pageSize;
|
||||
this.count = count;
|
||||
|
||||
this.data = (data != null && data.size() > 0) ? data : this.data;
|
||||
|
||||
if(count > 0){
|
||||
|
||||
this.pageTotal = (count % pageSize) == 0 ? (count / pageSize) : (count / pageSize + 1);
|
||||
}else {
|
||||
|
||||
this.pageTotal = 0L;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Page [pageIndex=" + pageIndex + ", pageSize=" + pageSize + ", pageTotal=" + pageTotal + ", count="
|
||||
+ count + ", data=" + data + "]";
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.ActiveLogs;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 报名记录
|
||||
*/
|
||||
public interface ActiveLogsService extends BaseService<ActiveLogs, String> {
|
||||
|
||||
/**
|
||||
* 用户是否参与活动
|
||||
* @param activeId 指定活动ID
|
||||
* @param userId 指定用户ID
|
||||
* @return
|
||||
*/
|
||||
public Boolean isActive(String activeId, String userId);
|
||||
|
||||
/**
|
||||
* 依据活动ID获取报名列表
|
||||
* @param activeId 活动ID
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> getListByActiveId(String activeId);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.Activities;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 活动信息
|
||||
*/
|
||||
public interface ActivitiesService extends BaseService<Activities, String> {
|
||||
|
||||
/**
|
||||
* 分页查询活动信息信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param activeName 活动名称
|
||||
* @param teamName 团队名称
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageAll(Long pageIndex, Long pageSize, String activeName, String teamName);
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询指定成员相关活动信息信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param userId 指定成员ID
|
||||
* @param activeName 活动名称
|
||||
* @param teamName 团队名称
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageByUserId(Long pageIndex, Long pageSize, String userId, String activeName, String teamName);
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.ApplyLogs;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 申请记录
|
||||
*/
|
||||
public interface ApplyLogsService extends BaseService<ApplyLogs, String> {
|
||||
|
||||
/**
|
||||
* 检查用户是否可以提交申请
|
||||
* @param userId 用户ID
|
||||
* @param teamId 团队ID
|
||||
* @return
|
||||
*/
|
||||
public Boolean isApply(String userId, String teamId);
|
||||
|
||||
/**
|
||||
* 团队管理员分页查询申请记录信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param userId 用户编号
|
||||
* @param teamName 团队名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
public PageData getManPageInfo(Long pageIndex, Long pageSize, String userId, String teamName, String userName);
|
||||
|
||||
/**
|
||||
* 分页查询申请记录信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param userId 用户编号
|
||||
* @param teamName 团队名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, String userId, String teamName, String userName);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
/**
|
||||
* 业务层处理父级接口
|
||||
* @param <T> 操作实体类
|
||||
* @param <Pk> 主键列类型
|
||||
*/
|
||||
public interface BaseService<T, Pk> {
|
||||
|
||||
/**
|
||||
* 添加数据
|
||||
* @param t 要添加的实体信息
|
||||
*/
|
||||
public void add(T t);
|
||||
|
||||
/**
|
||||
* 更新数据
|
||||
* @param t 要更新的实体信息
|
||||
*/
|
||||
public void update(T t);
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param t 要删除的实体信息
|
||||
*/
|
||||
public void delete(T t);
|
||||
|
||||
/**
|
||||
* 依据编号查询实体信息
|
||||
* @param id 实体编号
|
||||
* @return 指定编号的实体信息
|
||||
*/
|
||||
public T getOne(Pk id);
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.Members;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 成员信息
|
||||
*/
|
||||
public interface MembersService extends BaseService<Members, String> {
|
||||
|
||||
/**
|
||||
* 指定用户是否是管理员
|
||||
* @param userId 指定用户ID
|
||||
* @param teamId 团队ID
|
||||
* @return
|
||||
*/
|
||||
public Boolean isManager(String teamId, String userId);
|
||||
|
||||
/**
|
||||
* 分页查询成员信息信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param teamName 社团名称
|
||||
* @param userName 成员姓名
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageAll(Long pageIndex, Long pageSize, String teamName, String userName);
|
||||
|
||||
/**
|
||||
* 分页查询成员信息信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param manId 管理员ID
|
||||
* @param teamName 社团名称
|
||||
* @param userName 成员姓名
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageByManId(Long pageIndex, Long pageSize, String manId, String teamName, String userName);
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.Notices;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 通知记录
|
||||
*/
|
||||
public interface NoticesService extends BaseService<Notices, String> {
|
||||
|
||||
/**
|
||||
* 获取系统发布的通知信息
|
||||
* @return
|
||||
*/
|
||||
public List<Notices> getSysNotices();
|
||||
|
||||
/**
|
||||
* 获取社团管理员相关的通知信息
|
||||
* @param manId 社团管理员ID
|
||||
* @return
|
||||
*/
|
||||
public List<Notices> getManNotices(String manId);
|
||||
|
||||
/**
|
||||
* 获取社团成员相关通知信息
|
||||
* @param memId 社团成员ID
|
||||
* @return
|
||||
*/
|
||||
public List<Notices> getMemNotices(String memId);
|
||||
|
||||
/**
|
||||
* 分页查询通知记录信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param title 通知标题
|
||||
* @param teamName 社团名称
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageAll(Long pageIndex, Long pageSize, String title, String teamName);
|
||||
|
||||
/**
|
||||
* 分页查询指定用户相关通知记录信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param userId 用户ID
|
||||
* @param title 通知标题
|
||||
* @param teamName 社团名称
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageById(Long pageIndex, Long pageSize, String userId, String title, String teamName);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.PayLogs;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 缴费记录
|
||||
*/
|
||||
public interface PayLogsService extends BaseService<PayLogs, String> {
|
||||
|
||||
/**
|
||||
* 团队管理员分页查询缴费记录信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param userId 用户编号
|
||||
* @param teamName 团队名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
public PageData getManPageInfo(Long pageIndex, Long pageSize, String userId, String teamName, String userName);
|
||||
|
||||
/**
|
||||
* 分页查询缴费记录信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param userId 用户编号
|
||||
* @param teamName 团队名称
|
||||
* @param userName 用户姓名
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, String userId, String teamName, String userName);
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.TeamTypes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 社团类型
|
||||
*/
|
||||
public interface TeamTypesService extends BaseService<TeamTypes, String> {
|
||||
|
||||
/**
|
||||
* 检查指定的社团类型是否可以删除
|
||||
* 如果存在关联社团不能删除
|
||||
* @param typeId 社团ID
|
||||
* @return
|
||||
*/
|
||||
public Boolean isRemove(String typeId);
|
||||
|
||||
/**
|
||||
* 获取全部的社团类型信息
|
||||
* @return
|
||||
*/
|
||||
public List<TeamTypes> getAll();
|
||||
|
||||
/**
|
||||
* 分页查询社团类型信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param teamTypes 模糊查询条件
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, TeamTypes teamTypes);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.Teams;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 社团信息
|
||||
*/
|
||||
public interface TeamsService extends BaseService<Teams, String> {
|
||||
|
||||
/**
|
||||
* 获取全部的社团信息列表
|
||||
* @return
|
||||
*/
|
||||
public List<Teams> getAll();
|
||||
|
||||
/**
|
||||
* 获取指定管理人员相关的社团列表
|
||||
* @param manId 指定管理员编号
|
||||
* @return
|
||||
*/
|
||||
public List<Teams> getListByManId(String manId);
|
||||
|
||||
/**
|
||||
* 分页查询社团信息信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param teams 模糊查询条件
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, Teams teams);
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package self.cases.teams.service;
|
||||
|
||||
|
||||
import self.cases.teams.msg.PageData;
|
||||
|
||||
import self.cases.teams.entity.Users;
|
||||
|
||||
/**
|
||||
* 业务层处理
|
||||
* 系统用户
|
||||
*/
|
||||
public interface UsersService extends BaseService<Users, String> {
|
||||
|
||||
/**
|
||||
* 检查指定的用户是否可以删除
|
||||
* 当用户不是社团成员可以进行删除
|
||||
* @param userId 用户ID
|
||||
* @return
|
||||
*/
|
||||
public Boolean isRemove(String userId);
|
||||
|
||||
/**
|
||||
* 依据用户名获取用户信息
|
||||
* @param userName 用户账号
|
||||
* @return
|
||||
*/
|
||||
public Users getUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 分页查询系统用户信息
|
||||
* @param pageIndex 当前页码
|
||||
* @param pageSize 每页数据量
|
||||
* @param users 模糊查询条件
|
||||
* @return
|
||||
*/
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, Users users);
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.ActivitiesDao;
|
||||
import self.cases.teams.dao.UsersDao;
|
||||
import self.cases.teams.entity.Activities;
|
||||
import self.cases.teams.entity.Users;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.entity.ActiveLogs;
|
||||
import self.cases.teams.dao.ActiveLogsDao;
|
||||
import self.cases.teams.service.ActiveLogsService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("activeLogsService")
|
||||
public class ActiveLogsServiceImpl implements ActiveLogsService {
|
||||
|
||||
@Autowired
|
||||
private UsersDao usersDao;
|
||||
|
||||
@Autowired
|
||||
private ActiveLogsDao activeLogsDao;
|
||||
|
||||
@Autowired
|
||||
private ActivitiesDao activitiesDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(ActiveLogs activeLogs) {
|
||||
|
||||
Activities activitie = activitiesDao.selectById(activeLogs.getActiveId());
|
||||
activitie.setTotal(activitie.getTotal() + 1);
|
||||
activitiesDao.updateById(activitie);
|
||||
|
||||
activeLogsDao.insert(activeLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(ActiveLogs activeLogs) {
|
||||
|
||||
activeLogsDao.updateById(activeLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(ActiveLogs activeLogs) {
|
||||
|
||||
activeLogsDao.deleteById(activeLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Boolean isActive(String activeId, String userId){
|
||||
|
||||
QueryWrapper<ActiveLogs> qw = new QueryWrapper<ActiveLogs>();
|
||||
qw.eq("active_id", activeId);
|
||||
qw.eq("user_id", userId);
|
||||
|
||||
return activeLogsDao.selectCount(qw) <= 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public ActiveLogs getOne(String id) {
|
||||
|
||||
ActiveLogs activeLogs = activeLogsDao.selectById(id);
|
||||
|
||||
return activeLogs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public List<Map<String, Object>> getListByActiveId(String activeId){
|
||||
|
||||
List<Map<String, Object>> resl = new ArrayList<Map<String, Object>>();
|
||||
|
||||
QueryWrapper<ActiveLogs> qw = new QueryWrapper<ActiveLogs>();
|
||||
qw.eq("active_id", activeId);
|
||||
qw.orderByDesc("create_time");
|
||||
|
||||
List<ActiveLogs> activeLogs = activeLogsDao.selectList(qw);
|
||||
|
||||
for (ActiveLogs activeLog : activeLogs) {
|
||||
|
||||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("id", activeLog.getId());
|
||||
temp.put("createTime", activeLog.getCreateTime());
|
||||
temp.put("activeId", activeLog.getActiveId());
|
||||
|
||||
Users user = usersDao.selectById(activeLog.getUserId());
|
||||
temp.put("userId", activeLog.getUserId());
|
||||
temp.put("userName", user.getName());
|
||||
temp.put("userGender", user.getGender());
|
||||
temp.put("userPhone", user.getPhone());
|
||||
|
||||
resl.add(temp);
|
||||
}
|
||||
|
||||
return resl;
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.ActiveLogsDao;
|
||||
import self.cases.teams.dao.TeamsDao;
|
||||
import self.cases.teams.entity.ActiveLogs;
|
||||
import self.cases.teams.entity.Teams;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.entity.Activities;
|
||||
import self.cases.teams.dao.ActivitiesDao;
|
||||
import self.cases.teams.service.ActivitiesService;
|
||||
import self.cases.teams.utils.DateUtils;
|
||||
import self.cases.teams.utils.IDUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("activitiesService")
|
||||
public class ActivitiesServiceImpl implements ActivitiesService {
|
||||
|
||||
@Autowired
|
||||
private TeamsDao teamsDao;
|
||||
|
||||
@Autowired
|
||||
private ActiveLogsDao activeLogsDao;
|
||||
|
||||
@Autowired
|
||||
private ActivitiesDao activitiesDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(Activities activities) {
|
||||
|
||||
activitiesDao.insert(activities);
|
||||
|
||||
Teams teams = teamsDao.selectById(activities.getTeamId());
|
||||
|
||||
ActiveLogs activeLog = new ActiveLogs();
|
||||
activeLog.setId(IDUtils.makeIDByCurrent());
|
||||
activeLog.setActiveId(activities.getId());
|
||||
activeLog.setUserId(teams.getManager());
|
||||
activeLog.setCreateTime(DateUtils.getNowDate());
|
||||
activeLogsDao.insert(activeLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(Activities activities) {
|
||||
|
||||
activitiesDao.updateById(activities);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Activities activities) {
|
||||
|
||||
QueryWrapper<ActiveLogs> qw = new QueryWrapper<ActiveLogs>();
|
||||
qw.eq("active_id", activities.getId());
|
||||
activeLogsDao.delete(qw);
|
||||
|
||||
activitiesDao.deleteById(activities);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Activities getOne(String id) {
|
||||
|
||||
Activities activities = activitiesDao.selectById(id);
|
||||
|
||||
return activities;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageAll(Long pageIndex, Long pageSize, String activeName, String teamName) {
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
activitiesDao.qryPageAll(new Page<Map<String, Object>>(pageIndex, pageSize), activeName, teamName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageByUserId(Long pageIndex, Long pageSize, String userId, String activeName, String teamName) {
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
activitiesDao.qryPageByMemId(new Page<Map<String, Object>>(pageIndex, pageSize), userId, activeName, teamName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化分页查询的结果
|
||||
*/
|
||||
public PageData parsePage(Page<Map<String, Object>> p) {
|
||||
|
||||
PageData pageData = new PageData(p.getCurrent(), p.getSize(), p.getTotal(), p.getRecords());
|
||||
|
||||
return pageData;
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.MembersDao;
|
||||
import self.cases.teams.dao.TeamsDao;
|
||||
import self.cases.teams.entity.Members;
|
||||
import self.cases.teams.entity.Teams;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.entity.ApplyLogs;
|
||||
import self.cases.teams.dao.ApplyLogsDao;
|
||||
import self.cases.teams.service.ApplyLogsService;
|
||||
import self.cases.teams.utils.DateUtils;
|
||||
import self.cases.teams.utils.IDUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("applyLogsService")
|
||||
public class ApplyLogsServiceImpl implements ApplyLogsService {
|
||||
|
||||
@Autowired
|
||||
private MembersDao membersDao;
|
||||
|
||||
@Autowired
|
||||
private ApplyLogsDao applyLogsDao;
|
||||
|
||||
@Autowired
|
||||
private TeamsDao teamsDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(ApplyLogs applyLogs) {
|
||||
|
||||
applyLogsDao.insert(applyLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(ApplyLogs applyLogs) {
|
||||
|
||||
if(applyLogs.getStatus() != null && applyLogs.getStatus() == 1){
|
||||
|
||||
Members member = new Members();
|
||||
member.setId(IDUtils.makeIDByCurrent());
|
||||
member.setCreateTime(DateUtils.getNowDate());
|
||||
member.setUserId(applyLogs.getUserId());
|
||||
member.setTeamId(applyLogs.getTeamId());
|
||||
|
||||
membersDao.insert(member);
|
||||
|
||||
Teams teams = teamsDao.selectById(applyLogs.getTeamId());
|
||||
teams.setTotal(teams.getTotal() + 1);
|
||||
teamsDao.updateById(teams);
|
||||
}
|
||||
|
||||
applyLogsDao.updateById(applyLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(ApplyLogs applyLogs) {
|
||||
|
||||
applyLogsDao.deleteById(applyLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Boolean isApply(String userId, String teamId){
|
||||
|
||||
QueryWrapper<ApplyLogs> qw = new QueryWrapper<ApplyLogs>();
|
||||
qw.eq("user_id", userId);
|
||||
qw.eq("team_id", teamId);
|
||||
qw.eq("status", 0);
|
||||
|
||||
return applyLogsDao.selectCount(qw) <= 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public ApplyLogs getOne(String id) {
|
||||
|
||||
ApplyLogs applyLogs = applyLogsDao.selectById(id);
|
||||
|
||||
return applyLogs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getManPageInfo(Long pageIndex, Long pageSize, String userId, String teamName, String userName) {
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
applyLogsDao.qryManPageInfo(new Page<Map<String, Object>>(pageIndex, pageSize), userId, teamName, userName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, String userId, String teamName, String userName) {
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
applyLogsDao.qryPageInfo(new Page<Map<String, Object>>(pageIndex, pageSize), userId, teamName, userName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化分页查询的结果
|
||||
*/
|
||||
public PageData parsePage(Page<Map<String, Object>> p) {
|
||||
|
||||
PageData pageData = new PageData(p.getCurrent(), p.getSize(), p.getTotal(), p.getRecords());
|
||||
|
||||
return pageData;
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.*;
|
||||
import self.cases.teams.entity.*;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.service.MembersService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("membersService")
|
||||
public class MembersServiceImpl implements MembersService {
|
||||
|
||||
@Autowired
|
||||
private TeamsDao teamsDao;
|
||||
|
||||
@Autowired
|
||||
private MembersDao membersDao;
|
||||
|
||||
@Autowired
|
||||
private PayLogsDao payLogsDao;
|
||||
|
||||
@Autowired
|
||||
private ActiveLogsDao activeLogsDao;
|
||||
|
||||
@Autowired
|
||||
private ApplyLogsDao applyLogsDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(Members members) {
|
||||
|
||||
membersDao.insert(members);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(Members members) {
|
||||
|
||||
membersDao.updateById(members);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Members members) {
|
||||
|
||||
QueryWrapper<PayLogs> qw_pay = new QueryWrapper<PayLogs>();
|
||||
qw_pay.eq("user_id", members.getUserId());
|
||||
payLogsDao.delete(qw_pay);
|
||||
|
||||
QueryWrapper<ActiveLogs> qw_active = new QueryWrapper<ActiveLogs>();
|
||||
qw_active.eq("user_id", members.getUserId());
|
||||
activeLogsDao.delete(qw_active);
|
||||
|
||||
QueryWrapper<ApplyLogs> qw_apply = new QueryWrapper<ApplyLogs>();
|
||||
qw_apply.eq("user_id", members.getUserId());
|
||||
applyLogsDao.delete(qw_apply);
|
||||
|
||||
membersDao.deleteById(members);
|
||||
|
||||
Teams team = teamsDao.selectById(members.getTeamId());
|
||||
team.setTotal(team.getTotal() - 1);
|
||||
teamsDao.updateById(team);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Members getOne(String id) {
|
||||
|
||||
Members members = membersDao.selectById(id);
|
||||
|
||||
return members;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Boolean isManager(String teamId, String userId){
|
||||
|
||||
QueryWrapper<Teams> qw = new QueryWrapper<Teams>();
|
||||
qw.eq("manager", userId);
|
||||
qw.eq("id", teamId);
|
||||
|
||||
return teamsDao.selectCount(qw) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageAll(Long pageIndex, Long pageSize, String teamName, String userName) {
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
membersDao.qryPageAll(new Page<Map<String, Object>>(pageIndex, pageSize), teamName, userName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageByManId(Long pageIndex, Long pageSize, String manId, String teamName, String userName) {
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
membersDao.qryPageByManId(new Page<Map<String, Object>>(pageIndex, pageSize), manId, teamName, userName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化分页查询的结果
|
||||
*/
|
||||
public PageData parsePage(Page<Map<String, Object>> p) {
|
||||
|
||||
PageData pageData = new PageData(p.getCurrent(), p.getSize(), p.getTotal(), p.getRecords());
|
||||
|
||||
return pageData;
|
||||
}
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.TeamsDao;
|
||||
import self.cases.teams.entity.Teams;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.entity.Notices;
|
||||
import self.cases.teams.dao.NoticesDao;
|
||||
import self.cases.teams.service.NoticesService;
|
||||
import self.cases.teams.utils.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("noticesService")
|
||||
public class NoticesServiceImpl implements NoticesService {
|
||||
|
||||
@Autowired
|
||||
private NoticesDao noticesDao;
|
||||
|
||||
@Autowired
|
||||
private TeamsDao teamsDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(Notices notices) {
|
||||
|
||||
noticesDao.insert(notices);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(Notices notices) {
|
||||
|
||||
noticesDao.updateById(notices);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Notices notices) {
|
||||
|
||||
noticesDao.deleteById(notices);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Notices getOne(String id) {
|
||||
|
||||
Notices notices = noticesDao.selectById(id);
|
||||
|
||||
return notices;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public List<Notices> getSysNotices(){
|
||||
|
||||
List<Notices> list = noticesDao.qrySysNotices();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public List<Notices> getManNotices(String manId){
|
||||
|
||||
List<Notices> list = noticesDao.qryManNotices(manId);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public List<Notices> getMemNotices(String memId){
|
||||
|
||||
List<Notices> list = noticesDao.qryMemNotices(memId);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageAll(Long pageIndex, Long pageSize, String title, String teamName){
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
noticesDao.qryPageAll(new Page<Map<String, Object>>(pageIndex, pageSize), title, teamName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageById(Long pageIndex, Long pageSize, String userId, String title, String teamName){
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
noticesDao.qryPageById(new Page<Map<String, Object>>(pageIndex, pageSize), userId, title, teamName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表结果转换
|
||||
* @param notices
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> parseList(List<Notices> notices){
|
||||
|
||||
List<Map<String, Object>> resl = new ArrayList<Map<String, Object>>();
|
||||
|
||||
for (Notices notice : notices) {
|
||||
|
||||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("id", notice.getId());
|
||||
temp.put("title", notice.getTitle());
|
||||
temp.put("detail", notice.getDetail());
|
||||
temp.put("createTime", notice.getCreateTime());
|
||||
|
||||
if(StringUtils.isNotNullOrEmpty(notice.getTeamId())){
|
||||
|
||||
Teams teams = teamsDao.selectById(notice.getTeamId());
|
||||
temp.put("teamId", notice.getTeamId());
|
||||
temp.put("teamName", teams.getName());
|
||||
temp.put("isTeam", true);
|
||||
}else{
|
||||
|
||||
temp.put("isTeam", false);
|
||||
}
|
||||
|
||||
resl.add(temp);
|
||||
}
|
||||
|
||||
return resl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化分页查询的结果
|
||||
*/
|
||||
public PageData parsePage(Page<Map<String, Object>> p) {
|
||||
|
||||
PageData pageData = new PageData(p.getCurrent(), p.getSize(), p.getTotal(), p.getRecords());
|
||||
|
||||
return pageData;
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.TeamsDao;
|
||||
import self.cases.teams.dao.UsersDao;
|
||||
import self.cases.teams.entity.Teams;
|
||||
import self.cases.teams.entity.Users;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.entity.PayLogs;
|
||||
import self.cases.teams.dao.PayLogsDao;
|
||||
import self.cases.teams.service.PayLogsService;
|
||||
import self.cases.teams.utils.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("payLogsService")
|
||||
public class PayLogsServiceImpl implements PayLogsService {
|
||||
|
||||
@Autowired
|
||||
private PayLogsDao payLogsDao;
|
||||
|
||||
@Autowired
|
||||
private TeamsDao teamsDao;
|
||||
|
||||
@Autowired
|
||||
private UsersDao usersDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(PayLogs payLogs) {
|
||||
|
||||
payLogsDao.insert(payLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(PayLogs payLogs) {
|
||||
|
||||
payLogsDao.updateById(payLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(PayLogs payLogs) {
|
||||
|
||||
payLogsDao.deleteById(payLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PayLogs getOne(String id) {
|
||||
|
||||
PayLogs payLogs = payLogsDao.selectById(id);
|
||||
|
||||
return payLogs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getManPageInfo(Long pageIndex, Long pageSize, String userId, String teamName, String userName) {
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
payLogsDao.qryManPageInfo(new Page<Map<String, Object>>(pageIndex, pageSize), userId, teamName, userName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, String userId, String teamName, String userName) {
|
||||
|
||||
Page<Map<String, Object>> page =
|
||||
payLogsDao.qryPageInfo(new Page<Map<String, Object>>(pageIndex, pageSize), userId, teamName, userName);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化分页查询的结果
|
||||
*/
|
||||
public PageData parsePage(Page<Map<String, Object>> p) {
|
||||
|
||||
PageData pageData = new PageData(p.getCurrent(), p.getSize(), p.getTotal(), p.getRecords());
|
||||
|
||||
return pageData;
|
||||
}
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.TeamsDao;
|
||||
import self.cases.teams.entity.Teams;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.entity.TeamTypes;
|
||||
import self.cases.teams.dao.TeamTypesDao;
|
||||
import self.cases.teams.service.TeamTypesService;
|
||||
import self.cases.teams.utils.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("teamTypesService")
|
||||
public class TeamTypesServiceImpl implements TeamTypesService {
|
||||
|
||||
@Autowired
|
||||
private TeamTypesDao teamTypesDao;
|
||||
|
||||
@Autowired
|
||||
private TeamsDao teamsDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(TeamTypes teamTypes) {
|
||||
|
||||
teamTypesDao.insert(teamTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(TeamTypes teamTypes) {
|
||||
|
||||
teamTypesDao.updateById(teamTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(TeamTypes teamTypes) {
|
||||
|
||||
teamTypesDao.deleteById(teamTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Boolean isRemove(String typeId){
|
||||
|
||||
QueryWrapper<Teams> qw = new QueryWrapper<Teams>();
|
||||
qw.eq("type_id", typeId);
|
||||
|
||||
return teamsDao.selectCount(qw) <= 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public TeamTypes getOne(String id) {
|
||||
|
||||
QueryWrapper<TeamTypes> qw = new QueryWrapper<TeamTypes>();
|
||||
qw.orderByDesc("create_time");
|
||||
|
||||
TeamTypes teamTypes = teamTypesDao.selectById(id);
|
||||
|
||||
return teamTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public List<TeamTypes> getAll() {
|
||||
|
||||
List<TeamTypes> list = teamTypesDao.selectList(null);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, TeamTypes teamTypes) {
|
||||
|
||||
QueryWrapper<TeamTypes> qw = new QueryWrapper<TeamTypes>();
|
||||
|
||||
if (StringUtils.isNotNullOrEmpty(teamTypes.getName())) {
|
||||
|
||||
qw.like("name", teamTypes.getName());
|
||||
}
|
||||
|
||||
qw.orderByDesc("create_time");
|
||||
|
||||
Page<TeamTypes> page =
|
||||
teamTypesDao.selectPage(new Page<TeamTypes>(pageIndex, pageSize), qw);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化分页查询的结果
|
||||
*/
|
||||
public PageData parsePage(Page<TeamTypes> p) {
|
||||
|
||||
List<Map<String, Object>> resl = new ArrayList<Map<String, Object>>();
|
||||
|
||||
for (TeamTypes teamTypes : p.getRecords()) {
|
||||
|
||||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("id", teamTypes.getId());
|
||||
temp.put("name", teamTypes.getName());
|
||||
temp.put("createTime", teamTypes.getCreateTime());
|
||||
resl.add(temp);
|
||||
}
|
||||
|
||||
PageData pageData = new PageData(p.getCurrent(), p.getSize(), p.getTotal(), resl);
|
||||
|
||||
return pageData;
|
||||
}
|
||||
}
|
@ -0,0 +1,216 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.*;
|
||||
import self.cases.teams.entity.*;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.service.TeamsService;
|
||||
import self.cases.teams.utils.DateUtils;
|
||||
import self.cases.teams.utils.IDUtils;
|
||||
import self.cases.teams.utils.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("teamsService")
|
||||
public class TeamsServiceImpl implements TeamsService {
|
||||
|
||||
@Autowired
|
||||
private UsersDao usersDao;
|
||||
|
||||
@Autowired
|
||||
private TeamTypesDao teamTypesDao;
|
||||
|
||||
@Autowired
|
||||
private TeamsDao teamsDao;
|
||||
|
||||
@Autowired
|
||||
private MembersDao membersDao;
|
||||
|
||||
@Autowired
|
||||
private NoticesDao noticesDao;
|
||||
|
||||
@Autowired
|
||||
private ActivitiesDao activitiesDao;
|
||||
|
||||
@Autowired
|
||||
private ActiveLogsDao activeLogsDao;
|
||||
|
||||
@Autowired
|
||||
private ApplyLogsDao applyLogsDao;
|
||||
|
||||
@Autowired
|
||||
private PayLogsDao payLogsDao;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(Teams teams) {
|
||||
|
||||
teamsDao.insert(teams);
|
||||
|
||||
Members member = new Members();
|
||||
member.setId(IDUtils.makeIDByCurrent());
|
||||
member.setUserId(teams.getManager());
|
||||
member.setTeamId(teams.getId());
|
||||
member.setCreateTime(DateUtils.getNowDate());
|
||||
membersDao.insert(member);
|
||||
|
||||
Users user = usersDao.selectById(teams.getManager());
|
||||
user.setType(1);
|
||||
usersDao.updateById(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(Teams teams) {
|
||||
|
||||
teamsDao.updateById(teams);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Teams teams) {
|
||||
|
||||
QueryWrapper<Notices> qw_notice = new QueryWrapper<Notices>();
|
||||
qw_notice.eq("team_id", teams.getId());
|
||||
noticesDao.delete(qw_notice);
|
||||
|
||||
QueryWrapper<PayLogs> qw_pay = new QueryWrapper<PayLogs>();
|
||||
qw_pay.eq("team_id", teams.getId());
|
||||
payLogsDao.delete(qw_pay);
|
||||
|
||||
QueryWrapper<ApplyLogs> qw_apply = new QueryWrapper<ApplyLogs>();
|
||||
qw_apply.eq("team_id", teams.getId());
|
||||
applyLogsDao.delete(qw_apply);
|
||||
|
||||
QueryWrapper<Members> qw_members = new QueryWrapper<Members>();
|
||||
qw_members.eq("team_id", teams.getId());
|
||||
membersDao.delete(qw_members);
|
||||
|
||||
QueryWrapper<Activities> qw_active = new QueryWrapper<Activities>();
|
||||
qw_active.eq("team_id", teams.getId());
|
||||
for(Activities activitie : activitiesDao.selectList(qw_active)){
|
||||
|
||||
QueryWrapper<ActiveLogs> qw_active_log = new QueryWrapper<ActiveLogs>();
|
||||
qw_active_log.eq("active_id", activitie.getId());
|
||||
activeLogsDao.delete(qw_active_log);
|
||||
}
|
||||
activitiesDao.delete(qw_active);
|
||||
|
||||
teamsDao.deleteById(teams);
|
||||
|
||||
QueryWrapper<Teams> qw_team = new QueryWrapper<Teams>();
|
||||
qw_team.eq("manager", teams.getManager());
|
||||
if(teamsDao.selectCount(qw_team) <= 0){
|
||||
|
||||
Users user = usersDao.selectById(teams.getManager());
|
||||
user.setType(2);
|
||||
usersDao.updateById(user);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Teams getOne(String id) {
|
||||
|
||||
Teams teams = teamsDao.selectById(id);
|
||||
|
||||
return teams;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public List<Teams> getAll(){
|
||||
|
||||
QueryWrapper<Teams> qw = new QueryWrapper<Teams>();
|
||||
|
||||
qw.orderByDesc("create_time");
|
||||
|
||||
List<Teams> list = teamsDao.selectList(qw);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public List<Teams> getListByManId(String manId){
|
||||
|
||||
QueryWrapper<Teams> qw = new QueryWrapper<Teams>();
|
||||
qw.eq("manager", manId);
|
||||
qw.orderByDesc("create_time");
|
||||
|
||||
List<Teams> list = teamsDao.selectList(qw);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, Teams teams) {
|
||||
|
||||
QueryWrapper<Teams> qw = new QueryWrapper<Teams>();
|
||||
|
||||
if(StringUtils.isNotNullOrEmpty(teams.getName())){
|
||||
|
||||
qw.like("name", teams.getName());
|
||||
}
|
||||
|
||||
if(StringUtils.isNotNullOrEmpty(teams.getTypeId())){
|
||||
|
||||
qw.eq("type_id", teams.getTypeId());
|
||||
}
|
||||
|
||||
if(StringUtils.isNotNullOrEmpty(teams.getManager())){
|
||||
|
||||
qw.eq("manager", teams.getManager());
|
||||
}
|
||||
|
||||
qw.orderByDesc("create_time");
|
||||
|
||||
Page<Teams> page =
|
||||
teamsDao.selectPage(new Page<Teams>(pageIndex, pageSize), qw);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化分页查询的结果
|
||||
*/
|
||||
public PageData parsePage(Page<Teams> p) {
|
||||
|
||||
List<Map<String, Object>> resl = new ArrayList<Map<String, Object>>();
|
||||
|
||||
for (Teams teams : p.getRecords()) {
|
||||
|
||||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("id", teams.getId());
|
||||
temp.put("name", teams.getName());
|
||||
temp.put("createTime", teams.getCreateTime());
|
||||
temp.put("total", teams.getTotal());
|
||||
|
||||
Users user = usersDao.selectById(teams.getManager());
|
||||
temp.put("manager", teams.getManager());
|
||||
temp.put("managerName", user.getName());
|
||||
temp.put("managerPhone", user.getPhone());
|
||||
temp.put("managerAddress", user.getAddress());
|
||||
|
||||
TeamTypes teamType = teamTypesDao.selectById(teams.getTypeId());
|
||||
temp.put("typeId", teams.getTypeId());
|
||||
temp.put("typeName", teamType.getName());
|
||||
resl.add(temp);
|
||||
}
|
||||
|
||||
PageData pageData = new PageData(p.getCurrent(), p.getSize(), p.getTotal(), resl);
|
||||
|
||||
return pageData;
|
||||
}
|
||||
}
|
@ -0,0 +1,145 @@
|
||||
package self.cases.teams.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import self.cases.teams.dao.MembersDao;
|
||||
import self.cases.teams.dao.TeamsDao;
|
||||
import self.cases.teams.entity.Members;
|
||||
import self.cases.teams.entity.Teams;
|
||||
import self.cases.teams.msg.PageData;
|
||||
import self.cases.teams.entity.Users;
|
||||
import self.cases.teams.dao.UsersDao;
|
||||
import self.cases.teams.service.UsersService;
|
||||
import self.cases.teams.utils.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("usersService")
|
||||
public class UsersServiceImpl implements UsersService {
|
||||
|
||||
@Autowired
|
||||
private MembersDao membersDao;
|
||||
|
||||
@Autowired
|
||||
private UsersDao usersDao;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(Users users) {
|
||||
|
||||
usersDao.insert(users);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(Users users) {
|
||||
|
||||
usersDao.updateById(users);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Users users) {
|
||||
|
||||
usersDao.deleteById(users);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Boolean isRemove(String userId){
|
||||
|
||||
QueryWrapper<Members> qw = new QueryWrapper<Members>();
|
||||
qw.eq("user_id", userId);
|
||||
|
||||
Integer total = membersDao.selectCount(qw);
|
||||
|
||||
return total <= 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Users getOne(String id) {
|
||||
|
||||
Users users = usersDao.selectById(id);
|
||||
|
||||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public Users getUserByUserName(String userName) {
|
||||
|
||||
QueryWrapper<Users> qw = new QueryWrapper<Users>();
|
||||
qw.eq("user_name", userName);
|
||||
|
||||
Users user = usersDao.selectOne(qw);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PageData getPageInfo(Long pageIndex, Long pageSize, Users users) {
|
||||
|
||||
QueryWrapper<Users> qw = new QueryWrapper<Users>();
|
||||
|
||||
if (StringUtils.isNotNullOrEmpty(users.getUserName())) {
|
||||
|
||||
qw.like("user_name", users.getUserName());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotNullOrEmpty(users.getName())) {
|
||||
|
||||
qw.like("name", users.getName());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotNullOrEmpty(users.getPhone())) {
|
||||
|
||||
qw.like("phone", users.getPhone());
|
||||
}
|
||||
|
||||
qw.orderByDesc("create_time");
|
||||
|
||||
Page<Users> page =
|
||||
usersDao.selectPage(new Page<Users>(pageIndex, pageSize), qw);
|
||||
|
||||
return parsePage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化分页查询的结果
|
||||
*/
|
||||
public PageData parsePage(Page<Users> p) {
|
||||
|
||||
List<Map<String, Object>> resl = new ArrayList<Map<String, Object>>();
|
||||
|
||||
for (Users users : p.getRecords()) {
|
||||
|
||||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("id", users.getId());
|
||||
temp.put("userName", users.getUserName());
|
||||
temp.put("passWord", users.getPassWord());
|
||||
temp.put("name", users.getName());
|
||||
temp.put("gender", users.getGender());
|
||||
temp.put("age", users.getAge());
|
||||
temp.put("phone", users.getPhone());
|
||||
temp.put("address", users.getAddress());
|
||||
temp.put("status", users.getStatus());
|
||||
temp.put("createTime", users.getCreateTime());
|
||||
temp.put("type", users.getType());
|
||||
resl.add(temp);
|
||||
}
|
||||
|
||||
PageData pageData = new PageData(p.getCurrent(), p.getSize(), p.getTotal(), resl);
|
||||
|
||||
return pageData;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package self.cases.teams.utils;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* ID 处理工具类
|
||||
*/
|
||||
public class IDUtils {
|
||||
|
||||
/**
|
||||
* 使用 UUID 生成32位系统ID
|
||||
* @return
|
||||
*/
|
||||
public static String makeIDByUUID() {
|
||||
|
||||
String id = UUID.randomUUID().toString().replaceAll("-","");
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用时间戳生成ID, 13位
|
||||
* @return
|
||||
*/
|
||||
public static String makeIDByCurrent() {
|
||||
|
||||
Long mills = DateUtils.getCurrent();
|
||||
|
||||
return mills.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
server:
|
||||
port: 9999
|
||||
servlet:
|
||||
context-path: /teams
|
||||
encoding:
|
||||
enabled: true
|
||||
charset: UTF-8
|
||||
force: true
|
||||
spring:
|
||||
mvc:
|
||||
static-path-pattern: /**
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true #设置开启热部署
|
||||
additional-paths: src/main/java #重启目录
|
||||
datasource:
|
||||
username: root
|
||||
password: root
|
||||
url: jdbc:mysql://localhost:4050/self_student_teams?zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
initialSize: 5
|
||||
minIdle: 5
|
||||
maxWait: 60000
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
<!--默认缓存策略 -->
|
||||
<defaultCache maxElementsInMemory="10000" eternal="false"
|
||||
timeToIdleSeconds="120" timeToLiveSeconds="120"
|
||||
maxElementsOnDisk="10000" diskExpiryThreadIntervalSeconds="120"
|
||||
memoryStoreEvictionPolicy="LRU">
|
||||
<persistence strategy="localTempSwap" />
|
||||
</defaultCache>
|
||||
|
||||
<!-- 自定义缓存策略 -->
|
||||
<cache name="users"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="false"
|
||||
timeToIdleSeconds="120000"
|
||||
timeToLiveSeconds="12000"
|
||||
maxElementsOnDisk="10000"
|
||||
diskExpiryThreadIntervalSeconds="120"
|
||||
memoryStoreEvictionPolicy="LRU">
|
||||
|
||||
<persistence strategy="localTempSwap" />
|
||||
</cache>
|
||||
</ehcache>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Configuration status="error" monitorInterval="5">
|
||||
|
||||
<properties>
|
||||
<!-- 定义日志输出的普通格式 -->
|
||||
<property name="pattern_n">%d{yyyy-MM-dd HH:mm:ss} [%t] [%-5level] %c %L - %m%n</property>
|
||||
</properties>
|
||||
|
||||
<Appenders>
|
||||
<!-- DEBUG 格式日志输出到控制台 -->
|
||||
<Console name="console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="${pattern_n}" />
|
||||
</Console>
|
||||
</Appenders>
|
||||
|
||||
<Loggers>
|
||||
<Root level="all">
|
||||
<AppenderRef ref="console" />
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue