master
commit
d88dd2619a
@ -0,0 +1,31 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**
|
||||
!**/src/test/**
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-container>
|
||||
<el-aside width="300px">
|
||||
<personal-aside></personal-aside>
|
||||
</el-aside>
|
||||
<el-main>
|
||||
<personal-message></personal-message>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import personalMessage from "~/components/personalMessage";
|
||||
import personalAside from "~/components/personalAside";
|
||||
|
||||
export default {
|
||||
components: {personalMessage, personalAside}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.personal-message {
|
||||
margin: 200px 20% 0 20%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div>
|
||||
<home
|
||||
:names="homeParams"
|
||||
:user="nickname"
|
||||
@goPersonal="$router.push('/supManager/index/personal')"
|
||||
@back="logout"
|
||||
></home>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import home from "~/components/home";
|
||||
import {get} from "~/utils";
|
||||
import {showSuccess} from "~/utils/dialog";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
home
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nickname: '未登录',
|
||||
homeParams: [
|
||||
{
|
||||
name: '实验室管理', func: () => {
|
||||
this.$router.push('/supManager/index/labManage')
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '用户管理', func: () => {
|
||||
this.$router.push('/supManager/index/userManage')
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '个人中心', func: () => {
|
||||
this.$router.push('/supManager/index/personal')
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async logout() {
|
||||
await get('lb/user/logout')
|
||||
await showSuccess('退出成功', this)
|
||||
setTimeout(() => {
|
||||
this.$router.push('/login')
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
this.nickname = await get('lb/user/getUserName')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<nav-bar></nav-bar>
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navBar from "~/components/supManager/navBar";
|
||||
export default {
|
||||
components:{navBar},
|
||||
name: "empty"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-menu
|
||||
:default-active="activeIndex"
|
||||
class="el-menu-demo nav"
|
||||
mode="horizontal"
|
||||
@select="handleSelect"
|
||||
background-color="#1989fa"
|
||||
text-color="#ffffff"
|
||||
router
|
||||
active-text-color="#ffd04b">
|
||||
<el-menu-item index="1" route="../">首页</el-menu-item>
|
||||
<el-menu-item index="2" route="labManage"">实验室管理</el-menu-item>
|
||||
<el-menu-item index="3" route="userManage">用户管理</el-menu-item>
|
||||
<drop-down-user :user="nickname" @back="backLogin" @goPersonal="goPersonal"></drop-down-user>
|
||||
</el-menu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dropDownUser from "~/components/dropDownUser";
|
||||
import {get} from "~/utils";
|
||||
import {showSuccess} from "~/utils/dialog";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeIndex: '',
|
||||
nickname: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleSelect(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
async backLogin() {
|
||||
await get('lb/user/logout')
|
||||
await showSuccess("退出成功", this)
|
||||
setTimeout(() => {
|
||||
this.$router.push('/login')
|
||||
}, 1000)
|
||||
},
|
||||
goPersonal: function () {
|
||||
this.$router.push('/supManager/index/personal')
|
||||
}
|
||||
},
|
||||
components: {
|
||||
dropDownUser
|
||||
},
|
||||
async mounted() {
|
||||
this.nickname = await get('lb/user/getUserName')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.nav {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<!-- 弹出层-->
|
||||
<el-dialog :title="edit ? '编辑用户' : '新增用户'" :visible.sync="dialogVisible" width="40rem" @close="cancel"
|
||||
style="text-align: left" :close-on-click-modal="false">
|
||||
<el-form :model="userForm" ref="userForm">
|
||||
<el-form-item prop="position" label="职位" label-width="80px"
|
||||
:rules="[{ required: true, message: '请选择职位', trigger: 'blur' }]">
|
||||
<el-select v-model="userForm.position" placeholder="请选择职位">
|
||||
<el-option label="教师" :value="1"></el-option>
|
||||
<el-option label="实验室管理员" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username" label="工号" label-width="80px"
|
||||
:rules="[{ required: true, message: '请输入工号', trigger: 'blur' }]">
|
||||
<el-input v-model="userForm.username" autocomplete="off" :disabled="edit">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password" label="密码" label-width="80px" v-if="!edit"
|
||||
:rules="[{ required: true, message: '请输入密码', trigger: 'blur' }]"
|
||||
>
|
||||
<el-input v-model="userForm.password" type="userForm.password" autocomplete="off" :disabled="edit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="nickname" label="姓名" label-width="80px"
|
||||
:rules="[{ required: true, message: '请输入姓名', trigger: 'blur' }]">
|
||||
<el-input v-model="userForm.nickname" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="tel" label="联系电话" label-width="80px"
|
||||
:rules="[{ required: true, message: '请输入联系电话', trigger: 'blur' }]">
|
||||
<el-input v-model="userForm.tel" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="office" label="办公室" label-width="80px"
|
||||
:rules="[{ required: true, message: '请输入办公室', trigger: 'blur' }]">
|
||||
<el-input v-model="userForm.office" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="email" label="邮箱" label-width="80px"
|
||||
:rules="[{ required: true, message: '请输入邮箱地址', trigger: 'blur' },
|
||||
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }]">
|
||||
<el-input v-model="userForm.email" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="confirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {get, post, stop} from "~/utils";
|
||||
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
dialogFormVisible: {required: true},
|
||||
userForm: {required: true},
|
||||
edit: {required: true}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async confirm() {
|
||||
//验证
|
||||
this.$refs['userForm'].validate(async (valid) => {
|
||||
if (valid) {
|
||||
//提交
|
||||
await showDialog("确定要" + (this.edit ? '编辑' : '新增') + '吗?', this)
|
||||
//编辑提交
|
||||
if (this.edit) {
|
||||
await post('lb/user/updateUser', {
|
||||
nickname: this.userForm.nickname,
|
||||
tel: this.userForm.tel,
|
||||
email: this.userForm.email,
|
||||
username: this.userForm.username,
|
||||
office: this.userForm.office,
|
||||
position: parseInt(this.userForm.position),
|
||||
uId: this.userForm.uid
|
||||
}).catch(async e => {
|
||||
await showFail(e.msg, this)
|
||||
await stop()
|
||||
})
|
||||
showSuccess('编辑完成', this)
|
||||
} else {
|
||||
// 新增提交
|
||||
await post('lb/user/addUser', {
|
||||
nickname: this.userForm.nickname,
|
||||
tel: this.userForm.tel,
|
||||
email: this.userForm.email,
|
||||
username: this.userForm.username,
|
||||
office: this.userForm.office,
|
||||
position: parseInt(this.userForm.position),
|
||||
password: this.userForm.password
|
||||
}).catch(async e => {
|
||||
await showFail(e.msg, this)
|
||||
await stop()
|
||||
})
|
||||
showSuccess('新增完成', this)
|
||||
}
|
||||
this.$emit('confirm')
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
cancel() {
|
||||
this.$refs['userForm'].resetFields()
|
||||
this.$emit('cancel')
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogFormVisible(val) {
|
||||
this.dialogVisible = val
|
||||
this.password = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<div style="margin: 20px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-input v-model="search" placeholder="输入关键字搜索" suffix-icon="el-icon-search"/>
|
||||
</el-col>
|
||||
<el-col :span="16" style="text-align: left">
|
||||
<el-button type="success" style="width: 120px;text-align: left" icon="el-icon-circle-plus-outline"
|
||||
@click="addUser">新增用户
|
||||
</el-button>
|
||||
<el-button type="danger" plain icon="el-icon-delete" style="width: 120px;text-align: left"
|
||||
@click="deleteUserMul" v-if="items.length">多选删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableDataComputed"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
style="width: 100%;margin-top: 20px">
|
||||
<el-table-column type="selection" width="40" align="center"></el-table-column>
|
||||
<el-table-column prop="username" label="工号" sortable></el-table-column>
|
||||
<el-table-column prop="position" label="职位" sortable align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.position === 1 ? 'primary' : scope.row.position ===2 ? 'success': 'warning'"
|
||||
disable-transitions>{{scope.row.position ===1 ? '教 师' :
|
||||
scope.row.position ===2 ? '实验室管理员': '超级管理员'}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nickname" label="姓名" sortable></el-table-column>
|
||||
<el-table-column prop="tel" label="联系电话"></el-table-column>
|
||||
<el-table-column prop="office" label="办公室" sortable></el-table-column>
|
||||
<el-table-column prop="email" label="邮箱"></el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="300">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="editUser(scope.row)" type="primary" size="mini" plain icon="el-icon-edit" v-if="scope.row.position!==3">编辑</el-button>
|
||||
<el-button @click="deleteUser(scope.row)" type="danger" size="mini" plain icon="el-icon-delete" v-if="scope.row.position!==3">删除</el-button>
|
||||
<el-button @click="handleClick(scope.row)" size="mini" plain v-if="scope.row.position === 1">查看课表</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<user-edit-form
|
||||
:dialog-form-visible="dialogFormVisible"
|
||||
:edit="edit"
|
||||
:user-form="userForm"
|
||||
@cancel="cancel"
|
||||
@confirm="confirm"
|
||||
></user-edit-form>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {get, post} from "~/utils";
|
||||
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
|
||||
import userEditForm from "~/components/supManager/userEditForm";
|
||||
|
||||
export default {
|
||||
components: {userEditForm},
|
||||
data() {
|
||||
return {
|
||||
search: '',
|
||||
items: [],
|
||||
tableData: [],
|
||||
dialogFormVisible: false,
|
||||
edit: false,
|
||||
userForm: {}
|
||||
}
|
||||
}
|
||||
,
|
||||
methods: {
|
||||
async load() {
|
||||
this.tableData = await get('lb/user/getUserList')
|
||||
},
|
||||
handleClick(row) {
|
||||
console.log(row);
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.items = val;
|
||||
},
|
||||
addUser() {
|
||||
this.edit = false
|
||||
this.userForm = {
|
||||
nickname: "",
|
||||
tel: "",
|
||||
email: "",
|
||||
username: "",
|
||||
office: "",
|
||||
position: ''
|
||||
}
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 删除用户
|
||||
async deleteUser(item) {
|
||||
await showDialog("确认要删除吗?", this)
|
||||
await post('lb/user/deleteUser', {
|
||||
uid: item.uid
|
||||
}).then(() => {
|
||||
showSuccess("删除成功", this)
|
||||
this.load()
|
||||
}).catch(e => {
|
||||
showFail("删除失败 " + e.msg, this)
|
||||
})
|
||||
},
|
||||
async deleteUserMul(){
|
||||
await showDialog("确认要删除吗?", this)
|
||||
showFail("尚未开发",this)
|
||||
},
|
||||
// 编辑用户
|
||||
async editUser(item) {
|
||||
this.edit = true
|
||||
this.userForm = item
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
cancel(){
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
confirm(){
|
||||
this.load()
|
||||
this.cancel()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tableDataComputed() {
|
||||
return this.tableData.filter(data => !this.search
|
||||
|| data.username.toLowerCase().includes(this.search.toLowerCase())
|
||||
|| data.tel.toLowerCase().includes(this.search.toLowerCase())
|
||||
|| data.nickname.toLowerCase().includes(this.search.toLowerCase())
|
||||
|| data.office.toLowerCase().includes(this.search.toLowerCase())
|
||||
|| data.email.toLowerCase().includes(this.search.toLowerCase())
|
||||
)
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
this.load()
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,25 @@
|
||||
package com.hzu.bookingsystem.bean;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* author 吴志岳
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name = "tb_auth_group_access")
|
||||
public class UserAuthBean {
|
||||
@Id
|
||||
private Integer uId;
|
||||
|
||||
private Integer groupId;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.hzu.bookingsystem.converter;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Map2Object {
|
||||
/**
|
||||
* @param map
|
||||
* @param clazz
|
||||
* @return
|
||||
*/
|
||||
public static Object map2Object(Map<String, Object> map, Class<?> clazz) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
Object ob = null;
|
||||
try {
|
||||
ob = clazz.newInstance();
|
||||
Field[] fis = ob.getClass().getDeclaredFields();
|
||||
for (Field fi : fis) {
|
||||
int mod = fi.getModifiers();
|
||||
if (Modifier.isStatic(mod) || Modifier.isFinal(mod)) {
|
||||
continue;
|
||||
}
|
||||
fi.setAccessible(true);
|
||||
if (Objects.equals("entranceId", fi.getName())) {
|
||||
String str = String.valueOf(map.get(fi.getName()));
|
||||
fi.set(ob, Long.parseLong(str));
|
||||
} else {
|
||||
fi.set(ob, map.get(fi.getName()));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ob;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.hzu.bookingsystem.repository;
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabRecordBean;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface LabRecordRepository extends JpaRepository<LabRecordBean,String> {
|
||||
|
||||
|
||||
LabRecordBean findByLrId(Integer lt_id);
|
||||
|
||||
|
||||
LabRecordBean save(LabRecordBean labrecord) ;
|
||||
|
||||
|
||||
List<LabRecordBean> findAll() ;
|
||||
|
||||
|
||||
List<LabRecordBean> findByStatus(Integer status ) ;
|
||||
|
||||
|
||||
void deleteBylrId(Integer lt_id);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.hzu.bookingsystem.repository;
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabBean;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author 莫家豪
|
||||
*/
|
||||
public interface LabRepository extends JpaRepository<LabBean,String> {
|
||||
|
||||
/**
|
||||
* 通过lab_id删除实验室
|
||||
*
|
||||
* @param labId
|
||||
* @return
|
||||
*/
|
||||
void deleteByLabId(Integer labId);
|
||||
|
||||
|
||||
// 查找所有用户
|
||||
List<LabBean> findAll();
|
||||
|
||||
/**
|
||||
* 通过lab_id查找实验室
|
||||
*
|
||||
* @param labId
|
||||
* @return
|
||||
*/
|
||||
LabBean findByLabId(Integer labId);
|
||||
|
||||
/**
|
||||
* 通过name查找实验室
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
LabBean findByName(String name);
|
||||
|
||||
/**
|
||||
* 通过position查找实验室
|
||||
*
|
||||
* @param position
|
||||
* @return
|
||||
*/
|
||||
LabBean findByPosition(String position);
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.hzu.bookingsystem.repository;
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabTimeBean;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author 莫家豪
|
||||
*/
|
||||
public interface LabTimeRepository extends JpaRepository<LabTimeBean,String> {
|
||||
|
||||
/**
|
||||
* 通过lt_id删除实验室
|
||||
*
|
||||
* @param ltId
|
||||
* @return
|
||||
*/
|
||||
void deleteByLtId(Integer ltId);
|
||||
|
||||
// 查找所有用户
|
||||
List<LabTimeBean> findAll();
|
||||
|
||||
/**
|
||||
* 通过lt_id查找实验室可预约时间段
|
||||
*
|
||||
* @param ltId
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean findByLtId(Integer ltId);
|
||||
|
||||
/**
|
||||
* 通过状态查找实验室可预约时间段
|
||||
*
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean findByStatus(Integer status);
|
||||
|
||||
/**
|
||||
* 通过上课时间查找实验室可预约时间段
|
||||
*
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean findByTime(String time);
|
||||
|
||||
/**
|
||||
* 通过学期、周、星期、上课时间查找实验室可预约时间段
|
||||
*
|
||||
* @param year、weeks、day、time
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean findByYear(String year);
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.hzu.bookingsystem.repository;
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.UserAuthBean;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
/**
|
||||
* author 吴志岳
|
||||
*/
|
||||
public interface UserAuthRepository extends JpaRepository<UserAuthBean,String> {
|
||||
UserAuthBean findByUId(Integer uId);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.hzu.bookingsystem.repository;
|
||||
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.UserCourseBean;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface UserCourseRepository extends JpaRepository<UserCourseBean,String> {
|
||||
|
||||
|
||||
|
||||
UserCourseBean findByUcId(Integer uc_id);
|
||||
|
||||
|
||||
UserCourseBean save(UserCourseBean uc_id) ;
|
||||
|
||||
|
||||
List<UserCourseBean> findAll() ;
|
||||
|
||||
|
||||
List<UserCourseBean> findByUIdAndYearAndSemester(Integer u_id,String year,Integer semester) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void deleteByUcId(Integer uc_id);
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.hzu.bookingsystem.service;
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabRecordBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LabRecordService {
|
||||
|
||||
|
||||
/**
|
||||
* 新增申请记录
|
||||
* @param labrecord
|
||||
* @return
|
||||
*/
|
||||
LabRecordBean add(LabRecordBean labrecord);
|
||||
|
||||
/**
|
||||
* 查看所有申请记录
|
||||
* @return
|
||||
*/
|
||||
List<LabRecordBean> findAll();
|
||||
|
||||
/**
|
||||
* 根据状态查询申请记录
|
||||
* @param stauts
|
||||
* @return
|
||||
*/
|
||||
List<LabRecordBean> findByStatus( Integer stauts );
|
||||
|
||||
/**
|
||||
* 根据ID查询记录
|
||||
* @param lr_id
|
||||
* @return
|
||||
*/
|
||||
LabRecordBean findById(Integer lr_id);
|
||||
|
||||
/**
|
||||
* 修改申请记录
|
||||
* @param labrecord
|
||||
* @return
|
||||
*/
|
||||
LabRecordBean update(LabRecordBean labrecord);
|
||||
|
||||
/**
|
||||
* 根据Id查询申请记录
|
||||
* @param lr_id
|
||||
*/
|
||||
void deleteById(Integer lr_id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.hzu.bookingsystem.service;
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabBean;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* author 莫家豪
|
||||
*/
|
||||
public interface LabService {
|
||||
|
||||
/**
|
||||
* 创建实验室
|
||||
*
|
||||
* @param lab
|
||||
* @return
|
||||
*/
|
||||
LabBean add(LabBean lab);
|
||||
|
||||
/**
|
||||
* 通过lab_id删除实验室
|
||||
*
|
||||
* @param labId
|
||||
* @return
|
||||
*/
|
||||
void deleteByLabId(Integer labId);
|
||||
|
||||
/**
|
||||
* 修改实验室
|
||||
*
|
||||
* @param lab
|
||||
* @return
|
||||
*/
|
||||
LabBean update(LabBean lab);
|
||||
|
||||
// 查找所有用户
|
||||
List<LabBean> findAll();
|
||||
|
||||
/**
|
||||
* 通过lab_id查找实验室
|
||||
*
|
||||
* @param labId
|
||||
* @return
|
||||
*/
|
||||
LabBean findByLabId(Integer labId);
|
||||
|
||||
/**
|
||||
* 通过name查找实验室
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
LabBean findByName(String name);
|
||||
|
||||
/**
|
||||
* 通过position查找实验室
|
||||
*
|
||||
* @param position
|
||||
* @return
|
||||
*/
|
||||
LabBean findByPosition(String position);
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.hzu.bookingsystem.service;
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabTimeBean;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* author 莫家豪
|
||||
*/
|
||||
public interface LabTimeService {
|
||||
|
||||
/**
|
||||
* 创建实验室可申请时间段
|
||||
*
|
||||
* @param labTime
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean add(LabTimeBean labTime);
|
||||
|
||||
/**
|
||||
* 通过lt_id删除实验室
|
||||
*
|
||||
* @param ltID
|
||||
* @return
|
||||
*/
|
||||
void deleteByLtId(Integer ltID);
|
||||
|
||||
/**
|
||||
* 修改实验室
|
||||
*
|
||||
* @param labTime
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean update(LabTimeBean labTime);
|
||||
|
||||
// 查找所有用户
|
||||
List<LabTimeBean> findAll();
|
||||
|
||||
/**
|
||||
* 通过lt_id查找实验室可预约时间段
|
||||
*
|
||||
* @param ltId
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean findByLtId(Integer ltId);
|
||||
|
||||
/**
|
||||
* 通过状态查找实验室可预约时间段
|
||||
*
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean findByStatus(Integer status);
|
||||
|
||||
/**
|
||||
* 通过上课时间查找实验室可预约时间段
|
||||
*
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean findByTime(String time);
|
||||
|
||||
/**
|
||||
* 通过学期、周、星期、上课时间查找实验室可预约时间段
|
||||
*
|
||||
* @param year、weeks、day、time
|
||||
* @return
|
||||
*/
|
||||
LabTimeBean findByYear(String year);
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.hzu.bookingsystem.service;
|
||||
|
||||
import com.hzu.bookingsystem.bean.UserAuthBean;
|
||||
|
||||
public interface UserAuthService {
|
||||
UserAuthBean add(Integer uId, Integer groupId);
|
||||
|
||||
UserAuthBean update(Integer uId, Integer groupId);
|
||||
|
||||
void delete(Integer uId, Integer groupId);
|
||||
|
||||
UserAuthBean findByUId(Integer uId);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.hzu.bookingsystem.service.impl;
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabRecordBean;
|
||||
import com.hzu.bookingsystem.repository.LabRecordRepository;
|
||||
import com.hzu.bookingsystem.service.LabRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class LabRecordServiceImpl implements LabRecordService{
|
||||
@Resource
|
||||
private LabRecordRepository labrecordRepository;
|
||||
|
||||
@Override
|
||||
public LabRecordBean add(LabRecordBean labrcecord) {
|
||||
return labrecordRepository.save(labrcecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LabRecordBean> findAll() {
|
||||
return labrecordRepository.findAll();
|
||||
}
|
||||
@Override
|
||||
public List<LabRecordBean> findByStatus(Integer status) {
|
||||
return labrecordRepository.findByStatus(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabRecordBean findById(Integer lr_id) {
|
||||
return labrecordRepository.findByLrId(lr_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabRecordBean update(LabRecordBean labrcecord) {
|
||||
return labrecordRepository.save(labrcecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteById(Integer lr_id) {
|
||||
labrecordRepository.deleteBylrId(lr_id);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.hzu.bookingsystem.service.impl;
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabBean;
|
||||
import com.hzu.bookingsystem.repository.LabRepository;
|
||||
import com.hzu.bookingsystem.service.LabService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.List;
|
||||
/**
|
||||
* author 莫家豪
|
||||
*/
|
||||
@Service
|
||||
public class LabServiceImpl implements LabService {
|
||||
@Resource
|
||||
private LabRepository labRepository;
|
||||
|
||||
@Override
|
||||
public LabBean add(LabBean lab) {
|
||||
lab.setLabId(null);
|
||||
return labRepository.save(lab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteByLabId(Integer labId){
|
||||
labRepository.deleteByLabId(labId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabBean update(LabBean lab){
|
||||
return labRepository.save(lab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LabBean> findAll() {
|
||||
return labRepository.findAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabBean findByLabId(Integer labId){
|
||||
return labRepository.findByLabId(labId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabBean findByName(String name) {
|
||||
return labRepository.findByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabBean findByPosition(String position){
|
||||
return labRepository.findByPosition(position);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hzu.bookingsystem.service.impl;
|
||||
|
||||
import com.hzu.bookingsystem.bean.LabTimeBean;
|
||||
import com.hzu.bookingsystem.repository.LabTimeRepository;
|
||||
import com.hzu.bookingsystem.service.LabTimeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.List;
|
||||
/**
|
||||
* author 莫家豪
|
||||
*/
|
||||
@Service
|
||||
public class LabTimeServiceImpl implements LabTimeService {
|
||||
@Resource
|
||||
private LabTimeRepository labTimeRepository;
|
||||
|
||||
@Override
|
||||
public LabTimeBean add(LabTimeBean labTime) {
|
||||
labTime.setLtId(null);
|
||||
return labTimeRepository.save(labTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteByLtId(Integer ltId){
|
||||
labTimeRepository.deleteByLtId(ltId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabTimeBean update(LabTimeBean labTime){
|
||||
return labTimeRepository.save(labTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LabTimeBean> findAll() {
|
||||
return labTimeRepository.findAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabTimeBean findByLtId(Integer ltId){
|
||||
return labTimeRepository.findByLtId(ltId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabTimeBean findByStatus(Integer status) {
|
||||
return labTimeRepository.findByStatus(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabTimeBean findByTime(String time){
|
||||
return labTimeRepository.findByTime(time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabTimeBean findByYear(String year){
|
||||
return labTimeRepository.findByYear(year);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.hzu.bookingsystem.service.impl;
|
||||
|
||||
import com.hzu.bookingsystem.bean.UserAuthBean;
|
||||
import com.hzu.bookingsystem.repository.UserAuthRepository;
|
||||
import com.hzu.bookingsystem.service.UserAuthService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class UserAuthServiceImpl implements UserAuthService {
|
||||
@Autowired
|
||||
private UserAuthRepository userAuthRepository;
|
||||
|
||||
@Override
|
||||
public UserAuthBean add(Integer uId, Integer groupId) {
|
||||
UserAuthBean userAuth = new UserAuthBean(uId,groupId);
|
||||
return userAuthRepository.save(userAuth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserAuthBean update(Integer uId, Integer groupId) {
|
||||
UserAuthBean userAuth = new UserAuthBean(uId,groupId);
|
||||
return userAuthRepository.save(userAuth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Integer uId, Integer groupId) {
|
||||
UserAuthBean userAuth = new UserAuthBean(uId,groupId);
|
||||
userAuthRepository.delete(userAuth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserAuthBean findByUId(Integer uId) {
|
||||
return userAuthRepository.findByUId(uId);
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.hzu.bookingsystem.service.impl;
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.UserCourseBean;
|
||||
import com.hzu.bookingsystem.repository.UserCourseRepository;
|
||||
import com.hzu.bookingsystem.service.UserCourseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserCourseServiceImpl implements UserCourseService{
|
||||
|
||||
@Resource
|
||||
private UserCourseRepository usercourseRepository;
|
||||
|
||||
@Override
|
||||
public UserCourseBean add(UserCourseBean usercourse) {
|
||||
return usercourseRepository.save(usercourse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCourseBean> findAll() {
|
||||
return usercourseRepository.findAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCourseBean> findAllByUidAndYearAndSemester(Integer u_id,String year,Integer semester)
|
||||
{
|
||||
return usercourseRepository.findByUIdAndYearAndSemester(u_id,year,semester);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCourseBean findById(Integer uc_id) {
|
||||
return usercourseRepository.findByUcId(uc_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCourseBean update(UserCourseBean usercourse) {
|
||||
return usercourseRepository.save(usercourse);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteByUcId(Integer uc_id) {
|
||||
usercourseRepository.deleteByUcId(uc_id);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue