Commit 6f109867 by zhaopanyu

Merge branch 'master' of 49.232.152.146:xhxy/smart_school

parents 1222aa5b b6ae2d23
<template>
<div>
<!-- 搜索条件 -->
<el-form
:model="queryForm"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
style="margin-left: 15px; margin-top: 10px"
>
<el-form-item label="仪器名称">
<el-input
v-model="queryForm.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
<el-form-item label="仪器分类">
<el-select
v-model="queryForm.name"
placeholder="请选择"
clearable
>
<el-option> </el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="getList"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<el-row style="margin-left: 10px" :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
size="mini"
@click="handAdd()"
v-hasPermi="['system:student:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
size="mini"
:disabled="single"
@click="handleDelete"
>删除
</el-button>
</el-col>
</el-row>
<!-- 表格 -->
<el-table
stripe
:data="tableData"
border
style="width: 98%; margin-left: 15px"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column align="center" prop="name" label="申请人" />
<el-table-column align="center" prop="name" label="借用状态" />
<el-table-column align="center" prop="name" label="借用明细" />
<el-table-column align="center" prop="name" label="借用学科" />
<el-table-column align="center" prop="name" label="申请时间" />
<el-table-column align="center" prop="name" label="借用时间" />
<el-table-column align="center" prop="name" label="归还时间" />
<el-table-column align="center" prop="name" label="备注" />
<el-table-column align="center" fixed="right" label="操作">
<template slot-scope="scope">
<el-button
@click="handleLook(scope.row)"
type="text"
size="small"
>详情</el-button
>
<el-button
@click="handleDelete(scope.row)"
type="text"
size="small"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 详情弹窗 -->
<el-dialog
:title="title"
:visible.sync="dialogTableVisible"
width="40%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item label="申请人">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="借用状态">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="借用学科">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="申请时间">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="借用时间">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归还时间">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="借用明细">
<el-table stripe :data="tableData" border>
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column
align="center"
prop="name"
label="仪器名称"
/>
<el-table-column
align="center"
prop="name"
label="仪器型号"
/>
<el-table-column
align="center"
prop="name"
label="借用数量"
/>
</el-table>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
<!-- 新增弹窗 -->
<el-dialog
:title="title"
:visible.sync="dialogTableOpen"
width="40%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="110px">
<el-row>
<el-col>
<el-form-item label="借用人">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="借用学科">
<el-select
v-model="name"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="(option, index) in options"
:key="index"
:label="option"
:value="option"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="借用明细">
<el-col :span="1.5" style="margin-bottom: 5px">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handOpenAdd()"
v-hasPermi="['system:student:add']"
>新增
</el-button>
</el-col>
<el-table stripe :data="tableData" border>
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column
align="center"
prop="name"
label="仪器名称"
/>
<el-table-column
align="center"
prop="name"
label="仪器型号"
/>
<el-table-column
align="center"
prop="name"
label="借用数量"
/>
</el-table>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitparentForm"
>确定</el-button
>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 借用明细弹窗 -->
<el-dialog
:title="title"
:visible.sync="dialogTableOpenAdd"
@selection-change="handleSelectionChange"
width="40%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="110px">
<el-row>
<el-col :span="10">
<el-form-item label="仪器名称">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="仪器分类">
<el-select
v-model="name"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="(option, index) in AAA"
:key="index"
:label="option"
:value="option"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="借用明细">
<el-table stripe :data="tableData" border>
<el-table-column
type="selection"
width="55"
></el-table-column>
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column
align="center"
prop="name"
label="仪器名称"
/>
<el-table-column
align="center"
prop="name"
label="仪器分类"
/>
<el-table-column
align="center"
prop="name"
label="仪器型号"
/>
<el-table-column
align="center"
prop="name"
label="仪器数量"
/>
</el-table>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submiopenForm"
>确定</el-button
>
<el-button @click="cancelAdd">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'teacherBorrowing',
data() {
return {
queryForm: {
pageNum: 1,
pageSize: 10,
name: ''
},
//表格数据
tableData: [
{
name: '456123'
},
{
name: '456123'
},
{
name: '456123'
}
],
title: '',
// 弹窗
form: {},
// 总计
total: 0,
single: false, // 添加 single 属性并设置初始值
multiple: false,
dialogTableVisible: false, //详情弹窗
dialogTableOpen: false, //新增弹窗
dialogTableOpenAdd: false, // 借用明细新增
// 学科下拉框
options: ['物理', '化学', '生物'],
AAA: ['反应容器', '光学仪器', '存放容器'],
selectedRows: [] // 存储用户选择的行
}
},
methods: {
// 搜索
getList() {},
// 重置
resetQuery() {},
// 新增
handAdd() {
this.dialogTableOpen = true
this.title = '教师借用新增'
},
// 删除
handleDelete() {},
// 详情
handleLook() {
this.dialogTableVisible = true
this.title = '教师借用详情'
},
// 教师借用确定
submitparentForm() {
this.dialogTableOpen = false
},
// 教师借用取消
cancel() {
this.dialogTableOpen = false
},
// 借用明细新增
handOpenAdd() {
this.dialogTableOpenAdd = true
},
// 多选
handleSelectionChange(selection) {
this.selectedRows = selection
},
// 借用明细新增
submiopenForm() {
this.dialogTableOpenAdd = false
},
// 借用明细取消
cancelAdd() {
this.dialogTableOpenAdd = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div>
<!-- 搜索条件 -->
<el-form
:model="queryForm"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
style="margin-left: 15px; margin-top: 10px"
>
<el-form-item label="仪器名称">
<el-input
v-model="queryForm.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
<el-form-item label="变更日期">
<el-date-picker
v-model="queryForm.name"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="getList"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<!-- 表格 -->
<el-table stripe :data="tableData" border style="width: 98%">
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column align="center" prop="name" label="申请人" />
<el-table-column align="center" prop="name" label="借用状态" />
<el-table-column align="center" prop="name" label="借用明细" />
<el-table-column align="center" prop="name" label="申请时间" />
<el-table-column align="center" prop="name" label="借用时间" />
<el-table-column align="center" prop="name" label="归还时间" />
<el-table-column align="center" prop="name" label="备注" />
<el-table-column align="center" fixed="right" label="操作">
<template slot-scope="scope">
<el-button
@click="handleLook(scope.row)"
type="text"
size="small"
>详情</el-button
>
<el-button
@click="returnItem(scope.row)"
type="text"
size="small"
>归还</el-button
>
<el-button
@click="processItem(scope.row)"
type="text"
size="small"
>借用</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
<!-- 借用弹窗 -->
<el-dialog
:title="title"
:visible.sync="dialogTableProcessItem"
width="42%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="110px">
<el-row>
<el-col>
<el-form-item label="借用人">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="借用明细">
<el-table stripe :data="tableData" border>
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column
align="center"
prop="name"
label="仪器名称"
/>
<el-table-column
align="center"
prop="name"
label="仪器型号"
/>
<el-table-column
align="center"
prop="name"
label="借用数量"
/>
</el-table>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitparentForm"
>确定</el-button
>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 归还弹窗 -->
<el-dialog
:title="title"
:visible.sync="dialogTableReturnItem"
width="50%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="110px">
<el-row>
<el-col :span="10">
<el-form-item label="借用人">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="借用状态">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="申请时间">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="借用明细">
<el-table stripe :data="tableData" border>
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column
align="center"
prop="name"
label="仪器名称"
/>
<el-table-column
align="center"
prop="name"
label="仪器型号"
/>
<el-table-column
align="center"
prop="name"
label="借用数量"
/>
<el-table-column
align="center"
prop="name"
label="损坏数量"
/>
</el-table>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitForm">确定</el-button>
<el-button @click="cancelReturnItem">取 消</el-button>
</div>
</el-dialog>
<!-- 接触归还详情弹窗 -->
<el-dialog
:title="title"
:visible.sync="dialogTableHandleLook"
width="50%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="110px">
<el-row>
<el-col :span="10">
<el-form-item label="借用人">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="借用状态">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="申请时间">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="借用时间">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="归还时间">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="借用明细">
<el-table stripe :data="tableData" border>
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column
align="center"
prop="name"
label="仪器名称"
/>
<el-table-column
align="center"
prop="name"
label="仪器型号"
/>
<el-table-column
align="center"
prop="name"
label="借用数量"
/>
<el-table-column
align="center"
prop="name"
label="损坏数量"
/>
</el-table>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'warehouseEquipmentLoan',
data() {
return {
queryForm: {
pageNum: 1,
pageSize: 10,
name: ''
},
//表格数据
tableData: [
{
name: 111222
}
],
title: '',
// 弹窗
form: {},
// 总计
total: 0,
// 借用弹窗
dialogTableProcessItem: false,
// 归还弹窗
dialogTableReturnItem: false,
// 详情弹窗
dialogTableHandleLook: false
}
},
methods: {
// 搜索
getList() {},
// 重置
resetQuery() {},
// 归还
returnItem() {
this.dialogTableReturnItem = true
this.title = '归还'
},
// 详情
handleLook() {
this.dialogTableHandleLook = true
this.title = '借出归还详情'
},
// 借用
processItem() {
this.dialogTableProcessItem = true
this.title = '借用'
},
// 借用确定
submitparentForm() {
this.dialogTableProcessItem = false
},
// 借用取消
cancel() {
this.dialogTableProcessItem = false
},
// 归还确定
submitForm() {
this.dialogTableReturnItem = false
},
// 归还取消
cancelReturnItem() {
this.dialogTableReturnItem = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div>
<!-- 搜索条件 -->
<el-form
:model="queryForm"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
>
<el-form-item label="仪器名称">
<el-input
v-model="queryForm.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
<el-form-item label="仪器分类">
<el-select
v-model="queryForm.name"
placeholder="请选择"
clearable
>
<el-option> </el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="getList"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handAdd()"
v-hasPermi="['system:student:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:student:edit']"
>编辑
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
size="mini"
icon="el-icon-view"
:disabled="single"
@click="handleDelete"
>删除
</el-button>
</el-col>
</el-row>
<!-- 表格 -->
<el-table
:data="tableData"
style="width: 100%"
row-key="name"
border
lazy
:load="load"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
v-model="selectedRows"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column prop="name" label="仪器名称" width="180" />
<el-table-column prop="name" label="排序" width="180" />
<el-table-column prop="name" label="是否为消耗品" />
<el-table-column prop="name" label="备注" />
<el-table-column align="center" fixed="right" label="操作">
<template slot-scope="scope">
<el-button
@click="handleUpdate(scope.row)"
type="text"
size="small"
>编辑</el-button
>
<el-button
@click="handleDelete(scope.row)"
type="text"
size="small"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 弹窗 -->
<el-dialog
:title="title"
:visible.sync="dialogTableVisible"
width="30%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="108px">
<el-row>
<el-col :span="20">
<el-form-item label="上级分类">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="仪器名称">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="排序">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="是否为消耗品">
<el-radio-group v-model="form.resource">
<el-radio label="是"></el-radio>
<el-radio label="否"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitparentForm"
>确定</el-button
>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: 'instrumentClassification',
data() {
return {
queryForm: {
pageNum: 1,
pageSize: 10,
name: ''
},
selectedRows: [], // 用于存储选择的行数据
//表格数据
tableData: [
{
name: '1'
},
{
name: '2222'
},
{
name: '33',
hasChildren: true
},
{
name: '444'
}
],
title: '',
// 弹窗
form: {},
// 总计
total: 0,
single: false, // 添加 single 属性并设置初始值
multiple: false,
dialogTableVisible: false
}
},
methods: {
// 搜索
getList() {},
// 重置
resetQuery() {},
//
load(tree, treeNode, resolve) {
setTimeout(() => {
resolve([
{
name: '5555'
},
{
name: '666'
}
])
}, 1000)
},
// 新增
handAdd() {
this.dialogTableVisible = true
this.title = '仪器药品新增'
},
// 编辑
handleUpdate() {
this.dialogTableVisible = true
this.title = '仪器药品编辑'
},
// 删除
handleDelete() {},
// 确定
submitparentForm() {
this.dialogTableVisible = false
},
// 取消
cancel() {
this.dialogTableVisible = false
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
}
}
}
</script>
<style lang="scss" scoped>
.el-form {
margin-top: 15px;
margin-left: 10px;
}
.el-table {
margin-left: 10px;
}
</style>
\ No newline at end of file
<template>
<div>
<el-form
:model="queryForm"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
>
<el-form-item label="仪器名称">
<el-input
v-model="queryForm.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
<el-form-item label="仪器分类">
<el-select
v-model="queryForm.name"
placeholder="请选择"
clearable
>
<el-option> </el-option>
</el-select>
</el-form-item>
<el-form-item label="变更日期">
<el-date-picker
v-model="queryForm.name"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="getList"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<!-- 表格 -->
<el-table stripe :data="tableData" border style="width: 98%">
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column align="center" prop="name" label="仪器名称" />
<el-table-column align="center" prop="name" label="仪器分类" />
<el-table-column align="center" prop="name" label="仪器型号" />
<el-table-column align="center" prop="name" label="变动类型" />
<el-table-column align="center" prop="name" label="变动数量" />
<el-table-column align="center" prop="name" label="旧库存数量" />
<el-table-column align="center" prop="name" label="新库存数量" />
<el-table-column align="center" prop="name" label="变更时间" />
<el-table-column align="center" prop="name" label="备注" />
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: 'instrumentDetails',
data() {
return {
queryForm: {
pageNum: 1,
pageSize: 10,
name: ''
},
//表格数据
tableData: [
{
name: 111222
}
],
// 总计
total: 0
}
},
methods: {
// 搜索
getList() {},
// 重置
resetQuery() {}
}
}
</script>
<style lang="scss" scoped>
.el-form {
margin-top: 15px;
margin-left: 10px;
}
.el-table {
margin-left: 10px;
}
</style>
\ No newline at end of file
<template>
<div>
<el-form
:model="queryForm"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
>
<el-form-item label="仪器名称">
<el-input
v-model="queryForm.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
<el-form-item label="仪器分类">
<el-input
v-model="queryForm.name"
placeholder="请输入实验名称"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="getList"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handAdd()"
v-hasPermi="['system:student:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:student:edit']"
>编辑
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
size="mini"
plain
icon="el-icon-view"
:disabled="single"
@click="handleLook"
>详情
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleOut"
v-hasPermi="['system:student:edit']"
>出库
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
size="mini"
plain
icon="el-icon-view"
:disabled="single"
@click="handleIn"
>入库
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
size="mini"
icon="el-icon-view"
:disabled="single"
@click="handleDelete"
>删除
</el-button>
</el-col>
</el-row>
<!-- 表格 -->
<el-table
stripe
:data="tableData"
border
style="width: 98%"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
align="center"
type="index"
label="序号"
width="55"
/>
<el-table-column align="center" prop="name" label="仪器名称" />
<el-table-column align="center" prop="name" label="仪器分类" />
<el-table-column align="center" prop="name" label="仪器型号" />
<el-table-column align="center" prop="name" label="仪器数量" />
<el-table-column align="center" fixed="right" label="操作">
<template slot-scope="scope">
<el-button
@click="handleLook(scope.row)"
type="text"
size="small"
>详情</el-button
><el-button
@click="handleUpdate(scope.row)"
type="text"
size="small"
>编辑</el-button
>
<el-button
@click="handleOut(scope.row)"
type="text"
size="small"
>出库</el-button
><el-button
@click="handleIn(scope.row)"
type="text"
size="small"
>入库</el-button
>
<el-button
@click="handleDelete(scope.row)"
type="text"
size="small"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<!--仪器修改/新增 弹窗 -->
<el-dialog
:title="title"
:visible.sync="dialogTableVisible"
width="30%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="108px">
<el-row>
<el-col :span="20">
<el-form-item label="仪器名称">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="仪器分类">
<el-select
v-model="form.name"
placeholder="请输入"
clearable
style="width: 100%"
>
<el-option> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="仪器型号">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitparentForm"
>确定</el-button
>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 仪器查看弹窗 -->
<el-dialog
title="仪器查看"
:visible.sync="dialogTablesee"
width="30%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="108px">
<el-row>
<el-col :span="20">
<el-form-item label="仪器名称">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="仪器分类">
<el-select
v-model="form.name"
placeholder="请输入"
clearable
style="width: 100%"
>
<el-option> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="仪器型号">
<el-input
v-model="form.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
<!-- 仪器库存修改弹窗 -->
<el-dialog
title="仪器库存"
:visible.sync="dialogTableInventory"
width="30%"
show-close
>
<el-form :model="form" ref="form" size="small" label-width="108px">
<el-row>
<el-col :span="20">
<el-form-item label="仪器名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="旧库存数量">
<el-input v-model="form.name"> </el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="变动类型">
<el-input
v-model="form.name"
placeholder="请输入"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="变动数量">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="新库存数量">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="备注">
<el-input
v-model="form.name"
placeholder="请输入"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitInventory"
>确定</el-button
>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: 'instrumentManagement',
data() {
return {
queryForm: {
pageNum: 1,
pageSize: 10,
name: ''
},
//表格数据
tableData: [
{
name: 111222
}
],
title: '',
// 弹窗
form: {},
// 总计
total: 0,
//仪器新增/修改弹窗
dialogTableVisible: false,
// 仪器查看弹窗
dialogTablesee: false,
// 库存弹窗
dialogTableInventory: false,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true
}
},
methods: {
// 搜索
getList() {},
// 重置
resetQuery() {},
// 详情
handleLook(row) {
this.dialogTablesee = true
},
//
handAdd() {
this.dialogTableVisible = true
this.title = '新增仪器信息'
},
// 编辑
handleUpdate() {
this.dialogTableVisible = true
this.title = '修改仪器信息'
},
// 出库
handleOut() {
this.dialogTableInventory = true
},
// 入库
handleIn() {
this.dialogTableInventory = true
},
// 库存确定
submitInventory() {
this.dialogTableInventory = false
},
// 仪器确定
submitparentForm() {
this.dialogTableVisible = false
},
//取消按钮
cancel() {
this.dialogTableVisible = false
this.dialogTableInventory = false
},
//删除按钮操作
handleDelete(id) {
this.$confirm('此操作将永久删除该数据,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除!'
})
})
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
}
}
}
</script>
<style lang="scss" scoped>
.el-form {
margin-top: 15px;
margin-left: 10px;
}
.el-table {
margin-left: 10px;
}
.el-row {
margin-left: 10px;
}
</style>
\ No newline at end of file
<!--数据维护 -->
<template>
<div>
<el-form style="margin-top: 20px;margin-left: 20px;" :inline="true" :model="queryForm" class="demo-form-inline">
<el-form-item label="姓名">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="任务名称">
<el-select v-model="form.region" placeholder="请选择活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" icon="el-icon-search" type="primary" @click="handleQuery">搜索</el-button>
<el-button size="mini" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button size="mini" icon="el-icon-refresh" @click="handleMutiSubmit">提交</el-button>
</el-form-item>
</el-form>
<el-table ref="multipleTable" style="margin-top: 20px;" border :data="tableData" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
:selectable="selectable">
<template>
</template>
</el-table-column>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column label="是否填写" align="center" prop="schoolYear" min-width="200"/>
<el-table-column label="学年学期" align="center" prop="level" min-width="150"/>
<el-table-column label="级部" align="center" min-width="150" prop="name"/>
<el-table-column label="姓名" align="center" min-width="200" prop="IDNum"/>
<el-table-column label="年龄" align="center" min-width="150" prop="schedule"/>
<el-table-column label="职称" align="center" min-width="150" prop="schedule"/>
<el-table-column label="学历" align="center" min-width="150" prop="schedule"/>
<el-table-column label="政治面貌" align="center" min-width="150" prop="schedule"/>
<el-table-column label="任教学科" align="center" min-width="150" prop="schedule"/>
<el-table-column label="任教班级" align="center" min-width="150" prop="schedule"/>
<el-table-column label="任正班主任班级" align="center" min-width="150" prop="schedule"/>
<el-table-column fixed="right" label="操作" align="center" min-width="200">
<template slot-scope="scope">
<!--已填写 未确认-->
<div>
<el-button
size="mini"
type="text"
@click="handleSubmit(scope.row)">提交
</el-button>
<el-button
size="mini"
type="text"
@click="handleReject(scope.row)">驳回
</el-button>
<el-button
size="mini"
type="text"
@click="handleEdit(scope.row)">修改
</el-button>
</div>
<!--未填写,无按钮-->
<div></div>
<!--已确认 只查看-->
<div>
<el-button
size="mini"
type="text"
@click="handleCheck(scope.row)">查看
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
<!--弹窗-->
<el-dialog
:title=title
:visible.sync="dialogVisible"
width="100%">
<div style="display:flex;">
<div class="leftContent">
<div style="margin-bottom: 10px">
<span class="line"></span>
<span class="title">基本信息</span>
</div>
<el-form size="mini" ref="form" label-position="left" :model="dialogForm" label-width="120px">
<el-form-item label="学年学期:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="级部:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="姓名:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="性别:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="年龄:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="职称:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="学历:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="政治面貌:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任教学科:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任教班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任正班主任班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任副班主任班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="是否教学组长:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="是否教研组长:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="设计课时量:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="班主任情况:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
</el-form>
<span style="display: flex;justify-content: center" slot="footer" class="dialog-footer">
<div v-if="check == false">
<el-button size="small" type="primary" @click="confirmDialog">保 存</el-button>
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
</div>
<el-button v-else size="small" type="primary" @click="dialogVisible = false">关 闭</el-button>
</span>
</div>
<div class="rightContent">
<div style="margin-bottom: 10px">
<span class="line"></span>
<span class="title">教育科研</span>
<el-button type="success" size="mini" style="float: right;margin-right: 50px;margin-top: 10px;">提 取
</el-button>
</div>
<div class="tableList">
<div class="tableFirst">
<div class="tableTitle">
<i class="el-icon-collection"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableFirstData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="论文名称">
</el-table-column>
<el-table-column
align="center"
prop="province"
label="级别">
</el-table-column>
<el-table-column
align="center"
prop="city"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableSecond">
<div class="tableTitle">
<i class="el-icon-edit-outline"></i>
<span style="margin-left: 5px">课题、结题、专著、校本教材编写情况</span>
</div>
<el-table
:data="tableSecondData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableThird">
<div class="tableTitle">
<i class="el-icon-data-analysis"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableThirdData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="培训时间">
</el-table-column>
<el-table-column
align="center"
prop="address"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableForth">
<div class="tableTitle">
<i class="el-icon-trophy"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableForthData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="获奖名称">
</el-table-column>
<el-table-column
align="center"
prop="address"
label="获奖时间">
</el-table-column>
<el-table-column
align="center"
prop="address"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "gradeElectronicRecord",
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
queryForm: {
level: '',
name: '',
region: ''
},
tableData: [{
id:1,
schoolYear: '未填写',
level: '2022级部',
name: '张三',
IDNum: '121212121212121212',
schedule: '未填写'
},{
id:2,
schoolYear: '已填写,未确认',
level: '2022级部',
name: '张三',
IDNum: '121212121212121212',
schedule: '未填写'
},{
id:3,
schoolYear: '已确认',
level: '2022级部',
name: '张三',
IDNum: '121212121212121212',
schedule: '未填写'
}],
dialogVisible: false,
form: {},
status: this.$route.query.status,
dialogTableData: [{
level: '2022',
name: '李四',
ID: '12121212121212'
}],
check: false,
//弹窗表单
dialogForm: {},
//弹窗标题
title: '',
//弹窗表格1
tableFirstData: [],
//弹窗表格2
tableSecondData: [],
//弹窗表格3
tableThirdData: [],
//弹窗表格4
tableForthData: [],
// 多选
ids:[]
}
},
mounted() {
console.log('id', this.$route.query.id)
console.log('status', this.status)
},
methods: {
/** 查询信息列表 */
getList() {
this.loading = true;
//接口
// listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.userList = response.rows;
// this.total = response.total;
// this.loading = false;
// }
},
// 搜索按钮
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
// 重置按钮
resetQuery() {
this.queryForm = {
pageNum: 1,
pageSize: 10,
level: '',
name: '',
region: ''
}
this.handleQuery()
},
//多选
handleSelectionChange(row){
console.log('row',row)
this.ids = row.map(item => item.id)
console.log('this.ids',this.ids)
},
//是否可勾选
selectable(row,index){
if(row.schoolYear == '已填写,未确认'){
return true
}
},
//多选提交
handleMutiSubmit(){
},
//查看按钮
handleCheck(row) {
this.check = true
this.title = '基本信息查看'
this.dialogVisible = true
},
//修改按钮
handleEdit(row) {
this.check = false
this.title = '基本信息修改'
this.dialogVisible = true
},
//提交按钮
handleSubmit(row) {
},
//驳回按钮
handleReject(row){},
//弹窗确定按钮
confirmDialog() {
this.dialogVisible = false
},
}
}
</script>
<style scoped>
.leftContent {
padding-top: 5px;
padding-left: 10px;
width: 25%;
border: 1px solid silver;
border-radius: 10px;
padding-bottom: 10px;
}
.rightContent {
padding-top: 5px;
padding-left: 10px;
margin-left: 5px;
width: 75%;
border: 1px solid silver;
border-radius: 10px;
}
.line {
display: inline-block;
width: 5px;
height: 20px;
vertical-align: middle;
background: #0d84ff;
border-radius: 5px;
}
.title {
padding-left: 10px;
font-size: 16px;
vertical-align: middle;
}
</style>
<template>
<div class="app-container">
<el-form :model="queryForm" ref="queryForm" size="small" :inline="true" label-width="80px">
<el-form-item prop="taskName" label="社团名称">
<el-input v-model="queryForm.taskName" placeholder="社团名称"></el-input>
</el-form-item>
<el-form-item prop="grade" label="指导教师">
<el-input v-model="queryForm.grade" placeholder="指导教师"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd()">新增</el-button>
</el-col>
</el-row>
<!-- 列表 -->
<div class="listBlock">
<div class="itemBlock" v-for="(task, index) in tasks" :key="index">
<div style="display:flex; justify-content:space-between;align-items: center ">
<div style="width: 50%;">
<!-- 任务详细信息 -->
<div class="task-info">
<div class="task-name">市二中田径社团</div>
</div>
<div class="task-level">
<span>指导教师:张三</span>
</div>
<div class="task-time">
<div>社团宗旨:整合</div>
</div>
</div>
<div style="width: 50%">
<!-- 成员人数 -->
<div class="task-count">
<div class="count">
200
</div>
<div class="sun">成员人数</div>
</div>
</div>
</div>
<!-- 按钮 -->
<div class="task-buttons">
<el-button style="margin-left: 10px" size="mini" type="danger" round @click="handleUpdate(task)">删除
</el-button>
<el-button type="success" size="small" round @click="clubRegistrationReview(task.id, task.grade)">社团报名审核</el-button>
<el-button type="info" size="small" round @click="clubActivityRecord(task.id, task.grade)">社团活动记录</el-button>
<el-button type="warning" size="small" round
@click="memberManagement(task.id, task.grade)">成员管理
</el-button>
<el-button class="purpleBtn" size="small" round type="primary"
@click="communityStyle(task.id, task.grade)">社团风采
</el-button>
<el-button type="primary" size="small" round
@click="basicInformation(task.id, task.grade)">基础信息管理
</el-button>
</div>
</div>
</div>
<!-- 新增/修改弹窗 -->
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<div>
<el-form-item label="社团名称" prop="taskName">
<el-input v-model="form.taskName" placeholder="请输入社团名称"></el-input>
</el-form-item>
<el-form-item label="指导教师">
<el-select style="width: 100%;" multiple v-model="form.value" filterable placeholder="请选择指导教师">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="社团宗旨" prop="grade">
<el-input type="textarea" :rows="4" v-model="form.grade" placeholder="请输入社团宗旨"></el-input>
</el-form-item>
<el-form-item label="社团简介" prop="grade">
<el-input type="textarea" :rows="4" v-model="form.grade" placeholder="请输入社团简介"></el-input>
</el-form-item>
</div>
</el-form>
<div style="text-align: center">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {dataCurricula, addCurricula, updateCurricula, getCurricula, getDept}
from "@/api/smartSchool/gradeWork/courseSelection/taskPublishing.js";
export default {
name: 'basicInformationManagement',
data() {
return {
tasks: [1, 2, 3],
queryForm: {
taskName: "",
grade: "",
},
form: {
id: "",
taskName: "",
grade: "",
startTime: "",
endTime: "",
},
//新增弹窗
open: false,
rules: {},
// 加载遮罩
loading: true,
// 记录条数
total: 0,
title: "",
// 详情
look: false,
// 日期范围
dateRange: [],
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
};
},
created() {
this.getList();
},
methods: {
/** 获取列表数据 */
getList() {
const params = {
taskName: this.queryForm.taskName,
grade: this.queryForm.grade,
};
// dataCurricula(params).then(response => {
// this.tasks = response.rows;
// this.total = response.total;
// }).catch(err => {
// this.loading = false;
// })
},
//新增按钮操作
handleAdd() {
this.reset();
this.open = true;
// getDept().then(response => {
// this.form.grade = response.data.grade;
// console.log(this.form.grade);
// })
// .catch(err => {
// this.loading = false;
// });
this.title = "新增社团基础信息";
},
// 社团报名审核
clubRegistrationReview(id, grade) {
this.$router.push({
path: "/massOrganization/clubRegistrationReview",
query: {
id,
grade
}
});
},
// 社团活动记录
clubActivityRecord(id, grade) {
this.$router.push({
path: "/massOrganization/clubActivityRecord",
query: {
id,
grade
}
});
},
//成员管理
memberManagement(id, grade) {
this.$router.push({
path: "/massOrganization/memberManagement",
query: {
id,
grade
}
});
},
//社团风采
communityStyle(id, grade) {
console.log("grade", grade)
this.$router.push({
path: "/massOrganization/communityStyle",
query: {
id,
grade
}
});
},
//基础信息管理
basicInformation(id, grade) {
this.reset();
this.open = true;
this.title = "社团基础信息维护";
},
// 取消按钮
cancel() {
this.open = false;
// this.resetQuery();
this.reset();
},
// 搜索按钮
handleQuery() {
this.throttle(() => {
this.queryForm.pageNum = 1;
this.getList();
});
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 提交表单
submitForm() {
// console.log('object', this.dateRange);
this.throttle(() => {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
// 编辑
const params = {
id: this.form.id,
taskName: this.form.taskName,
startTime: this.dateRange[0],
endTime: this.dateRange[1]
};
updateCurricula(params).then(response => {
console.log(params, 'params');
console.log("res1111");
this.$message.success("修改成功");
console.log("res", response);
this.open = false;
this.getList();
}).catch(err => {
});
} else {
// 新增
const params = {
taskName: this.form.taskName,
grade: this.form.grade,
startTime: this.dateRange[0],
endTime: this.dateRange[1]
};
addCurricula(params).then(response => {
this.$message.success("新增成功");
this.open = false;
this.getList();
}).catch(err => {
// Handle error if necessary
});
}
}
});
})
},
// 编辑按钮
handleUpdate(task) {
this.title = '修改';
this.open = true;
getCurricula(task.id).then(response => {
this.form = response.data;
this.dateRange = [response.data.startTime, response.data.endTime];
this.$modal.closeLoading();
}).catch(err => {
})
},
// 重置表单
reset() {
// 重置对话框表单
this.form = {
taskName: "",
grade: "",
};
this.dateRange = [];
this.resetForm('form');
},
},
};
</script>
<style lang="scss" scoped>
.listBlock {
//display: flex;
//flex-direction: row;
//align-items: flex-start;
//flex-wrap: wrap;
width: 100%;
}
.itemBlock {
width: 100%;
padding: 15px 20px 5px 20px;
margin: 0 1.5% 1.5% 0;
border-radius: 20px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.listBlock .itemBlock:nth-child(2n) {
margin-right: 0px !important;
}
.purpleBtn {
color: #FFFFFF;
background-color: #B66D93;
border: 1px solid #B66D93;
}
.rowBtn {
color: #FFFFFF;
background-color: #D3C1B1;
border: 1px solid #D3C1B1;
}
.task-name {
color: #0d84ff;
font-size: 38px;
//font-weight: 500;
text-align: left;
}
.task-level {
margin-bottom: 6px;
color: rgba(108, 108, 108, 1);
font-size: 13px;
text-align: left;
}
.task-level > span {
margin-right: 25px;
}
.task-time {
color: rgba(108, 108, 108, 1);
font-size: 13px;
text-align: left;
}
.task-info {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-bottom: 15px;
}
.task-count {
text-align: center;
padding-right: 10px;
}
.task-count > .count {
color: rgba(90, 123, 244, 1);
font-size: 38px;
font-weight: bold;
}
.task-count > .sun {
color: rgba(16, 16, 16, 1);
font-size: 18px;
text-align: center;
font-weight: bold;
}
.task-buttons {
text-align: left;
margin-top: 20px;
display: flex;
flex-direction: row-reverse;
}
.task-buttons button {
margin-bottom: 10px;
}
.el-card {
margin-bottom: 20px;
}
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="标题" prop="picName">
<el-input v-model="queryParams.picName" placeholder="请输入标题" clearable/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" icon="el-icon-plus" size="mini" @click="handleAdd">修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"-->
<!-- v-hasPermi="['system:pic:export']">导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>-->
</el-row>
<el-table v-loading="loading" ref="table" :data="picList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" prop="seqencing" width="80"/>
<el-table-column label="活动主题" align="center" prop="picName"/>
<el-table-column label="活动开始时间" align="center" prop="picName"/>
<el-table-column label="活动结束时间" align="center" prop="picName"/>
<el-table-column label="活动负责人" align="center" prop="picName"/>
<el-table-column label="所属社团" align="center" prop="picName"/>
<el-table-column label="备注" align="center" prop="picName"/>
<el-table-column label="附件" align="center" prop="picName">
<template slot-scope="scope">
<!-- <ListImage :image-url="pev+scope.row.picUrl"></ListImage>-->
<!-- previewSrcList 开启预览大图的功能。-->
<el-image
style="width: 100px; height: 100px"
:src="scope.row.url"
:preview-src-list="srcList">
</el-image>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)">查看
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 添加或修改社团主题对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px" style="width: 80%; margin: auto">
<el-form-item label="活动主题">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="活动开始时间">
<el-date-picker
v-model="form.value1"
type="datetime"
placeholder="选择活动开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动结束时间">
<el-date-picker
v-model="form.value1"
type="datetime"
placeholder="选择活动结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动负责人">
<el-select v-model="value" filterable placeholder="请选择活动负责人">
<el-option
v-for="item in activeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属社团">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item prop="gardenEmblem"
style="display: flex; text-align: center; justify-content: center; transform: translateX(-30px)">
<!-- <el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"-->
<!-- :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" :on-remove="handleRemove"-->
<!-- :http-request="uploadImage" :limit="1" >-->
<el-upload :disabled="check == true ? true : false" v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"
:show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" :on-remove="handleRemove"
:limit="1" >
<img v-if="imageUrl" :src="imageUrl" class="avatar"/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="风采主题:" prop="picName">
<el-input :readonly="check == true ? true : false" v-model="form.picName" placeholder="请输入风采主题" style="width: 100%"/>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="排序:" prop="seqencing">-->
<!-- <el-input-number v-model="form.seqencing" controls-position="right" style="width: 100%"-->
<!-- :min="1"></el-input-number>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listPic, getPic, delPic, addPic, updatePic, updateState} from '@/api/smartSchool/schoolManage/introduce/pic'
import picAvatar from '@/views/smartSchool/schoolManage/introduce/schoolInfo/profile/picAvatar'
import {changeUserStatus} from '@/api/system/user'
import {uploadImage as commonUpload} from '@/api/common'
import {ExportType, TEXT_SIZE} from '@/enums/common'
export default {
name: 'clubActivityRecord',
components: {picAvatar},
data() {
return {
pev: process.env.VUE_APP_BASE_API,
// 输入框字数限制
TEXT_SIZE,
//是否上传的院徽
isUploadPic: false,
//照片是否删除
options: [
{
value: 0,
label: '否'
},
{
value: 1,
label: '是'
}
],
//获取子组件传来的信息
pic: [],
// 图片路径
imageUrl: undefined,
// 图片上传遮罩层
uploadLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 园区照片表格数据
picList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
picName: null
},
// 表单参数
form: {},
// 表单校验
rules: {
picName: [{required: true, message: '请输入相片名称', trigger: 'blur'}],
seqencing: [{required: true, message: '请输入排序', trigger: 'blur'}],
remark: [{max: TEXT_SIZE, message: '备注信息在0到200字之间', trigger: 'blur'}]
},
//设置table列隐藏与显示
columns: [
{key: 0, label: `园区照片`, visible: true},
{key: 1, label: `相片名称`, visible: true},
// {key: 2, label: `相片路径`, visible: true},
{key: 2, label: `排序`, visible: true},
{key: 3, label: `备注`, visible: true},
{key: 4, label: `创建者`, visible: true},
{key: 5, label: `创建时间`, visible: true},
{key: 6, label: `操作`, visible: true}
],
// 作为临时图片展示
tempImage: '',
// 导出选项
exportOptions: {
title: '选择导出类别',
open: false
},
//查看状态
check:false,
//活动负责人下拉框
activeOptions:[{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}]
}
},
created() {
this.getList()
},
watch: {
pic: {
handler(newValue, oldValue) {
console.log('watch----oldValue', oldValue)
console.log('watch----newValue', newValue)
this.isUploadPic = newValue[3]
}
}
},
methods: {
//是否删除 选中值发生变化时id处理函数
selectChangeHandler(value) {
this.form.isShow = value
},
/** 查询园区照片列表 */
getList() {
this.loading = true
this.picList = []
listPic(this.queryParams).then(response => {
this.picList = response.rows
this.total = response.total
this.loading = false
})
},
//获取图片信息
getSchoolInfoPic(val) {
this.pic = val
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
params: {},
id: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
picName: null,
picUrl: null,
seqencing: null,
isShow: 0
}
this.imageUrl = ''
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.throttle(() => {
this.queryParams.pageNum = 1
this.getList()
})
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.check = false
this.reset()
this.open = true
this.title = '新增社团风采'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const ids = row.id || this.ids
getPic(ids).then(response => {
this.form = response.data
this.imageUrl = this.pev + this.form.picUrl
this.open = true
this.title = '修改园区照片'
})
},
/** 查看按钮操作 */
handleCheck(row){
this.check = true
this.open = true
this.title = '查看社团风采'
},
// 上传成功回调
handleAvatarSuccess(res, file) {
this.imageUrl = res.data.url
console.log(file)
this.commonUpload(file)
},
// 上传前格式和图片大小限制
beforeAvatarUpload(file) {
const type = file.type === 'image/jpeg' || 'image/jpg' || 'image/webp' || 'image/png'
const isLt2M = file.size / 1024 / 1024 < 2
if (!type) {
this.$message.error('图片格式不正确!(只能包含jpg,png,webp,JPEG)')
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 2MB!')
}
return type && isLt2M
},
//删除图片
handleRemove(file, fileList){
this.imageUrl = ''
},
// 上传图片
uploadImage(file) {
const fileData = file.file
const formData = new FormData()
formData.append('file', fileData)
this.uploadLoading = true
commonUpload(formData)
.then(response => {
this.uploadLoading = false
this.$modal.msgSuccess('上传成功')
this.imageUrl = this.pev + response.url
// this.form.picUrl = process.env.VUE_APP_BASE_API + response.url
this.form.picUrl = response.url
})
.catch(error => {
this.uploadLoading = false
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.$modal.loading('正在上传数据,请稍等...')
if (this.form.id != null) {
updatePic({
...this.form
})
.then(response => {
this.$modal.closeLoading()
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
.catch(error => {
this.$modal.closeLoading()
})
} else {
addPic({
...this.form,
isShow: '0'
})
.then(response => {
this.$modal.closeLoading()
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
.catch(error => {
this.$modal.closeLoading()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
if (ids) {
this.$modal
.confirm(`是否确认删除选中的${Object.hasOwnProperty.call(ids, 'length') ? ids.length : 1}条数据?`)
.then(() => {
this.$modal.loading('正在处理数据,请稍等...')
return delPic(ids)
})
.then(() => {
this.$modal.closeLoading()
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {
this.$modal.closeLoading()
})
}
},
/** 是否发布 */
handleIsShow(row) {
this.$modal
.confirm(row.isShow === '1' ? '是否确认显示为轮播图?' : '是否取消显示为轮播图?')
.then(() => {
this.$modal.loading('正在修改状态,请稍等...')
updateState(row.id, row.isShow)
.then(response => {
this.$modal.closeLoading()
this.$modal.msgSuccess('修改成功')
})
.catch(error => {
this.$modal.closeLoading()
row.isShow = row.isShow === '0' ? '1' : '0'
})
})
.catch(() => {
row.isShow = row.isShow === '0' ? '1' : '0'
})
}
}
}
</script>
<style scoped>
.avatar,
.avatar-uploader,
.el-icon-plus {
width: 650px;
}
</style>
<template>
<div>社团报名审核</div>
</template>
<script>
export default {
name: "clubRegistrationReview"
}
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="标题" prop="picName">
<el-input v-model="queryParams.picName" placeholder="请输入标题" clearable/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"-->
<!-- v-hasPermi="['system:pic:export']">导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>-->
</el-row>
<el-table v-loading="loading" ref="table" :data="picList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" prop="seqencing" width="80"/>
<el-table-column label="风采主题" align="center" prop="picName"/>
<el-table-column label="附件" align="center" prop="picName">
<template slot-scope="scope">
<!-- <ListImage :image-url="pev+scope.row.picUrl"></ListImage>-->
<!-- previewSrcList 开启预览大图的功能。-->
<el-image
style="width: 100px; height: 100px"
:src="scope.row.url"
:preview-src-list="srcList">
</el-image>
</template>
</el-table-column>
<el-table-column label="是否发布" align="center" prop="isShow">
<template slot-scope="scope">
<el-switch v-model="scope.row.isShow" active-value="1" inactive-value="0"
@change="handleIsShow(scope.row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="columns[6].visible">
<template slot-scope="scope">
<!-- 未发布可以修改删除 -->
<div>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
</el-button>
</div>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)">查看
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 添加或修改社团主题对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px" style="width: 80%; margin: auto">
<el-form-item prop="gardenEmblem"
style="display: flex; text-align: center; justify-content: center; transform: translateX(-30px)">
<!-- <el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"-->
<!-- :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" :on-remove="handleRemove"-->
<!-- :http-request="uploadImage" :limit="1" >-->
<el-upload :disabled="check == true ? true : false" v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"
:show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" :on-remove="handleRemove"
:limit="1" >
<img v-if="imageUrl" :src="imageUrl" class="avatar"/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="风采主题:" prop="picName">
<el-input :readonly="check == true ? true : false" v-model="form.picName" placeholder="请输入风采主题" style="width: 100%"/>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="排序:" prop="seqencing">-->
<!-- <el-input-number v-model="form.seqencing" controls-position="right" style="width: 100%"-->
<!-- :min="1"></el-input-number>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listPic, getPic, delPic, addPic, updatePic, updateState} from '@/api/smartSchool/schoolManage/introduce/pic'
import picAvatar from '@/views/smartSchool/schoolManage/introduce/schoolInfo/profile/picAvatar'
import {changeUserStatus} from '@/api/system/user'
import {uploadImage as commonUpload} from '@/api/common'
import {ExportType, TEXT_SIZE} from '@/enums/common'
export default {
name: 'communityStyle',
components: {picAvatar},
data() {
return {
pev: process.env.VUE_APP_BASE_API,
// 输入框字数限制
TEXT_SIZE,
//是否上传的院徽
isUploadPic: false,
//照片是否删除
options: [
{
value: 0,
label: '否'
},
{
value: 1,
label: '是'
}
],
//获取子组件传来的信息
pic: [],
// 图片路径
imageUrl: undefined,
// 图片上传遮罩层
uploadLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 园区照片表格数据
picList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
picName: null
},
// 表单参数
form: {},
// 表单校验
rules: {
picName: [{required: true, message: '请输入相片名称', trigger: 'blur'}],
seqencing: [{required: true, message: '请输入排序', trigger: 'blur'}],
remark: [{max: TEXT_SIZE, message: '备注信息在0到200字之间', trigger: 'blur'}]
},
//设置table列隐藏与显示
columns: [
{key: 0, label: `园区照片`, visible: true},
{key: 1, label: `相片名称`, visible: true},
// {key: 2, label: `相片路径`, visible: true},
{key: 2, label: `排序`, visible: true},
{key: 3, label: `备注`, visible: true},
{key: 4, label: `创建者`, visible: true},
{key: 5, label: `创建时间`, visible: true},
{key: 6, label: `操作`, visible: true}
],
// 作为临时图片展示
tempImage: '',
// 导出选项
exportOptions: {
title: '选择导出类别',
open: false
},
//查看状态
check:false,
}
},
created() {
this.getList()
},
watch: {
pic: {
handler(newValue, oldValue) {
console.log('watch----oldValue', oldValue)
console.log('watch----newValue', newValue)
this.isUploadPic = newValue[3]
}
}
},
methods: {
//是否删除 选中值发生变化时id处理函数
selectChangeHandler(value) {
this.form.isShow = value
},
/** 查询园区照片列表 */
getList() {
this.loading = true
this.picList = []
listPic(this.queryParams).then(response => {
this.picList = response.rows
this.total = response.total
this.loading = false
})
},
//获取图片信息
getSchoolInfoPic(val) {
this.pic = val
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
params: {},
id: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
picName: null,
picUrl: null,
seqencing: null,
isShow: 0
}
this.imageUrl = ''
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.throttle(() => {
this.queryParams.pageNum = 1
this.getList()
})
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.check = false
this.reset()
this.open = true
this.title = '新增社团风采'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const ids = row.id || this.ids
getPic(ids).then(response => {
this.form = response.data
this.imageUrl = this.pev + this.form.picUrl
this.open = true
this.title = '修改园区照片'
})
},
/** 查看按钮操作 */
handleCheck(row){
this.check = true
this.open = true
this.title = '查看社团风采'
},
// 上传成功回调
handleAvatarSuccess(res, file) {
this.imageUrl = res.data.url
console.log(file)
this.commonUpload(file)
},
// 上传前格式和图片大小限制
beforeAvatarUpload(file) {
const type = file.type === 'image/jpeg' || 'image/jpg' || 'image/webp' || 'image/png'
const isLt2M = file.size / 1024 / 1024 < 2
if (!type) {
this.$message.error('图片格式不正确!(只能包含jpg,png,webp,JPEG)')
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 2MB!')
}
return type && isLt2M
},
//删除图片
handleRemove(file, fileList){
this.imageUrl = ''
},
// 上传图片
uploadImage(file) {
const fileData = file.file
const formData = new FormData()
formData.append('file', fileData)
this.uploadLoading = true
commonUpload(formData)
.then(response => {
this.uploadLoading = false
this.$modal.msgSuccess('上传成功')
this.imageUrl = this.pev + response.url
// this.form.picUrl = process.env.VUE_APP_BASE_API + response.url
this.form.picUrl = response.url
})
.catch(error => {
this.uploadLoading = false
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.$modal.loading('正在上传数据,请稍等...')
if (this.form.id != null) {
updatePic({
...this.form
})
.then(response => {
this.$modal.closeLoading()
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
.catch(error => {
this.$modal.closeLoading()
})
} else {
addPic({
...this.form,
isShow: '0'
})
.then(response => {
this.$modal.closeLoading()
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
.catch(error => {
this.$modal.closeLoading()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
if (ids) {
this.$modal
.confirm(`是否确认删除选中的${Object.hasOwnProperty.call(ids, 'length') ? ids.length : 1}条数据?`)
.then(() => {
this.$modal.loading('正在处理数据,请稍等...')
return delPic(ids)
})
.then(() => {
this.$modal.closeLoading()
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {
this.$modal.closeLoading()
})
}
},
/** 是否发布 */
handleIsShow(row) {
this.$modal
.confirm(row.isShow === '1' ? '是否确认显示为轮播图?' : '是否取消显示为轮播图?')
.then(() => {
this.$modal.loading('正在修改状态,请稍等...')
updateState(row.id, row.isShow)
.then(response => {
this.$modal.closeLoading()
this.$modal.msgSuccess('修改成功')
})
.catch(error => {
this.$modal.closeLoading()
row.isShow = row.isShow === '0' ? '1' : '0'
})
})
.catch(() => {
row.isShow = row.isShow === '0' ? '1' : '0'
})
}
}
}
</script>
<style scoped>
.avatar,
.avatar-uploader,
.el-icon-plus {
width: 650px;
}
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="年级:" prop="picName">
<el-input v-model="queryParams.picName" placeholder="请输入年级" clearable/>
</el-form-item>
<el-form-item label="班级:" prop="picName">
<el-input v-model="queryParams.picName" placeholder="请输入班级" clearable/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" ref="table" :data="picList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" prop="seqencing" width="80"/>
<el-table-column label="身份证号" align="center" prop="picName"/>
<el-table-column label="年级" align="center" prop="picName"/>
<el-table-column label="班级" align="center" prop="picName"/>
<el-table-column label="社团部门" align="center" prop="picName"/>
<el-table-column label="社团职位" align="center" prop="picName"/>
<el-table-column label="联系方式" align="center" prop="picName"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 添加或修改社团主题对话框 -->
<el-dialog :title="title" :visible.sync="open" width="30%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px" >
<el-form-item label="姓名:" prop="picName">
<el-select v-model="form.value" style="width: 100%;" filterable placeholder="请选择姓名">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="性别:" prop="picName">
<el-input readonly v-model="form.picName" placeholder="请输入性别:"/>
</el-form-item>
<el-form-item label="身份证号:" prop="picName">
<el-input readonly v-model="form.picName" placeholder="请输入身份证号"/>
</el-form-item>
<el-form-item label="年级:" prop="picName">
<el-input readonly v-model="form.picName" placeholder="请输入年级"/>
</el-form-item>
<el-form-item label="班级:" prop="picName">
<el-input readonly v-model="form.picName" placeholder="请输入班级"/>
</el-form-item>
<el-form-item label="联系方式:" prop="picName">
<el-input v-model="form.picName" placeholder="请输入联系方式"/>
</el-form-item>
<el-form-item label="社团部门:" prop="picName">
<el-input v-model="form.picName" placeholder="请输入社团部门"/>
</el-form-item>
<el-form-item label="社团职位:" prop="picName">
<el-input v-model="form.picName" placeholder="请输入社团职位"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listPic, getPic, delPic, addPic, updatePic, updateState} from '@/api/smartSchool/schoolManage/introduce/pic'
import picAvatar from '@/views/smartSchool/schoolManage/introduce/schoolInfo/profile/picAvatar'
import {changeUserStatus} from '@/api/system/user'
import {uploadImage as commonUpload} from '@/api/common'
import {ExportType, TEXT_SIZE} from '@/enums/common'
export default {
name: 'communityStyle',
components: {picAvatar},
data() {
return {
pev: process.env.VUE_APP_BASE_API,
// 输入框字数限制
TEXT_SIZE,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
picName: null
},
// 表单参数
form: {},
// 表单校验
rules: {
picName: [{required: true, message: '请输入相片名称', trigger: 'blur'}],
seqencing: [{required: true, message: '请输入排序', trigger: 'blur'}],
remark: [{max: TEXT_SIZE, message: '备注信息在0到200字之间', trigger: 'blur'}]
},
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
}
},
created() {
this.getList()
},
methods: {
/** 查询园区照片列表 */
getList() {
this.loading = true
this.picList = []
listPic(this.queryParams).then(response => {
this.picList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
params: {},
id: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
picName: null,
picUrl: null,
seqencing: null,
isShow: 0
}
this.imageUrl = ''
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.throttle(() => {
this.queryParams.pageNum = 1
this.getList()
})
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '新增社团成员'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const ids = row.id || this.ids
getPic(ids).then(response => {
this.form = response.data
this.imageUrl = this.pev + this.form.picUrl
this.open = true
this.title = '修改社团成员信息'
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.$modal.loading('正在上传数据,请稍等...')
if (this.form.id != null) {
updatePic({
...this.form
})
.then(response => {
this.$modal.closeLoading()
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
.catch(error => {
this.$modal.closeLoading()
})
} else {
addPic({
...this.form,
isShow: '0'
})
.then(response => {
this.$modal.closeLoading()
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
.catch(error => {
this.$modal.closeLoading()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
if (ids) {
this.$modal
.confirm(`是否确认删除选中的${Object.hasOwnProperty.call(ids, 'length') ? ids.length : 1}条数据?`)
.then(() => {
this.$modal.loading('正在处理数据,请稍等...')
return delPic(ids)
})
.then(() => {
this.$modal.closeLoading()
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {
this.$modal.closeLoading()
})
}
},
}
}
</script>
<style scoped>
.avatar,
.avatar-uploader,
.el-icon-plus {
width: 650px;
}
</style>
<!--数据维护 -->
<template>
<div>
<el-form style="margin-top: 20px;margin-left: 20px;" :inline="true" :model="queryForm" class="demo-form-inline">
<el-form-item label="任务名称:">
<el-input v-model="queryForm.level" placeholder="请输入级部"></el-input>
</el-form-item>
<el-form-item>
<el-button size="mini" icon="el-icon-search" type="primary" @click="handleQuery">搜索</el-button>
<el-button size="mini" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button size="mini" icon="el-icon-edit" type="warning" @click="handleEdit">修改</el-button>
</el-form-item>
</el-form>
<el-table style="margin-top: 20px;" border :data="tableData">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column label="任务名称" align="center" prop="schoolYear" min-width="200"/>
<el-table-column label="任务状态" align="center" prop="level" min-width="150"/>
<el-table-column label="填写状态" align="center" min-width="150" prop="name"/>
<el-table-column label="开始时间" align="center" min-width="200" prop="IDNum"/>
<el-table-column label="结束时间" align="center" min-width="150" prop="schedule"/>
<el-table-column fixed="right" label="操作" align="center" min-width="200">
<template slot-scope="scope">
<!--已发布 未填写/已驳回 已填写-->
<div>
<el-button
size="mini"
type="text"
@click="handleEdit(scope.row)">填写
</el-button>
<el-button
size="mini"
type="text"
@click="handleSubmit(scope.row)">提交
</el-button>
</div>
<!--已结束 已填写 / 已结束 级部已确认-->
<div>
<el-button
size="mini"
type="text"
@click="handleCheck(scope.row)">查看
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
<!--弹窗-->
<el-dialog
:title=title
:visible.sync="dialogVisible"
width="100%">
<div style="display:flex;">
<div class="leftContent">
<div style="margin-bottom: 10px">
<span class="line"></span>
<span class="title">基本信息</span>
</div>
<el-form size="mini" ref="form" label-position="left" :model="dialogForm" label-width="120px">
<el-form-item label="学年学期:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="级部:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="姓名:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="性别:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="年龄:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="职称:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="学历:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="政治面貌:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任教学科:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任教班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任正班主任班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任副班主任班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="是否教学组长:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="是否教研组长:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="设计课时量:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="班主任情况:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
</el-form>
<span style="display: flex;justify-content: center" slot="footer" class="dialog-footer">
<div v-if="check == false">
<el-button size="small" type="primary" @click="confirmDialog">保 存</el-button>
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
</div>
<el-button v-else size="small" type="primary" @click="dialogVisible = false">关 闭</el-button>
</span>
</div>
<div class="rightContent">
<div style="margin-bottom: 10px">
<span class="line"></span>
<span class="title">教育科研</span>
<el-button type="success" size="mini" style="float: right;margin-right: 50px;margin-top: 10px;">提 取
</el-button>
</div>
<div class="tableList">
<div class="tableFirst">
<div class="tableTitle">
<i class="el-icon-collection"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableFirstData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="论文名称">
</el-table-column>
<el-table-column
align="center"
prop="province"
label="级别">
</el-table-column>
<el-table-column
align="center"
prop="city"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableSecond">
<div class="tableTitle">
<i class="el-icon-edit-outline"></i>
<span style="margin-left: 5px">课题、结题、专著、校本教材编写情况</span>
</div>
<el-table
:data="tableSecondData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableThird">
<div class="tableTitle">
<i class="el-icon-data-analysis"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableThirdData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="培训时间">
</el-table-column>
<el-table-column
align="center"
prop="address"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableForth">
<div class="tableTitle">
<i class="el-icon-trophy"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableForthData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="获奖名称">
</el-table-column>
<el-table-column
align="center"
prop="address"
label="获奖时间">
</el-table-column>
<el-table-column
align="center"
prop="address"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "personElectronicRecord",
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
queryForm: {
level: '',
name: '',
region: ''
},
tableData: [{
schoolYear: '2022学年上学期',
level: '2022级部',
name: '张三',
IDNum: '121212121212121212',
schedule: '未填写'
}],
dialogVisible: false,
form: {},
status: this.$route.query.status,
dialogTableData: [{
level: '2022',
name: '李四',
ID: '12121212121212'
}],
check: false,
//弹窗表单
dialogForm: {},
//弹窗标题
title: '',
//弹窗表格1
tableFirstData: [],
//弹窗表格2
tableSecondData: [],
//弹窗表格3
tableThirdData: [],
//弹窗表格4
tableForthData: []
}
},
mounted() {
console.log('id', this.$route.query.id)
console.log('status', this.status)
},
methods: {
/** 查询信息列表 */
getList() {
this.loading = true;
//接口
// listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.userList = response.rows;
// this.total = response.total;
// this.loading = false;
// }
},
// 搜索按钮
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
// 重置按钮
resetQuery() {
this.queryForm = {
pageNum: 1,
pageSize: 10,
level: '',
name: '',
region: ''
}
this.handleQuery()
},
//查看按钮
handleCheck(row) {
this.check = true
this.title = '基本信息查看'
this.dialogVisible = true
},
//填写按钮
handleEdit(row) {
this.check = false
this.title = '基本信息修改'
this.dialogVisible = true
},
//提交按钮
handleSubmit(row) {
},
//弹窗确定按钮
confirmDialog() {
this.dialogVisible = false
},
}
}
</script>
<style scoped>
.leftContent {
padding-top: 5px;
padding-left: 10px;
width: 25%;
border: 1px solid silver;
border-radius: 10px;
padding-bottom: 10px;
}
.rightContent {
padding-top: 5px;
padding-left: 10px;
margin-left: 5px;
width: 75%;
border: 1px solid silver;
border-radius: 10px;
}
.line {
display: inline-block;
width: 5px;
height: 20px;
vertical-align: middle;
background: #0d84ff;
border-radius: 5px;
}
.title {
padding-left: 10px;
font-size: 16px;
vertical-align: middle;
}
</style>
<!--数据维护 -->
<template>
<div>
<el-form style="margin-top: 20px;margin-left: 20px;" :inline="true" :model="queryForm" class="demo-form-inline">
<el-form-item label="级部:">
<el-input v-model="queryForm.level" placeholder="请输入级部"></el-input>
</el-form-item>
<el-form-item label="姓名:">
<el-input v-model="queryForm.name" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item label="任教学科:">
<el-input v-model="queryForm.name" placeholder="请输入任教学科"></el-input>
</el-form-item>
<el-form-item>
<el-button size="mini" icon="el-icon-search" type="primary" @click="handleQuery">搜索</el-button>
<el-button size="mini" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table style="margin-top: 20px;" border :data="tableData">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column label="学年学期" align="center" prop="schoolYear" min-width="200"/>
<el-table-column label="级部" align="center" prop="level" min-width="150"/>
<el-table-column label="姓名" align="center" min-width="150" prop="name"/>
<el-table-column label="身份证号" align="center" min-width="200" prop="IDNum"/>
<el-table-column label="进度" align="center" min-width="150" prop="schedule"/>
<el-table-column fixed="right" label="操作" align="center" min-width="200">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleCheck(scope.row)">查看
</el-button>
<el-button
:disabled="status == '已结束' ? true:false"
size="mini"
type="text"
@click="handleEdit(scope.row)">修改
</el-button>
<el-button
:disabled="status == '已结束' ? true:false"
size="mini"
type="text"
@click="handleDelete(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
<!--弹窗-->
<el-dialog
:title=title
:visible.sync="dialogVisible"
width="100%">
<div style="display:flex;">
<div class="leftContent">
<div style="margin-bottom: 10px">
<span class="line"></span>
<span class="title">基本信息</span>
</div>
<el-form size="mini" ref="form" label-position="left" :model="dialogForm" label-width="120px">
<el-form-item label="学年学期:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="级部:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="姓名:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="性别:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="年龄:" style="padding-right: 10px">
<el-input readonly v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="职称:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="学历:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="政治面貌:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任教学科:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任教班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任正班主任班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="任副班主任班级:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="是否教学组长:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="是否教研组长:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="设计课时量:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
<el-form-item label="班主任情况:" style="padding-right: 10px">
<el-input :readonly="check == true ? true:false" v-model="dialogForm.name"></el-input>
</el-form-item>
</el-form>
<span style="display: flex;justify-content: center" slot="footer" class="dialog-footer">
<div v-if="check == false">
<el-button size="small" type="primary" @click="confirmDialog">保 存</el-button>
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
</div>
<el-button v-else type="primary" size="small" @click="dialogVisible = false">关 闭</el-button>
</span>
</div>
<div class="rightContent">
<div style="margin-bottom: 10px">
<span class="line"></span>
<span class="title">教育科研</span>
<el-button type="success" size="mini" style="float: right;margin-right: 50px;margin-top: 10px;">提 取
</el-button>
</div>
<div class="tableList">
<div class="tableFirst">
<div class="tableTitle">
<i class="el-icon-collection"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableFirstData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="论文名称">
</el-table-column>
<el-table-column
align="center"
prop="province"
label="级别">
</el-table-column>
<el-table-column
align="center"
prop="city"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableSecond">
<div class="tableTitle">
<i class="el-icon-edit-outline"></i>
<span style="margin-left: 5px">课题、结题、专著、校本教材编写情况</span>
</div>
<el-table
:data="tableSecondData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableThird">
<div class="tableTitle">
<i class="el-icon-data-analysis"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableThirdData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="培训时间">
</el-table-column>
<el-table-column
align="center"
prop="address"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="tableForth">
<div class="tableTitle">
<i class="el-icon-trophy"></i>
<span style="margin-left: 5px">发表成就奖论文情况</span>
</div>
<el-table
:data="tableForthData"
border>
<el-table-column
align="center"
fixed
type="index"
label="序号">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="获奖名称">
</el-table-column>
<el-table-column
align="center"
prop="address"
label="获奖时间">
</el-table-column>
<el-table-column
align="center"
prop="address"
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">
<el-link type="success" href=""></el-link>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "dataReceiver",
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
queryForm: {
level: '',
name: '',
region: ''
},
tableData: [{
schoolYear: '2022学年上学期',
level: '2022级部',
name: '张三',
IDNum: '121212121212121212',
schedule: '未填写'
}],
dialogVisible: false,
form: {},
status: this.$route.query.status,
dialogTableData: [{
level: '2022',
name: '李四',
ID: '12121212121212'
}],
check: false,
//弹窗表单
dialogForm: {},
//弹窗标题
title: '',
//弹窗表格1
tableFirstData: [],
//弹窗表格2
tableSecondData: [],
//弹窗表格3
tableThirdData: [],
//弹窗表格4
tableForthData: []
}
},
mounted() {
console.log('id', this.$route.query.id)
console.log('status', this.status)
},
methods: {
/** 查询信息列表 */
getList() {
this.loading = true;
//接口
// listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.userList = response.rows;
// this.total = response.total;
// this.loading = false;
// }
},
// 搜索按钮
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
// 重置按钮
resetQuery() {
this.queryForm = {
pageNum: 1,
pageSize: 10,
level: '',
name: '',
region: ''
}
this.handleQuery()
},
//查看按钮
handleCheck(row) {
this.check = true
this.title = '基本信息查看'
this.dialogVisible = true
},
//修改按钮
handleEdit(row) {
this.check = false
this.title = '基本信息修改'
this.dialogVisible = true
},
//弹窗确定按钮
confirmDialog() {
this.dialogVisible = false
},
//多选按钮
handleSelectionChange(select) {
console.log('select', select)
},
// 删除按钮
handleDelete(row) {
//判断,如果进度是未填写可以直接删除不需要提醒
//如果是其他状态需要提示相应的状态
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
}
}
</script>
<style scoped>
.leftContent {
padding-top: 5px;
padding-left: 10px;
width: 25%;
border: 1px solid silver;
border-radius: 10px;
padding-bottom: 10px;
}
.rightContent {
padding-top: 5px;
padding-left: 10px;
margin-left: 5px;
width: 75%;
border: 1px solid silver;
border-radius: 10px;
}
.line {
display: inline-block;
width: 5px;
height: 20px;
vertical-align: middle;
background: #0d84ff;
border-radius: 5px;
}
.title {
padding-left: 10px;
font-size: 16px;
vertical-align: middle;
}
</style>
<template>
<div>
<el-form style="margin-top: 20px;margin-left: 20px;" :inline="true" :model="queryForm" class="demo-form-inline">
<el-form-item label="级部:">
<el-input v-model="queryForm.level" placeholder="请输入级部"></el-input>
</el-form-item>
<el-form-item label="姓名:">
<el-input v-model="queryForm.name" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item label="进度:">
<el-select v-model="queryForm.region" placeholder="请选择进度">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" icon="el-icon-search" type="primary" @click="handleQuery">搜索</el-button>
<el-button size="mini" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button size="mini" icon="el-icon-plus" :disabled="status == '已结束' ? true:false" type="success" @click="handleAdd">新增</el-button>
</el-form-item>
</el-form>
<el-table style="margin-top: 20px;" border :data="tableData">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column label="学年学期" align="center" prop="schoolYear" min-width="200"/>
<el-table-column label="级部" align="center" prop="level" min-width="150"/>
<el-table-column label="姓名" align="center" min-width="150" prop="name"/>
<el-table-column label="身份证号" align="center" min-width="200" prop="IDNum"/>
<el-table-column label="进度" align="center" min-width="150" prop="schedule"/>
<el-table-column fixed="right" label="操作" align="center">
<template slot-scope="scope">
<el-button
:disabled="status == '已结束' ? true:false"
size="mini"
type="text"
@click="handleDelete(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
<!--弹窗-->
<el-dialog
title='新增接收人'
:visible.sync="dialogVisible"
width="60%">
<el-table
ref="multipleTable"
:data="dialogTableData"
tooltip-effect="dark"
@selection-change="handleSelectionChange">
<el-table-column
align="center"
type="selection">
</el-table-column>
<el-table-column
align="center"
label="级部"
prop="level">
</el-table-column>
<el-table-column
align="center"
prop="name"
label="姓名">
</el-table-column>
<el-table-column
align="center"
prop="ID"
label="身份证号">
</el-table-column>
</el-table>
<span style="display: flex;justify-content: center" slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmDialog">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "dataReceiver",
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
queryForm: {
level: '',
name: '',
region: ''
},
tableData: [{
schoolYear: '2022学年上学期',
level: '2022级部',
name: '张三',
IDNum: '121212121212121212',
schedule: '未填写'
}],
dialogVisible: false,
form: {},
status : this.$route.query.status,
dialogTableData:[{
level:'2022',
name:'李四',
ID:'12121212121212'
}]
}
},
mounted() {
console.log('id', this.$route.query.id)
console.log('status',this.status)
},
methods: {
/** 查询信息列表 */
getList() {
this.loading = true;
//接口
// listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.userList = response.rows;
// this.total = response.total;
// this.loading = false;
// }
},
// 搜索按钮
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
// 重置按钮
resetQuery() {
this.queryForm = {
pageNum: 1,
pageSize: 10,
level: '',
name: '',
region: ''
}
this.handleQuery()
},
// 新增按钮
handleAdd() {
this.dialogVisible = true
},
//弹窗确定按钮
confirmDialog() {
this.dialogVisible = false
},
//多选按钮
handleSelectionChange(select){
console.log('select',select)
},
// 删除按钮
handleDelete(row) {
//判断,如果进度是未填写可以直接删除不需要提醒
//如果是其他状态需要提示相应的状态
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
}
}
</script>
<style scoped>
</style>
<template>
<div style="margin-top: 20px;margin-left: 20px">
<el-form ref="queryForm" :inline="true" :model="queryForm" class="demo-form-inline">
<el-form-item label="任务名称:">
<el-input v-model="queryForm.user" placeholder="请输入任务名称"></el-input>
</el-form-item>
<el-form-item label="任务状态:">
<el-select v-model="queryForm.region" placeholder="请选择任务状态">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button icon="el-icon-plus" size="mini" type="success" @click="handleAdd">新增</el-button>
<!-- <el-button size="small" type="warning">修改</el-button>-->
<!-- <el-button size="small" type="primary">查看</el-button>-->
<el-button icon="el-icon-delete" size="mini" type="danger" @click="handleDeleteMuti">删除</el-button>
</el-form-item>
</el-form>
<div>
</div>
<el-table style="margin-top: 20px;" border :data="tableData" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column label="范围" align="center" prop="range" min-width="100"/>
<el-table-column label="任务名称" align="center" prop="name" min-width="220"/>
<el-table-column label="开始时间" align="center" min-width="100" prop="statrtTime"/>
<el-table-column label="结束时间" align="center" min-width="100" prop="endTime"/>
<el-table-column label="教师人数" align="center" min-width="100" prop="teacherNum"/>
<el-table-column label="填写人数" align="center" min-width="100" prop="fillNum"/>
<el-table-column label="级部确认" align="center" min-width="100" prop="levelConfirm"/>
<el-table-column label="状态" align="center" min-width="100" prop="status"/>
<el-table-column fixed="right" label="操作" align="center" min-width="280">
<template slot-scope="scope">
<div>
<el-button
type="text"
size="mini"
@click="handleEdit(scope.row)">修改
</el-button>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)">删除
</el-button>
<el-button
size="mini"
type="text"
@click="handlePublish(scope.row)">发布
</el-button>
</div>
<div>
<el-button
size="mini"
type="text"
@click="dataReceiver(scope.row)">数据接收人员
</el-button>
<el-button
size="mini"
type="text"
@click="dataMaintenance(scope.row)">数据维护
</el-button>
<el-button
size="mini"
type="text"
@click="handleExport(scope.row)">导出
</el-button>
<el-button
size="mini"
type="text"
@click="handleRevocation(scope.row)">撤回
</el-button>
<el-button
size="mini"
type="text"
@click="handleFinish(scope.row)">结束
</el-button>
</div>
<div>
<el-button
size="mini"
type="text"
@click="dataReceiver(scope.row)">数据接收人员
</el-button>
<el-button
size="mini"
type="text"
@click="dataMaintenance(scope.row)">数据维护
</el-button>
<el-button
size="mini"
type="text"
@click="handleExport(scope.row)">导出
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
<!--弹窗-->
<el-dialog
:title=title
:visible.sync="dialogVisible"
width="30%">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="任务名称:">
<el-input style="width: 220px;" v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="范围:">
<el-input style="width: 220px;" readonly v-model="form.range"></el-input>
</el-form-item>
<el-form-item label="开始时间:">
<el-date-picker
v-model="form.startTime"
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间:">
<el-date-picker
v-model="form.endTime"
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
<span style="display: flex;justify-content: center" slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmDialog">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "teacherElectronicRecord",
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
queryForm: {
pageNum: 1,
pageSize: 10,
user: '',
region: ''
},
tableData: [{
id: 1,
range: '全体教师',
name: '2022学年上学期教师档案填写',
statrtTime: '2023/08/30',
endTime: '2023/08/30',
teacherNum: '124',
fillNum: '50',
levelConfirm: '40',
status: '未发布',
}],
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 弹窗
dialogVisible: false,
// 弹窗标题
title: '',
form: {},
}
},
created() {
this.getList()
},
methods: {
/** 查询信息列表 */
getList() {
this.loading = true;
//接口
// listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.userList = response.rows;
// this.total = response.total;
// this.loading = false;
// }
},
//搜索按钮
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
// 表单重置
reset() {
this.form = {
name: '',
range: '全体教师',
startTime: '',
endTime: ''
};
this.resetForm("form");
},
//重置按钮
resetQuery() {
this.queryForm.user = '',
this.queryForm.region = '',
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
console.log('selection', selection)
this.ids = selection.map(item => item.id)
console.log('this.ids', this.ids)
this.single = selection.length !== 1
this.multiple = !selection.length
},
//新增按钮
handleAdd() {
this.reset()
this.form.name = '2023'
this.title = '新增任务'
this.dialogVisible = true
},
//弹窗确定按钮
confirmDialog() {
this.dialogVisible = false
},
//多选删除按钮
handleDeleteMuti() {
console.log('delete ids', this.ids)
// 接口
},
//修改按钮
handleEdit(row) {
this.title = '修改任务'
this.dialogVisible = true
},
// 删除按钮
handleDelete(row) {
},
// 发布按钮
handlePublish(row) {
},
// 数据接收人员按钮
dataReceiver(row) {
//传值状态,如果是已结束跳过去只能查看,已发布可以新增或者删除
console.log('row', row)
this.$router.push({
path: '/teachAffairAdministration/smartSchool/teachAffairAdministration/electronicRecord/dataReceiver',
query: {
id: row.id,
status:row.status
}
})
},
// 数据维护按钮
dataMaintenance(row) {
console.log('数据维护按钮row', row)
//传值状态,如果是已结束跳过去只能查看,已发布可以新增或者删除
this.$router.push({
path: '/teachAffairAdministration/smartSchool/teachAffairAdministration/electronicRecord/dataMaintenance',
query: {
id: row.id,
status:row.status
}
})
},
// 导出按钮
handleExport(row) {
},
// 撤回按钮
handleRevocation(row) {
},
// 结束按钮
handleFinish(row) {
}
}
}
</script>
<style scoped>
</style>
package yangtz.cs.liu.campus.controller.schoolLab;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -12,14 +20,24 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import org.springframework.web.multipart.MultipartFile;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlan;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolExperimentPlanMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMentorMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeMentorService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanMbVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import yangtz.cs.liu.campus.vo.schoolgrade.GradeTreeSelect;
import yangtz.cs.liu.campus.vo.student.SchoolStudentVO;
import static yangtz.cs.liu.campus.constant.GradeConstant.NEWTERM;
import static yangtz.cs.liu.campus.constant.GradeConstant.UNNEW;
......@@ -36,6 +54,14 @@ public class SchoolExperimentPlanController extends BaseController
{
@Autowired
private ISchoolExperimentPlanService schoolExperimentPlanService;
@Autowired
private ISchoolGradeService schoolGradeService;
@Autowired
private ISchoolTeacherLabApplyService schoolTeacherLabApplyService;
@Autowired
private ISchoolGradeService gradeService;
@Autowired
private ISchoolGradeMentorService schoolGradeMentorService;
/**
* 查询实验计划列表
......@@ -43,8 +69,83 @@ public class SchoolExperimentPlanController extends BaseController
@GetMapping("/list")
public TableDataInfo list(SchoolExperimentPlanVo schoolExperimentPlanVo)
{
SysUser user = SecurityUtils.getLoginUser().getUser();
//如果是管理员,查询全部列表
if (user.isAdmin()){
startPage();
List<SchoolExperimentPlanVo> list = schoolExperimentPlanService.selectSchoolExperimentPlanList(schoolExperimentPlanVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(list1.getPlannedStartTime() + "至" + list1.getPlannedEndTime());
});
return getDataTable(list);
}
//获取最新学年
int schoolYear = gradeService.isNewSchoolYear();
//教师级部
List<Map<String, Object>> gradeList = schoolExperimentPlanService.getGrade(schoolYear,user.getUserId());
if (StringUtils.isNull(gradeList) || gradeList.size() == 0) {
throw new ServiceException("没有您所在的级部信息");
}
//级部id集合
List<Long> gradeIds = new ArrayList<>();
gradeList.forEach(gradeList1 -> {
Object id = gradeList1.get("id");
Long gradeId = Long.valueOf(String.valueOf(id));
gradeIds.add(gradeId);
});
//查询级部成员信息
LambdaQueryWrapper<SchoolGradeMentor> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SchoolGradeMentor::getGradeId,gradeIds)
.eq(SchoolGradeMentor::getTeacherId,user.getUserId());
List<SchoolGradeMentor> schoolGradeMentors = schoolGradeMentorService.list(wrapper);
schoolExperimentPlanVo.setGradeIds(gradeIds);
startPage();
List<SchoolExperimentPlanVo> list = schoolExperimentPlanService.selectSchoolExperimentPlanList(schoolExperimentPlanVo);
List<SchoolExperimentPlanVo> listNew = new ArrayList<>();
//去除用户所在级部和所在学科组不匹配的数据
if (StringUtils.isNotNull(schoolGradeMentors)){
for (SchoolExperimentPlanVo experimentPlanVo : list) {
for (SchoolGradeMentor schoolGradeMentor : schoolGradeMentors) {
if (schoolGradeMentor.getGradeId().equals(experimentPlanVo.getGradeId())){
if (StringUtils.isNotBlank(schoolGradeMentor.getSubGroup())){
if (!(schoolGradeMentor.getSubGroup().equals(experimentPlanVo.getSub()))){
listNew.add(experimentPlanVo);
}
}
}
}
}
}
if (listNew.size() > 0){
for (SchoolExperimentPlanVo experimentPlanVo : listNew) {
list.remove(experimentPlanVo);
}
}
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(list1.getPlannedStartTime() + "至" + list1.getPlannedEndTime());
});
return getDataTable(list);
}
......@@ -66,7 +167,16 @@ public class SchoolExperimentPlanController extends BaseController
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolExperimentPlanService.selectSchoolExperimentPlanById(id));
SchoolExperimentPlanVo schoolExperimentPlanVo = schoolExperimentPlanService.selectSchoolExperimentPlanById(id);
String semester = "";
if (schoolExperimentPlanVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
schoolExperimentPlanVo.setSchoolYearSemester(schoolExperimentPlanVo.getSchoolYear() + semester);
schoolExperimentPlanVo.setPlannedTime(schoolExperimentPlanVo.getPlannedStartTime() + "至" + schoolExperimentPlanVo.getPlannedEndTime());
return AjaxResult.success(schoolExperimentPlanVo);
}
/**
......@@ -104,7 +214,7 @@ public class SchoolExperimentPlanController extends BaseController
*/
@GetMapping("/getGrade/{schoolYear}")
public AjaxResult getGrade(@PathVariable("schoolYear") int schoolYear){
return AjaxResult.success(schoolExperimentPlanService.getGrade(schoolYear));
return AjaxResult.success(schoolExperimentPlanService.getGrade(schoolYear,null));
}
/**
......@@ -116,14 +226,13 @@ public class SchoolExperimentPlanController extends BaseController
}
/**
* 获取当前学期
* 获取当前学年+学
*/
@GetMapping("/getSemester")
public AjaxResult getSemester(){
AjaxResult ajaxResult = AjaxResult.success();
Calendar cal = Calendar.getInstance();
//获取当前年月
int nowYear = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH) + 1;
//设置当前学期
String term = "1";
......@@ -132,7 +241,289 @@ public class SchoolExperimentPlanController extends BaseController
if (month >= 2 && month < 8) {
term = "2";
}
int schoolYear = schoolGradeService.isNewSchoolYear();
ajaxResult.put("semester",term);
ajaxResult.put("schoolYear",schoolYear);
return ajaxResult;
}
/**
* 级部-获取学科下拉框
*/
@GetMapping("/getSub/{gradeId}")
public AjaxResult getSub(@PathVariable("gradeId") Long gradeId){
return AjaxResult.success(schoolExperimentPlanService.getSub(gradeId));
}
/**
* 实验室管理-级部实验计划查看列表
*/
@GetMapping("/getExperimentList")
public TableDataInfo getExperimentList(SchoolExperimentPlanVo schoolExperimentPlanVo){
startPage();
return getDataTable(schoolExperimentPlanService.getExperimentList(schoolExperimentPlanVo));
}
/**
* 领导-查看实验室完成情况列表
*/
@GetMapping("/countExperiment")
public TableDataInfo countExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo){
startPage();
return getDataTable(schoolExperimentPlanService.countExperiment(schoolExperimentPlanVo));
}
/**
* 查看班级完成详情
*/
@GetMapping("/getClassDetails")
public TableDataInfo getClassDetails(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
return getDataTable(schoolTeacherLabApplyService.getClassDetails(schoolTeacherLabApplyVo));
}
/**
* 教师实验统计
*/
@GetMapping("/getCountTeacher")
public TableDataInfo getCountTeacher(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
startPage();
return getDataTable(schoolTeacherLabApplyService.getCountTeacher(schoolTeacherLabApplyVo));
}
/**
* 实验室管理-查看实验室完成情况列表
*/
@GetMapping("/countExperimentLabAdmin")
public TableDataInfo countExperimentAdmin(SchoolExperimentPlanVo schoolExperimentPlanVo){
startPage();
return getDataTable(schoolExperimentPlanService.countExperimentAdmin(schoolExperimentPlanVo));
}
/**
* 实验室管理员-实验记录列表
*/
@GetMapping("/getExperimentRecord")
public TableDataInfo getExperimentRecord(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
schoolTeacherLabApplyVo.setApplyState("1");
startPage();
return getDataTable(schoolTeacherLabApplyService.getTeacherLabApplyList(schoolTeacherLabApplyVo));
}
/**
* 级部-实验室完成情况明细
*/
@GetMapping("/gradeCountExperiment")
public TableDataInfo gradeCountExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo){
//获取登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
//管理员角色返回全部数据
if (user.isAdmin()){
startPage();
List<Map<String, Object>> list = schoolExperimentPlanService.gradeCountExperiment(schoolExperimentPlanVo);
list.forEach(list1 -> {
//总班级数
int totalClass = Integer.parseInt(list1.get("totalClass").toString());
//已完成班级数
int completeClass = Integer.parseInt(list1.get("completeClass").toString());
//计算完成比例
if (totalClass == 0){
list1.put("ratio","0%");
}else {
//计算完成比例
double totalClass1 = totalClass * 100.0;
double completeClass2 = completeClass * 100.0;
NumberFormat percentInstance = NumberFormat.getPercentInstance();
// 设置保留几位小数,这里设置的是保留两位小数
percentInstance.setMinimumFractionDigits(0);
String percent = percentInstance.format(completeClass2 / totalClass1);
list1.put("ratio",percent);
}
String semester = "";
if (list1.get("semester").equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.put("schoolYearSemester",list1.get("schoolYear") + semester);
});
return getDataTable(list);
}
//获取最新学年
int schoolYear = gradeService.isNewSchoolYear();
//教师级部
List<Map<String, Object>> gradeList = schoolExperimentPlanService.getGrade(schoolYear,user.getUserId());
if (StringUtils.isNull(gradeList) || gradeList.size() == 0) {
throw new ServiceException("没有您所在的级部信息");
}
//级部id集合
List<Long> gradeIds = new ArrayList<>();
gradeList.forEach(gradeList1 -> {
Object id = gradeList1.get("id");
Long gradeId = Long.valueOf(String.valueOf(id));
gradeIds.add(gradeId);
});
//查询级部成员信息
LambdaQueryWrapper<SchoolGradeMentor> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SchoolGradeMentor::getGradeId,gradeIds)
.eq(SchoolGradeMentor::getTeacherId,user.getUserId());
List<SchoolGradeMentor> schoolGradeMentors = schoolGradeMentorService.list(wrapper);
schoolExperimentPlanVo.setGradeIds(gradeIds);
startPage();
List<Map<String, Object>> list = schoolExperimentPlanService.gradeCountExperiment(schoolExperimentPlanVo);
List<Map<String, Object>> listNew = new ArrayList<>();
//去除用户所在级部和所在学科组不匹配的数据
if (StringUtils.isNotNull(schoolGradeMentors)){
for (Map<String, Object> map : list) {
for (SchoolGradeMentor schoolGradeMentor : schoolGradeMentors) {
if (schoolGradeMentor.getGradeId().equals(map.get("gradeId"))){
if (StringUtils.isNotBlank(schoolGradeMentor.getSubGroup())){
if (!(schoolGradeMentor.getSubGroup().equals(map.get("sub")))){
listNew.add(map);
}
}
}
}
}
}
if (listNew.size() > 0){
for (Map<String, Object> map : listNew) {
list.remove(map);
}
}
list.forEach(list1 -> {
//总班级数
int totalClass = Integer.parseInt(list1.get("totalClass").toString());
//已完成班级数
int completeClass = Integer.parseInt(list1.get("completeClass").toString());
//计算完成比例
if (totalClass == 0){
list1.put("ratio","0%");
}else {
//计算完成比例
double totalClass1 = totalClass * 100.0;
double completeClass2 = completeClass * 100.0;
NumberFormat percentInstance = NumberFormat.getPercentInstance();
// 设置保留几位小数,这里设置的是保留两位小数
percentInstance.setMinimumFractionDigits(0);
String percent = percentInstance.format(completeClass2 / totalClass1);
list1.put("ratio",percent);
}
String semester = "";
if (list1.get("semester").equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.put("schoolYearSemester",list1.get("schoolYear") + semester);
});
return getDataTable(list);
}
/**
* 级部-班级完成情况明细
*/
@GetMapping("/gradeCountClass")
public TableDataInfo gradeCountClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
//获取登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
//管理员角色返回全部数据
if (user.isAdmin()){
startPage();
List<Map<String, Object>> list = schoolTeacherLabApplyService.gradeCountClass(schoolTeacherLabApplyVo);
list.forEach(list1 -> {
//计划实验数
int jhsys = Integer.parseInt(list1.get("jhsys").toString());
//已完成实验数
int ywcsys = Integer.parseInt(list1.get("ywcsys").toString());
//计算完成比例
if (jhsys == 0){
list1.put("ratio","0%");
}else {
double jhsys1 = jhsys * 100.0;
double ywcsys1 = ywcsys * 100.0;
NumberFormat percentInstance = NumberFormat.getPercentInstance();
// 设置保留几位小数,这里设置的是保留两位小数
percentInstance.setMinimumFractionDigits(0);
String percent = percentInstance.format(ywcsys1 / jhsys1);
list1.put("ratio",percent);
}
String semester = "";
if (list1.get("semester").equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.put("schoolYearSemester",list1.get("schoolYear") + semester);
});
return getDataTable(list);
}
//获取最新学年
int schoolYear = gradeService.isNewSchoolYear();
//教师级部
List<Map<String, Object>> gradeList = schoolExperimentPlanService.getGrade(schoolYear,user.getUserId());
if (StringUtils.isNull(gradeList) || gradeList.size() == 0) {
throw new ServiceException("没有您所在的级部信息");
}
//级部id集合
List<Long> gradeIds = new ArrayList<>();
gradeList.forEach(gradeList1 -> {
Object id = gradeList1.get("id");
Long gradeId = Long.valueOf(String.valueOf(id));
gradeIds.add(gradeId);
});
//查询级部成员信息
LambdaQueryWrapper<SchoolGradeMentor> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SchoolGradeMentor::getGradeId,gradeIds)
.eq(SchoolGradeMentor::getTeacherId,user.getUserId());
List<SchoolGradeMentor> schoolGradeMentors = schoolGradeMentorService.list(wrapper);
schoolTeacherLabApplyVo.setGradeIds(gradeIds);
startPage();
List<Map<String, Object>> list = schoolTeacherLabApplyService.gradeCountClass(schoolTeacherLabApplyVo);
list.forEach(list1 -> {
//计划实验数
int jhsys = Integer.parseInt(list1.get("jhsys").toString());
//已完成实验数
int ywcsys = Integer.parseInt(list1.get("ywcsys").toString());
//计算完成比例
if (jhsys == 0){
list1.put("ratio","0%");
}else {
double jhsys1 = jhsys * 100.0;
double ywcsys1 = ywcsys * 100.0;
NumberFormat percentInstance = NumberFormat.getPercentInstance();
// 设置保留几位小数,这里设置的是保留两位小数
percentInstance.setMinimumFractionDigits(0);
String percent = percentInstance.format(ywcsys1 / jhsys1);
list1.put("ratio",percent);
}
String semester = "";
if (list1.get("semester").equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.put("schoolYearSemester",list1.get("schoolYear") + semester);
});
return getDataTable(list);
}
/**
* 级部-班级完成情况明细-查看班级完成情况详情
*/
@GetMapping("/getGradeClassDetails")
public TableDataInfo getGradeClassDetails(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
return getDataTable(schoolTeacherLabApplyService.getGradeClassDetails(schoolTeacherLabApplyVo));
}
}
package yangtz.cs.liu.campus.controller.schoolLab;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -15,10 +24,24 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlan;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearRelationMapper;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearRelationService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeMentorService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
/**
* 年级实验室预约Controller
......@@ -33,15 +56,109 @@ public class SchoolLabClassYearController extends BaseController
@Autowired
private ISchoolLabClassYearService schoolLabClassYearService;
@Autowired
private ISchoolExperimentPlanService schoolExperimentPlanService;
@Autowired
private ISchoolLabClassYearRelationService schoolLabClassYearRelationService;
@Autowired
private ISchoolGradeService gradeService;
@Autowired
private ISchoolGradeMentorService mentorService;
@Autowired
private ISchoolClassMentorService classMentorService;
/**
* 查询年级实验室预约列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolLabClassYear schoolLabClassYear)
public TableDataInfo list(SchoolLabClassYearVo schoolLabClassYearVo)
{
SysUser user = SecurityUtils.getLoginUser().getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//如果是管理员返回全部数据
if (user.isAdmin()){
startPage();
List<SchoolLabClassYearVo> list = schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3")){
LambdaQueryWrapper<SchoolLabClassYearRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolLabClassYearRelation::getLabClassYearId,list1.getId());
List<SchoolLabClassYearRelation> relations = schoolLabClassYearRelationService.list(lqw);
list1.setSchoolLabClassYearRelationList(relations);
}
});
return getDataTable(list);
}
//获取最新学年
int schoolYear = gradeService.isNewSchoolYear();
//教师级部
List<Map<String, Object>> gradeList = schoolExperimentPlanService.getGrade(schoolYear,user.getUserId());
if (StringUtils.isNull(gradeList) || gradeList.size() == 0) {
throw new ServiceException("没有您所在的级部信息");
}
//级部id集合
List<Long> gradeIds = new ArrayList<>();
gradeList.forEach(gradeList1 -> {
Long gradeId = Long.valueOf(String.valueOf(gradeList1.get("id")));
gradeIds.add(gradeId);
});
//查询级部成员信息
LambdaQueryWrapper<SchoolGradeMentor> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SchoolGradeMentor::getGradeId,gradeIds)
.eq(SchoolGradeMentor::getTeacherId,user.getUserId());
List<SchoolGradeMentor> schoolGradeMentors = mentorService.list(wrapper);
schoolLabClassYearVo.setGradeIds(gradeIds);
startPage();
List<SchoolLabClassYear> list = schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYear);
List<SchoolLabClassYearVo> list = schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo);
List<SchoolLabClassYearVo> listNew = new ArrayList<>();
//去除用户所在级部和所在学科组不匹配的数据
if (StringUtils.isNotNull(schoolGradeMentors)){
for (SchoolLabClassYearVo labClassYearVo : list) {
for (SchoolGradeMentor schoolGradeMentor : schoolGradeMentors) {
if (schoolGradeMentor.getGradeId().equals(labClassYearVo.getGradeId())){
if (StringUtils.isNotBlank(schoolGradeMentor.getSubGroup())){
if (!(schoolGradeMentor.getSubGroup().equals(labClassYearVo.getSub()))){
listNew.add(labClassYearVo);
}
}
}
}
}
}
if (listNew.size() > 0){
for (SchoolLabClassYearVo labClassYearVo : listNew) {
list.remove(labClassYearVo);
}
}
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3")){
LambdaQueryWrapper<SchoolLabClassYearRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolLabClassYearRelation::getLabClassYearId,list1.getId());
List<SchoolLabClassYearRelation> relations = schoolLabClassYearRelationService.list(lqw);
list1.setSchoolLabClassYearRelationList(relations);
}
});
return getDataTable(list);
}
......@@ -50,10 +167,10 @@ public class SchoolLabClassYearController extends BaseController
*/
@Log(title = "年级实验室预约", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SchoolLabClassYear schoolLabClassYear)
public void export(HttpServletResponse response, SchoolLabClassYearVo schoolLabClassYearVo)
{
List<SchoolLabClassYear> list = schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYear);
ExcelUtil<SchoolLabClassYear> util = new ExcelUtil<SchoolLabClassYear>(SchoolLabClassYear.class);
List<SchoolLabClassYearVo> list = schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo);
ExcelUtil<SchoolLabClassYearVo> util = new ExcelUtil<SchoolLabClassYearVo>(SchoolLabClassYearVo.class);
util.exportExcel(response, list, "年级实验室预约数据");
}
......@@ -63,7 +180,23 @@ public class SchoolLabClassYearController extends BaseController
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearById(id));
SchoolLabClassYearVo schoolLabClassYearVo = schoolLabClassYearService.selectSchoolLabClassYearById(id);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String semester = "";
if (schoolLabClassYearVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
schoolLabClassYearVo.setSchoolYearSemester(schoolLabClassYearVo.getSchoolYear() + semester);
schoolLabClassYearVo.setPlannedTime(format.format(schoolLabClassYearVo.getPlannedStartTime()) + "至" + format.format(schoolLabClassYearVo.getPlannedEndTime()));
if (schoolLabClassYearVo.getDeclareState().equals("3")){
LambdaQueryWrapper<SchoolLabClassYearRelation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYearRelation::getLabClassYearId,id);
List<SchoolLabClassYearRelation> schoolLabClassYearRelations = schoolLabClassYearRelationService.list(wrapper);
schoolLabClassYearVo.setSchoolLabClassYearRelationList(schoolLabClassYearRelations);
}
return AjaxResult.success();
}
/**
......@@ -73,7 +206,7 @@ public class SchoolLabClassYearController extends BaseController
@PostMapping("/add")
public AjaxResult add(@RequestBody SchoolLabClassYear schoolLabClassYear)
{
return toAjax(schoolLabClassYearService.insertSchoolLabClassYear(schoolLabClassYear));
return toAjax(schoolLabClassYearService.insertSchoolLabClassYearVo(schoolLabClassYear));
}
/**
......@@ -83,7 +216,7 @@ public class SchoolLabClassYearController extends BaseController
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SchoolLabClassYear schoolLabClassYear)
{
return toAjax(schoolLabClassYearService.updateSchoolLabClassYear(schoolLabClassYear));
return toAjax(schoolLabClassYearService.updateSchoolLabClassYearVo(schoolLabClassYear));
}
/**
......@@ -96,4 +229,115 @@ public class SchoolLabClassYearController extends BaseController
return toAjax(schoolLabClassYearService.deleteSchoolLabClassYearByIds(ids));
}
/**
* 获取实验名称下拉框
*/
@GetMapping("/getLab")
public AjaxResult getLab(SchoolExperimentPlanVo schoolExperimentPlanVo){
schoolExperimentPlanVo.setIsAppointment("0");
return AjaxResult.success(schoolExperimentPlanService.selectSchoolExperimentPlanList(schoolExperimentPlanVo));
}
/**
* 实验室管理-年级实验室预约列表
*/
@GetMapping("/getLabClassYear")
public TableDataInfo getLabClassYear(SchoolLabClassYearVo schoolLabClassYearVo){
startPage();
return getDataTable(schoolLabClassYearService.getLabClassYear(schoolLabClassYearVo));
}
/**
* 实验室管理-年级实验室预约查看详情
*/
@GetMapping("/getLabClassYear/{id}")
public AjaxResult getLabClassYearById(@PathVariable("id") Long id){
return AjaxResult.success(schoolLabClassYearService.getLabClassYearById(id));
}
/**
* 实验室管理-年级实验室-分配实验室
*/
@PostMapping("/allocationLab")
public AjaxResult allocationLab(@RequestBody SchoolLabClassYearVo schoolLabClassYearVo){
return toAjax(schoolLabClassYearService.updateLabClassYear(schoolLabClassYearVo));
}
/**
* 获取实验室
*/
@GetMapping("/getLabList")
public AjaxResult getLabList(SchoolLabClassYearVo schoolLabClassYearVo){
return AjaxResult.success(schoolLabClassYearService.getLabList(schoolLabClassYearVo));
}
/**
* 教师-实验室安排列表
*/
@GetMapping("/getTeacherLabList")
public TableDataInfo getTeacherLabList(SchoolLabClassYearVo schoolLabClassYearVo){
SysUser user = SecurityUtils.getLoginUser().getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//如果是管理员返回全部数据
if (user.isAdmin()){
startPage();
List<SchoolLabClassYearVo> list = schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3") || list1.getDeclareState().equals("2")){
LambdaQueryWrapper<SchoolLabClassYearRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolLabClassYearRelation::getLabClassYearId,list1.getId());
List<SchoolLabClassYearRelation> relations = schoolLabClassYearRelationService.list(lqw);
list1.setSchoolLabClassYearRelationList(relations);
}
});
return getDataTable(list);
}
//学科集合
List<String> subs = new ArrayList<>();
// 查询该教师属于哪个班级,教哪门课
LambdaQueryWrapper<SchoolClassMentor> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolClassMentor::getTeacherId,user.getUserId())
.in(SchoolClassMentor::getCourseId,6,8,9);
List<SchoolClassMentor> schoolClassMentors = classMentorService.list(wrapper);
if (StringUtils.isNotNull(schoolClassMentors)){
for (SchoolClassMentor schoolClassMentor : schoolClassMentors) {
switch (schoolClassMentor.getCourseName()){
case "物理" : subs.add("1");break;
case "化学" : subs.add("2");break;
case "生物" : subs.add("3");break;
default:break;
}
}
}
schoolLabClassYearVo.setApplyId(user.getUserId());
schoolLabClassYearVo.setSubs(subs);
startPage();
List<SchoolLabClassYearVo> list = schoolLabClassYearService.getTeacherLabList(schoolLabClassYearVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3") || list1.getDeclareState().equals("2")){
LambdaQueryWrapper<SchoolLabClassYearRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolLabClassYearRelation::getLabClassYearId,list1.getId());
List<SchoolLabClassYearRelation> relations = schoolLabClassYearRelationService.list(lqw);
list1.setSchoolLabClassYearRelationList(relations);
}
});
return getDataTable(list);
}
}
......@@ -19,6 +19,7 @@ import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabCompetition;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabCompetitionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabCompetitionVo;
/**
* 实验室竞赛Controller
......@@ -37,10 +38,10 @@ public class SchoolLabCompetitionController extends BaseController
* 查询实验室竞赛列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolLabCompetition schoolLabCompetition)
public TableDataInfo list(SchoolLabCompetitionVo schoolLabCompetitionVo)
{
startPage();
List<SchoolLabCompetition> list = schoolLabCompetitionService.selectSchoolLabCompetitionList(schoolLabCompetition);
List<SchoolLabCompetitionVo> list = schoolLabCompetitionService.selectSchoolLabCompetitionList(schoolLabCompetitionVo);
return getDataTable(list);
}
......@@ -49,10 +50,10 @@ public class SchoolLabCompetitionController extends BaseController
*/
@Log(title = "实验室竞赛", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SchoolLabCompetition schoolLabCompetition)
public void export(HttpServletResponse response, SchoolLabCompetitionVo schoolLabCompetitionVo)
{
List<SchoolLabCompetition> list = schoolLabCompetitionService.selectSchoolLabCompetitionList(schoolLabCompetition);
ExcelUtil<SchoolLabCompetition> util = new ExcelUtil<SchoolLabCompetition>(SchoolLabCompetition.class);
List<SchoolLabCompetitionVo> list = schoolLabCompetitionService.selectSchoolLabCompetitionList(schoolLabCompetitionVo);
ExcelUtil<SchoolLabCompetitionVo> util = new ExcelUtil<SchoolLabCompetitionVo>(SchoolLabCompetitionVo.class);
util.exportExcel(response, list, "实验室竞赛数据");
}
......@@ -70,9 +71,9 @@ public class SchoolLabCompetitionController extends BaseController
*/
@Log(title = "实验室竞赛", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody SchoolLabCompetition schoolLabCompetition)
public AjaxResult add(@RequestBody SchoolLabCompetitionVo schoolLabCompetitionVo)
{
return toAjax(schoolLabCompetitionService.insertSchoolLabCompetition(schoolLabCompetition));
return toAjax(schoolLabCompetitionService.insertSchoolLabCompetition(schoolLabCompetitionVo));
}
/**
......@@ -80,9 +81,9 @@ public class SchoolLabCompetitionController extends BaseController
*/
@Log(title = "实验室竞赛", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SchoolLabCompetition schoolLabCompetition)
public AjaxResult edit(@RequestBody SchoolLabCompetitionVo schoolLabCompetitionVo)
{
return toAjax(schoolLabCompetitionService.updateSchoolLabCompetition(schoolLabCompetition));
return toAjax(schoolLabCompetitionService.updateSchoolLabCompetition(schoolLabCompetitionVo));
}
/**
......
......@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -32,10 +33,10 @@ public class SchoolLabController extends BaseController
* 查询实验室列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolLab schoolLab)
public TableDataInfo list(SchoolLabVo schoolLabVo)
{
startPage();
List<SchoolLab> list = schoolLabService.selectSchoolLabList(schoolLab);
List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo);
return getDataTable(list);
}
......@@ -44,10 +45,10 @@ public class SchoolLabController extends BaseController
*/
@Log(title = "实验室", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SchoolLab schoolLab)
public void export(HttpServletResponse response, SchoolLabVo schoolLabVo)
{
List<SchoolLab> list = schoolLabService.selectSchoolLabList(schoolLab);
ExcelUtil<SchoolLab> util = new ExcelUtil<SchoolLab>(SchoolLab.class);
List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo);
ExcelUtil<SchoolLabVo> util = new ExcelUtil<SchoolLabVo>(SchoolLabVo.class);
util.exportExcel(response, list, "实验室数据");
}
......@@ -100,7 +101,7 @@ public class SchoolLabController extends BaseController
}
/**
* 获取学科下拉框
* 实验室管理员-获取学科下拉框
* @return
*/
@GetMapping("/getSub")
......
package yangtz.cs.liu.campus.controller.schoolLab;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -15,10 +22,15 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import yangtz.cs.liu.campus.service.schoolLab.ISchoollTeacherExperimentApplyLabsService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
/**
* 教师个人实验申请Controller
......@@ -33,37 +45,84 @@ public class SchoolTeacherExperimentApplyController extends BaseController
@Autowired
private ISchoolTeacherExperimentApplyService schoolTeacherExperimentApplyService;
@Autowired
private ISchoollTeacherExperimentApplyLabsService schoollTeacherExperimentApplyLabsService;
/**
* 查询教师个人实验申请列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolTeacherExperimentApply schoolTeacherExperimentApply)
public TableDataInfo list(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
SysUser user = SecurityUtils.getLoginUser().getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//管理员返回全部
if (user.isAdmin()){
startPage();
List<SchoolTeacherExperimentApplyVo> list = schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
list.forEach(list1 ->{
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3")){
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,list1.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
list1.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
}
});
return getDataTable(list);
}
schoolTeacherExperimentApplyVo.setApplyId(user.getUserId());
startPage();
List<SchoolTeacherExperimentApply> list = schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApply);
List<SchoolTeacherExperimentApplyVo> list = schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
list.forEach(list1 ->{
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3")){
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,list1.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
list1.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
}
});
return getDataTable(list);
}
/**
* 导出教师个人实验申请列表
*/
@Log(title = "教师个人实验申请", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SchoolTeacherExperimentApply schoolTeacherExperimentApply)
{
List<SchoolTeacherExperimentApply> list = schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApply);
ExcelUtil<SchoolTeacherExperimentApply> util = new ExcelUtil<SchoolTeacherExperimentApply>(SchoolTeacherExperimentApply.class);
util.exportExcel(response, list, "教师个人实验申请数据");
}
/**
* 获取教师个人实验申请详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyById(id));
SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo = schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyById(id);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String semester = "";
if (schoolTeacherExperimentApplyVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
schoolTeacherExperimentApplyVo.setSchoolYearSemester(schoolTeacherExperimentApplyVo.getSchoolYear() + semester);
schoolTeacherExperimentApplyVo.setPlannedTime(format.format(schoolTeacherExperimentApplyVo.getPlannedStartTime()) + "至" + format.format(schoolTeacherExperimentApplyVo.getPlannedEndTime()));
if (schoolTeacherExperimentApplyVo.getDeclareState().equals("3")){
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,id);
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
schoolTeacherExperimentApplyVo.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
}
return AjaxResult.success(schoolTeacherExperimentApplyVo);
}
/**
......@@ -71,9 +130,9 @@ public class SchoolTeacherExperimentApplyController extends BaseController
*/
@Log(title = "教师个人实验申请", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody SchoolTeacherExperimentApply schoolTeacherExperimentApply)
public AjaxResult add(@RequestBody SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
return toAjax(schoolTeacherExperimentApplyService.insertSchoolTeacherExperimentApply(schoolTeacherExperimentApply));
return toAjax(schoolTeacherExperimentApplyService.insertSchoolTeacherExperimentApply(schoolTeacherExperimentApplyVo));
}
/**
......@@ -81,9 +140,9 @@ public class SchoolTeacherExperimentApplyController extends BaseController
*/
@Log(title = "教师个人实验申请", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SchoolTeacherExperimentApply schoolTeacherExperimentApply)
public AjaxResult edit(@RequestBody SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
return toAjax(schoolTeacherExperimentApplyService.updateSchoolTeacherExperimentApply(schoolTeacherExperimentApply));
return toAjax(schoolTeacherExperimentApplyService.updateSchoolTeacherExperimentApply(schoolTeacherExperimentApplyVo));
}
/**
......@@ -95,4 +154,100 @@ public class SchoolTeacherExperimentApplyController extends BaseController
{
return toAjax(schoolTeacherExperimentApplyService.deleteSchoolTeacherExperimentApplyByIds(ids));
}
/**
* 实验室管理-教师个人演示实验审批
*/
@GetMapping("/getTeacherList")
public TableDataInfo getTeacherList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo){
schoolTeacherExperimentApplyVo.setDeclareState("1");
SysUser user = SecurityUtils.getLoginUser().getUser();
List<SysRole> roles = user.getRoles();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//管理员返回全部
if (user.isAdmin()){
startPage();
List<SchoolTeacherExperimentApplyVo> list = schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
list.forEach(list1 ->{
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,list1.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
list1.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
});
return getDataTable(list);
}
//实验室管理员通道
List<String> labSubs = new ArrayList<>();
for (SysRole role : roles) {
if (role.getRoleKey().equals("admin")){
startPage();
List<SchoolTeacherExperimentApplyVo> list = schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,list1.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
list1.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
});
return getDataTable(list);
}
switch (role.getRoleKey()){
case "phy_lab_admin":
labSubs.add("1");
break;
case "che_lab_admin":
labSubs.add("2");
break;
case "bio_lab_admin":
labSubs.add("3");
break;
default:break;
}
}
schoolTeacherExperimentApplyVo.setSubs(labSubs);
startPage();
List<SchoolTeacherExperimentApplyVo> list = schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3") || list1.getDeclareState().equals("2")){
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,list1.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
list1.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
}
});
return getDataTable(list);
}
/**
* 实验室管理-教师个人演示实验审批-分配实验室
*/
@PostMapping("/teacherExperimentLabs")
public AjaxResult teacherExperimentLabs(@RequestBody SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo){
return toAjax(schoolTeacherExperimentApplyService.teacherExperimentLabs(schoolTeacherExperimentApplyVo));
}
}
......@@ -2,6 +2,10 @@ package yangtz.cs.liu.campus.controller.schoolLab;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -15,10 +19,13 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.service.accessory.IAccessoryService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
/**
* 教师实验室申请Controller
......@@ -32,16 +39,59 @@ public class SchoolTeacherLabApplyController extends BaseController
{
@Autowired
private ISchoolTeacherLabApplyService schoolTeacherLabApplyService;
@Autowired
private IAccessoryService accessoryService;
/**
* 查询教师实验室申请列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolTeacherLabApply schoolTeacherLabApply)
public TableDataInfo list(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
//获取登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
if (user.isAdmin()){
startPage();
List<SchoolTeacherLabApplyVo> schoolTeacherLabApplyVos = schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo);
for (SchoolTeacherLabApplyVo teacherLabApplyVo : schoolTeacherLabApplyVos) {
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,teacherLabApplyVo.getId())
.eq(SchoolAccessory::getAccessoryType,"教师实验室附件");
List<SchoolAccessory> schoolAccessories = accessoryService.list(wrapper);
if (schoolAccessories.size() > 0){
teacherLabApplyVo.setSchoolAccessoryList(schoolAccessories);
}
String semester = "";
if (teacherLabApplyVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
teacherLabApplyVo.setSchoolYearSemester(teacherLabApplyVo.getSchoolYear() + semester);
}
return getDataTable(schoolTeacherLabApplyVos);
}
//普通教师通道
schoolTeacherLabApplyVo.setApplyId(user.getUserId());
startPage();
List<SchoolTeacherLabApply> list = schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApply);
return getDataTable(list);
List<SchoolTeacherLabApplyVo> schoolTeacherLabApplyVos = schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo);
for (SchoolTeacherLabApplyVo teacherLabApplyVo : schoolTeacherLabApplyVos) {
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,teacherLabApplyVo.getId())
.eq(SchoolAccessory::getAccessoryType,"教师实验室附件");
List<SchoolAccessory> schoolAccessories = accessoryService.list(wrapper);
if (schoolAccessories.size() > 0){
teacherLabApplyVo.setSchoolAccessoryList(schoolAccessories);
}
String semester = "";
if (teacherLabApplyVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
teacherLabApplyVo.setSchoolYearSemester(teacherLabApplyVo.getSchoolYear() + semester);
}
return getDataTable(schoolTeacherLabApplyVos);
}
/**
......@@ -49,10 +99,10 @@ public class SchoolTeacherLabApplyController extends BaseController
*/
@Log(title = "教师实验室申请", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SchoolTeacherLabApply schoolTeacherLabApply)
public void export(HttpServletResponse response, SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
List<SchoolTeacherLabApply> list = schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApply);
ExcelUtil<SchoolTeacherLabApply> util = new ExcelUtil<SchoolTeacherLabApply>(SchoolTeacherLabApply.class);
List<SchoolTeacherLabApplyVo> list = schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo);
ExcelUtil<SchoolTeacherLabApplyVo> util = new ExcelUtil<SchoolTeacherLabApplyVo>(SchoolTeacherLabApplyVo.class);
util.exportExcel(response, list, "教师实验室申请数据");
}
......@@ -62,7 +112,22 @@ public class SchoolTeacherLabApplyController extends BaseController
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyById(id));
SchoolTeacherLabApplyVo schoolTeacherLabApplyVo = schoolTeacherLabApplyService.selectSchoolTeacherLabApplyById(id);
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,id)
.eq(SchoolAccessory::getAccessoryType,"教师实验室附件");
List<SchoolAccessory> schoolAccessories = accessoryService.list(wrapper);
if (schoolAccessories.size() > 0){
schoolTeacherLabApplyVo.setSchoolAccessoryList(schoolAccessories);
}
String semester = "";
if (schoolTeacherLabApplyVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
schoolTeacherLabApplyVo.setSchoolYearSemester(schoolTeacherLabApplyVo.getSchoolYear() + semester);
return AjaxResult.success(schoolTeacherLabApplyVo);
}
/**
......@@ -70,9 +135,9 @@ public class SchoolTeacherLabApplyController extends BaseController
*/
@Log(title = "教师实验室申请", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody SchoolTeacherLabApply schoolTeacherLabApply)
public AjaxResult add(@RequestBody SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
return toAjax(schoolTeacherLabApplyService.insertSchoolTeacherLabApply(schoolTeacherLabApply));
return toAjax(schoolTeacherLabApplyService.insertSchoolTeacherLabApplyVo(schoolTeacherLabApplyVo));
}
/**
......@@ -80,9 +145,9 @@ public class SchoolTeacherLabApplyController extends BaseController
*/
@Log(title = "教师实验室申请", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SchoolTeacherLabApply schoolTeacherLabApply)
public AjaxResult edit(@RequestBody SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
return toAjax(schoolTeacherLabApplyService.updateSchoolTeacherLabApply(schoolTeacherLabApply));
return toAjax(schoolTeacherLabApplyService.updateSchoolTeacherLabApplyVo(schoolTeacherLabApplyVo));
}
/**
......@@ -94,4 +159,47 @@ public class SchoolTeacherLabApplyController extends BaseController
{
return toAjax(schoolTeacherLabApplyService.deleteSchoolTeacherLabApplyByIds(ids));
}
/**
* 获取实验室使用状态
* @return
*/
@GetMapping("/getTeacherLab")
public AjaxResult getTeacherLab(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
return AjaxResult.success(schoolTeacherLabApplyService.getTeacherLab(schoolTeacherLabApplyVo));
}
/**
* 获取班级
*/
@GetMapping("/getTeacherClass")
public AjaxResult getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
return AjaxResult.success(schoolTeacherLabApplyService.getTeacherClass(schoolTeacherLabApplyVo));
}
/**
* 上传附件
*/
@PutMapping("/attachment")
public AjaxResult attachment(@RequestBody SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
return toAjax(schoolTeacherLabApplyService.updateTeacherLab(schoolTeacherLabApplyVo));
}
/**
* 实验室管理-教师申请列表
*/
@GetMapping("/getTeacherLabApplyList")
public TableDataInfo getTeacherLabApplyList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
startPage();
List<SchoolTeacherLabApplyVo> list = schoolTeacherLabApplyService.getTeacherLabApplyList(schoolTeacherLabApplyVo);
return getDataTable(list);
}
/**
* 实验室管理-教师申请审批确认
*/
@PutMapping("/updateState")
public AjaxResult updateState(@RequestBody SchoolTeacherLabApply schoolTeacherLabApply){
return toAjax(schoolTeacherLabApplyService.updateState(schoolTeacherLabApply));
}
}
package yangtz.cs.liu.campus.domain.accessory;
import com.core.domain.OurBaseEntity;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import java.util.Date;
/**
* 附件对象 accessory
*
* @author ruoyi
* @date 2023-07-24
*/
public class SchoolAccessory
@Data
public class SchoolAccessory extends OurBaseEntity
{
/** 附件主键id */
private Long id;
/** 业务id */
@Excel(name = "业务id")
private Long businessId;
......@@ -35,71 +37,4 @@ public class SchoolAccessory
/** 附件名称 */
@Excel(name = "附件名称")
private String accessoryName;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setBusinessId(Long businessId)
{
this.businessId = businessId;
}
public Long getBusinessId()
{
return businessId;
}
public void setModuleName(String moduleName)
{
this.moduleName = moduleName;
}
public String getModuleName()
{
return moduleName;
}
public void setAccessoryType(String accessoryType)
{
this.accessoryType = accessoryType;
}
public String getAccessoryType()
{
return accessoryType;
}
public void setAccessoryUrl(String accessoryUrl)
{
this.accessoryUrl = accessoryUrl;
}
public String getAccessoryUrl()
{
return accessoryUrl;
}
public void setAccessoryName(String accessoryName)
{
this.accessoryName = accessoryName;
}
public String getAccessoryName()
{
return accessoryName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("businessId", getBusinessId())
.append("moduleName", getModuleName())
.append("accessoryType", getAccessoryType())
.append("accessoryUrl", getAccessoryUrl())
.append("accessoryName", getAccessoryName())
.toString();
}
}
......@@ -19,17 +19,18 @@ public class SchoolLabClassYear extends OurBaseEntity
{
/** 实验计划id */
private String experimentPlanId;
private Long experimentPlanId;
/** 实验名称 */
private String experimentName;
/** 级部id */
private Long gradeId;
/** 级部 */
@Excel(name = "级部")
private String grade;
/**
* 级部id
*/
private Integer gradeId;
/** 学年 */
@Excel(name = "学年")
private String schoolYear;
......
......@@ -24,6 +24,9 @@ public class SchoolLabClassYearRelation
/** 实验室id */
private Long labId;
/** 实验室名称 */
private String labName;
/** 删除状态 */
private String delFlag;
}
......@@ -37,9 +37,13 @@ public class SchoolTeacherExperimentApply extends OurBaseEntity
@Excel(name = "学期")
private String semester;
/** 规划时间 */
@Excel(name = "规划时间")
private String plannedTime;
/** 规划开始时间 */
@Excel(name = "规划开始时间")
private String plannedStartTime;
/** 规划结束时间 */
@Excel(name = "规划结束时间")
private String plannedEndTime;
/** 实验名称 */
@Excel(name = "实验名称")
......@@ -53,14 +57,6 @@ public class SchoolTeacherExperimentApply extends OurBaseEntity
@Excel(name = "实验用品")
private String experimentUseGoods;
/** 实验室id */
@Excel(name = "实验室id")
private String labId;
/** 实验室名称 */
@Excel(name = "实验室名称")
private String labName;
/** 申报状态(0未申报,1已申报,2已阅读,3已分配) */
@Excel(name = "申报状态", readConverterExp = "0=未申报,1=已申报,2=已阅读,3=已分配")
private String declareState;
......
package yangtz.cs.liu.campus.domain.schoolLab;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
@Data
public class SchoolTeacherExperimentApplyLabs {
/** 主键id */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 教师个人实验申请主键id */
private Long teacherExperimentApplyId;
/** 实验室id */
private Long labId;
/** 实验室名称 */
private String labName;
/** 删除状态 */
private String delFlag;
}
......@@ -25,10 +25,19 @@ public class SchoolTeacherLabApply extends OurBaseEntity
@Excel(name = "实验分类", readConverterExp = "1=分组实验,2=演示实验,3=探究实验")
private String experimentClassify;
/** 实验计划id */
private Long experimentPlanId;
/** 实验名称 */
private String experimentName;
/** 学科(1物理,2化学,3生物) */
@Excel(name = "学科", readConverterExp = "1=物理,2=化学,3=生物")
private String sub;
/** 级部id */
private Long gradeId;
/** 级部 */
@Excel(name = "级部")
private String grade;
......@@ -87,13 +96,6 @@ public class SchoolTeacherLabApply extends OurBaseEntity
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
/**
* 实验室是否使用完成 (0未完成,1完成)
*/
/** 实验室是否使用完成 (0未完成,1完成) */
private String state;
/**
* 备注
*/
private String remark;
}
......@@ -32,4 +32,7 @@ public class SchoolGradeMentor extends OurBaseEntity {
/** 职务 */
@NotBlank(message = "职务不能为空")
private String teacherPost;
/** 学科组(1物理学科组,2化学学科组,3生物学科组) */
private String subGroup;
}
......@@ -37,13 +37,6 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> {
SchoolClass getUserClassByParent(Long studentId);
/**
* 跟进classid获取班级名称
* @param studentId
* @return
*/
String getClassName(Long classId);
/**
* 微信公众号(老师查看班级)
*
* @param teacherId
......
......@@ -37,10 +37,10 @@ public interface SchoolExperimentPlanMapper extends BaseMapper<SchoolExperimentP
/**
* 新增实验计划
*
* @param schoolExperimentPlan 实验计划
* @param schoolExperimentPlanVo 实验计划
* @return 结果
*/
public int insertSchoolExperimentPlan(SchoolExperimentPlan schoolExperimentPlan);
public int insertSchoolExperimentPlan(SchoolExperimentPlanVo schoolExperimentPlanVo);
/**
* 修改实验计划
......@@ -96,12 +96,26 @@ public interface SchoolExperimentPlanMapper extends BaseMapper<SchoolExperimentP
* @param schoolYear
* @return
*/
List<Map<String, String>> getGrade(@Param("schoolYear") int schoolYear,@Param("userId") Long userId);
List<Map<String, Object>> getGrade(@Param("schoolYear") int schoolYear,@Param("userId") Long userId);
/**
* 根据级部查询对应班级
* @param gradeId
* @return
*/
List<Map<String, String>> getSchoolClass(@Param("gradeId") Long gradeId);
List<Map<String, Object>> getSchoolClass(@Param("gradeId") Long gradeId);
/**
* 实验室管理-级部实验计划查看列表
* @param schoolExperimentPlanVo
* @return
*/
List<SchoolExperimentPlanVo> getExperimentList(SchoolExperimentPlanVo schoolExperimentPlanVo);
/**
* 领导-查看实验室完成情况列表
* @param schoolExperimentPlanVo
* @return
*/
List<Map<String, Object>> countExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo);
}
package yangtz.cs.liu.campus.mapper.schoolLab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import java.util.List;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
/**
* 年级实验室预约Mapper接口
......@@ -23,24 +24,15 @@ public interface SchoolLabClassYearMapper extends BaseMapper<SchoolLabClassYear>
* @param id 年级实验室预约主键
* @return 年级实验室预约
*/
public SchoolLabClassYear selectSchoolLabClassYearById(Long id);
public SchoolLabClassYearVo selectSchoolLabClassYearById(Long id);
/**
* 查询年级实验室预约列表
*
* @param schoolLabClassYear 年级实验室预约
* @param schoolLabClassYearVo 年级实验室预约
* @return 年级实验室预约集合
*/
public List<SchoolLabClassYear> selectSchoolLabClassYearList(SchoolLabClassYear schoolLabClassYear);
/**
* 获取年级 班级完成情况信息
* @param
* @return
*/
public List<ClassSituationVo> classSituation(ClassSituationVo classSituationVo);
public List<ClassSituationVo> getexperimentList(ClassSituationVo classSituationVo);
public List<SchoolLabClassYearVo> selectSchoolLabClassYearList(SchoolLabClassYearVo schoolLabClassYearVo);
/**
* 新增年级实验室预约
......@@ -98,4 +90,41 @@ public interface SchoolLabClassYearMapper extends BaseMapper<SchoolLabClassYear>
* @return 结果
*/
public int deleteSchoolLabClassYearRelationByLabClassYearId(Long id);
/**
* 实验室管理-年级实验室预约列表
* @param schoolLabClassYearVo
* @return
*/
List<SchoolLabClassYearVo> getLabClassYear(SchoolLabClassYearVo schoolLabClassYearVo);
/**
* 获取实验室id
* @param labClassYearIds
* @return
*/
List<Long> seletLabId(@Param("labClassYearIds") List<Long> labClassYearIds);
/**
* 实验室管理-年级实验室预约查看详情
* @param id
* @return
*/
SchoolLabClassYearVo getLabClassYearById(Long id);
/**
* 教师-实验室安排列表
* @param schoolLabClassYearVo
* @return
*/
List<SchoolLabClassYearVo> getTeacherLabList(SchoolLabClassYearVo schoolLabClassYearVo);
/**
* 获取年级 班级完成情况信息
* @param
* @return
*/
public List<ClassSituationVo> classSituation(ClassSituationVo classSituationVo);
public List<ClassSituationVo> getexperimentList(ClassSituationVo classSituationVo);
}
package yangtz.cs.liu.campus.mapper.schoolLab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
public interface SchoolLabClassYearRelationMapper extends BaseMapper<SchoolLabClassYearRelation> {
}
package yangtz.cs.liu.campus.mapper.schoolLab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabCompetition;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabCompetitionVo;
import java.util.List;
......@@ -20,31 +22,31 @@ public interface SchoolLabCompetitionMapper extends BaseMapper<SchoolLabCompetit
* @param id 实验室竞赛主键
* @return 实验室竞赛
*/
public SchoolLabCompetition selectSchoolLabCompetitionById(Long id);
public SchoolLabCompetitionVo selectSchoolLabCompetitionById(Long id);
/**
* 查询实验室竞赛列表
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 实验室竞赛集合
*/
public List<SchoolLabCompetition> selectSchoolLabCompetitionList(SchoolLabCompetition schoolLabCompetition);
public List<SchoolLabCompetitionVo> selectSchoolLabCompetitionList(SchoolLabCompetitionVo schoolLabCompetitionVo);
/**
* 新增实验室竞赛
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 结果
*/
public int insertSchoolLabCompetition(SchoolLabCompetition schoolLabCompetition);
public int insertSchoolLabCompetition(SchoolLabCompetitionVo schoolLabCompetitionVo);
/**
* 修改实验室竞赛
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 结果
*/
public int updateSchoolLabCompetition(SchoolLabCompetition schoolLabCompetition);
public int updateSchoolLabCompetition(SchoolLabCompetitionVo schoolLabCompetitionVo);
/**
* 删除实验室竞赛
......@@ -61,4 +63,25 @@ public interface SchoolLabCompetitionMapper extends BaseMapper<SchoolLabCompetit
* @return 结果
*/
public int deleteSchoolLabCompetitionByIds(Long[] ids);
/**
* 新增证书照片
* @param list
* @return
*/
int batchSchoolAccessory(List<SchoolAccessory> list);
/**
* 批量删除证书照片
* @param ids
* @return
*/
int deleteSchoolAccessoryByBusinessIds(Long[] ids);
/**
* 删除证书照片
* @param id
* @return
*/
int deleteSchoolAccessoryByBusinessId(Long id);
}
......@@ -3,6 +3,7 @@ package yangtz.cs.liu.campus.mapper.schoolLab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
import java.util.List;
import java.util.Map;
......@@ -22,15 +23,15 @@ public interface SchoolLabMapper extends BaseMapper<SchoolLab>
* @param id 实验室主键
* @return 实验室
*/
public SchoolLab selectSchoolLabById(Long id);
public SchoolLabVo selectSchoolLabById(Long id);
/**
* 查询实验室列表
*
* @param schoolLab 实验室
* @param schoolLabVo 实验室
* @return 实验室集合
*/
public List<SchoolLab> selectSchoolLabList(SchoolLab schoolLab);
public List<SchoolLabVo> selectSchoolLabList(SchoolLabVo schoolLabVo);
/**
* 新增实验室
......
......@@ -2,6 +2,8 @@ package yangtz.cs.liu.campus.mapper.schoolLab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
import java.util.List;
......@@ -20,31 +22,31 @@ public interface SchoolTeacherExperimentApplyMapper extends BaseMapper<SchoolTea
* @param id 教师个人实验申请主键
* @return 教师个人实验申请
*/
public SchoolTeacherExperimentApply selectSchoolTeacherExperimentApplyById(Long id);
public SchoolTeacherExperimentApplyVo selectSchoolTeacherExperimentApplyById(Long id);
/**
* 查询教师个人实验申请列表
*
* @param schoolTeacherExperimentApply 教师个人实验申请
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 教师个人实验申请集合
*/
public List<SchoolTeacherExperimentApply> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApply schoolTeacherExperimentApply);
public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 新增教师个人实验申请
*
* @param schoolTeacherExperimentApply 教师个人实验申请
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 结果
*/
public int insertSchoolTeacherExperimentApply(SchoolTeacherExperimentApply schoolTeacherExperimentApply);
public int insertSchoolTeacherExperimentApply(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 修改教师个人实验申请
*
* @param schoolTeacherExperimentApply 教师个人实验申请
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 结果
*/
public int updateSchoolTeacherExperimentApply(SchoolTeacherExperimentApply schoolTeacherExperimentApply);
public int updateSchoolTeacherExperimentApply(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 删除教师个人实验申请
......@@ -61,4 +63,19 @@ public interface SchoolTeacherExperimentApplyMapper extends BaseMapper<SchoolTea
* @return 结果
*/
public int deleteSchoolTeacherExperimentApplyByIds(Long[] ids);
/**
* 批量新增教师个人实验申请实验室
*/
public int batchSchoolTeacherExperimentApplyLabs(List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabsList);
/**
* 批量删除教师个人实验申请实验室
*/
public int deleteSchoolTeacherExperimentApplyLabsIds(Long[] ids);
/**
* 删除教师个人实验申请实验室
*/
public int deleteSchoolTeacherExperimentApplyLabsId(Long id);
}
package yangtz.cs.liu.campus.mapper.schoolLab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Map;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import java.util.List;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import java.util.Map;
/**
* 教师实验室申请Mapper接口
......@@ -21,38 +23,31 @@ public interface SchoolTeacherLabApplyMapper extends BaseMapper<SchoolTeacherLab
* @param id 教师实验室申请主键
* @return 教师实验室申请
*/
public SchoolTeacherLabApply selectSchoolTeacherLabApplyById(Long id);
public SchoolTeacherLabApplyVo selectSchoolTeacherLabApplyById(Long id);
/**
* 查询教师实验室申请列表
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 教师实验室申请集合
*/
public List<SchoolTeacherLabApply> selectSchoolTeacherLabApplyList(SchoolTeacherLabApply schoolTeacherLabApply);
public List<SchoolTeacherLabApplyVo> selectSchoolTeacherLabApplyList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 新增教师实验室申请
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 结果
*/
public int insertSchoolTeacherLabApply(SchoolTeacherLabApply schoolTeacherLabApply);
/**
* 计算本学年学期完成多少数量
*/
public Integer selectCompletedQuantity(ClassSituationVo classSituationVo);
public List<Map<String, String>> selectTeacherList(SchoolTeacherLabApply schoolTeacherLabApply);
public int insertSchoolTeacherLabApply(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 修改教师实验室申请
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 结果
*/
public int updateSchoolTeacherLabApply(SchoolTeacherLabApply schoolTeacherLabApply);
public int updateSchoolTeacherLabApply(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 删除教师实验室申请
......@@ -69,4 +64,74 @@ public interface SchoolTeacherLabApplyMapper extends BaseMapper<SchoolTeacherLab
* @return 结果
*/
public int deleteSchoolTeacherLabApplyByIds(Long[] ids);
/**
* 获取老师在班级
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String, Object>> getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 获取全部班级
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String, Object>> getTeacherClassAll(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 新增附件信息
* @param list
* @return
*/
int batchSchoolAccessory(List<SchoolAccessory> list);
/**
* 删除附件信息
* @param id
* @return
*/
int deleteSchoolAccessoryByBusinessId(Long id);
/**
* 批量删除附件信息
* @param ids
* @return
*/
int deleteSchoolAccessoryByBusinessIds(Long[] ids);
/**
* 查看班级完成详情
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String, Object>> getClassDetails(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 教师实验统计
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String, Object>> getCountTeacher(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 级部-班级完成情况明细
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String, Object>> gradeCountClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 级部-班级完成情况明细-查看班级完成情况详情
* @param schoolTeacherLabApplyVo
* @return
*/
List<SchoolTeacherLabApplyVo> getGradeClassDetails(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 计算本学年学期完成多少数量
*/
public Integer selectCompletedQuantity(ClassSituationVo classSituationVo);
public List<Map<String, String>> selectTeacherList(SchoolTeacherLabApply schoolTeacherLabApply);
}
package yangtz.cs.liu.campus.mapper.schoolLab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
public interface SchoollTeacherExperimentApplyLabsMapper extends BaseMapper<SchoolTeacherExperimentApplyLabs> {
}
package yangtz.cs.liu.campus.service.impl.schoolLab;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
......@@ -16,12 +19,20 @@ import java.util.Map;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlanClass;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolExperimentPlanMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlan;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMentorMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanMbVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
/**
* 实验计划Service业务层处理
......@@ -35,7 +46,9 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
@Autowired
private SchoolExperimentPlanMapper schoolExperimentPlanMapper;
@Autowired
private SchoolGradeMapper gradeMapper;
private SchoolLabMapper schoolLabMapper;
@Autowired
private SchoolGradeMentorMapper schoolGradeMentorMapper;
/**
* 查询实验计划
......@@ -46,16 +59,7 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
@Override
public SchoolExperimentPlanVo selectSchoolExperimentPlanById(Long id)
{
SchoolExperimentPlanVo schoolExperimentPlanVo = schoolExperimentPlanMapper.selectSchoolExperimentPlanById(id);
String semester = "";
if (schoolExperimentPlanVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
schoolExperimentPlanVo.setSchoolYearSemester(schoolExperimentPlanVo.getSchoolYear() + semester);
schoolExperimentPlanVo.setPlannedTime(schoolExperimentPlanVo.getPlannedStartTime() + "至" + schoolExperimentPlanVo.getPlannedEndTime());
return schoolExperimentPlanVo;
return schoolExperimentPlanMapper.selectSchoolExperimentPlanById(id);
}
/**
......@@ -67,47 +71,7 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
@Override
public List<SchoolExperimentPlanVo> selectSchoolExperimentPlanList(SchoolExperimentPlanVo schoolExperimentPlanVo)
{
SysUser user = SecurityUtils.getLoginUser().getUser();
if (user.isAdmin()){
List<SchoolExperimentPlanVo> list = schoolExperimentPlanMapper.selectSchoolExperimentPlanList(schoolExperimentPlanVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(list1.getPlannedStartTime() + "至" + list1.getPlannedEndTime());
});
return list;
}
//获取最新学年
int schoolYear = gradeMapper.isNewSchoolYear();
//教师级部
List<Map<String, String>> gradeList = schoolExperimentPlanMapper.getGrade(schoolYear,user.getUserId());
if (StringUtils.isNull(gradeList) || gradeList.size() == 0) {
throw new ServiceException("没有您所在的级部信息");
}
//级部id集合
List<Long> gradeIds = new ArrayList<>();
gradeList.forEach(gradeList1 -> {
long gradeId = Long.parseLong(gradeList1.get("id"));
gradeIds.add(gradeId);
});
schoolExperimentPlanVo.setGradeIds(gradeIds);
List<SchoolExperimentPlanVo> list = schoolExperimentPlanMapper.selectSchoolExperimentPlanList(schoolExperimentPlanVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(list1.getPlannedStartTime() + "至" + list1.getPlannedEndTime());
});
return list;
return schoolExperimentPlanMapper.selectSchoolExperimentPlanList(schoolExperimentPlanVo);
}
/**
......@@ -125,10 +89,7 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
}
schoolExperimentPlanVo.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolExperimentPlanVo.setCreateTime(DateUtils.getNowDate());
SchoolExperimentPlan schoolExperimentPlan = new SchoolExperimentPlan();
BeanUtils.copyProperties(schoolExperimentPlanVo,schoolExperimentPlan);
// int rows = schoolExperimentPlanMapper.insert(schoolExperimentPlan);
int rows = schoolExperimentPlanMapper.insertSchoolExperimentPlan(schoolExperimentPlan);
int rows = schoolExperimentPlanMapper.insertSchoolExperimentPlan(schoolExperimentPlanVo);
insertSchoolExperimentPlanClass(schoolExperimentPlanVo);
return rows;
}
......@@ -219,20 +180,20 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
* @return
*/
@Override
public List<Map<String, String>> getGrade(int schoolYear) {
public List<Map<String, Object>> getGrade(int schoolYear,Long userId) {
//获取当前登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
//管理员级部
if(1L == user.getUserId()){
List<Map<String, String>> gradeList = schoolExperimentPlanMapper.getGrade(schoolYear,null);
List<Map<String, Object>> gradeList = schoolExperimentPlanMapper.getGrade(schoolYear,null);
if(StringUtils.isNull(gradeList) || gradeList.size() == 0){
throw new ServiceException("当前学年为" + schoolYear + "学年,该学年没有级部信息");
}
return gradeList;
}
//教师级部
List<Map<String, String>> gradeList = schoolExperimentPlanMapper.getGrade(schoolYear,user.getUserId());
List<Map<String, Object>> gradeList = schoolExperimentPlanMapper.getGrade(schoolYear,user.getUserId());
if (StringUtils.isNull(gradeList) || gradeList.size() == 0) {
throw new ServiceException("当前学年为" + schoolYear + "学年,该学年没有您所在的级部信息");
}
......@@ -245,11 +206,275 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
* @return
*/
@Override
public List<Map<String, String>> getSchoolClass(Long gradeId) {
List<Map<String, String>> schoolClass = schoolExperimentPlanMapper.getSchoolClass(gradeId);
public List<Map<String, Object>> getSchoolClass(Long gradeId) {
List<Map<String, Object>> schoolClass = schoolExperimentPlanMapper.getSchoolClass(gradeId);
if (StringUtils.isNull(schoolClass) || schoolClass.size() == 0) {
throw new ServiceException("该级部还未有班级");
}
return schoolClass;
}
/**
* 级部-获取学科下拉框
* @return
*/
@Override
public List<Map<String, String>> getSub(Long gradeId) {
List<Map<String, String>> list = new ArrayList<>();
//获取当前登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
if(user.isAdmin()){
return schoolLabMapper.getSubAll();
}
LambdaQueryWrapper<SchoolGradeMentor> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolGradeMentor::getGradeId,gradeId)
.eq(SchoolGradeMentor::getTeacherId,user.getUserId());
SchoolGradeMentor schoolGradeMentor = schoolGradeMentorMapper.selectOne(wrapper);
if (StringUtils.isBlank(schoolGradeMentor.getSubGroup())){
return schoolLabMapper.getSubAll();
}
if (schoolGradeMentor.getSubGroup().equals("1")){
list.add(schoolLabMapper.getSub("1"));
}else if (schoolGradeMentor.getSubGroup().equals("2")){
list.add(schoolLabMapper.getSub("2"));
}else if (schoolGradeMentor.getSubGroup().equals("3")){
list.add(schoolLabMapper.getSub("3"));
}
return list;
}
/**
* 实验室管理-级部实验计划查看列表
* @param schoolExperimentPlanVo
* @return
*/
@Override
public List<SchoolExperimentPlanVo> getExperimentList(SchoolExperimentPlanVo schoolExperimentPlanVo) {
//获取当前登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
//获取用户角色集合
List<SysRole> roles = user.getRoles();
if (user.isAdmin()){
List<SchoolExperimentPlanVo> list = schoolExperimentPlanMapper.getExperimentList(schoolExperimentPlanVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(list1.getPlannedStartTime() + "至" + list1.getPlannedEndTime());
});
return list;
}
List<String> labSubs = new ArrayList<>();
for (SysRole role : roles) {
if (role.getRoleKey().equals("admin")){
List<SchoolExperimentPlanVo> list = schoolExperimentPlanMapper.getExperimentList(schoolExperimentPlanVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(list1.getPlannedStartTime() + "至" + list1.getPlannedEndTime());
});
return list;
}
switch (role.getRoleKey()){
case "phy_lab_admin":
labSubs.add("1");
break;
case "che_lab_admin":
labSubs.add("2");
break;
case "bio_lab_admin":
labSubs.add("3");
break;
default:break;
}
}
schoolExperimentPlanVo.setSubs(labSubs);
List<SchoolExperimentPlanVo> list = schoolExperimentPlanMapper.getExperimentList(schoolExperimentPlanVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(list1.getPlannedStartTime() + "至" + list1.getPlannedEndTime());
});
return list;
}
/**
* 领导-查看实验室完成情况列表
* @param schoolExperimentPlanVo
* @return
*/
@Override
public List<Map<String, Object>> countExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo) {
List<Map<String, Object>> list = schoolExperimentPlanMapper.countExperiment(schoolExperimentPlanVo);
list.forEach(list1 -> {
//总班级数
int totalClass = Integer.parseInt(list1.get("totalClass").toString());
//已完成班级数
int completeClass = Integer.parseInt(list1.get("completeClass").toString());
if (totalClass == 0){
list1.put("ratio","0%");
}else {
//计算完成比例
double totalClass1 = totalClass * 100.0;
double completeClass2 = completeClass * 100.0;
NumberFormat percentInstance = NumberFormat.getPercentInstance();
// 设置保留几位小数,这里设置的是保留两位小数
percentInstance.setMinimumFractionDigits(0);
String percent = percentInstance.format(completeClass2 / totalClass1);
list1.put("ratio",percent);
}
String semester = "";
if (list1.get("semester").equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.put("schoolYearSemester",list1.get("schoolYear") + semester);
});
return list;
}
/**
* 实验室管理-查看实验室完成情况列表
* @param schoolExperimentPlanVo
* @return
*/
@Override
public List<Map<String, Object>> countExperimentAdmin(SchoolExperimentPlanVo schoolExperimentPlanVo) {
//获取登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
//获取用户角色集合
List<SysRole> roles = user.getRoles();
//管理员角色返回全部数据
if (user.isAdmin()){
List<Map<String, Object>> list = schoolExperimentPlanMapper.countExperiment(schoolExperimentPlanVo);
list.forEach(list1 -> {
//总班级数
int totalClass = Integer.parseInt(list1.get("totalClass").toString());
//已完成班级数
int completeClass = Integer.parseInt(list1.get("completeClass").toString());
//计算完成比例
if (totalClass == 0){
list1.put("ratio","0%");
}else {
//计算完成比例
double totalClass1 = totalClass * 100.0;
double completeClass2 = completeClass * 100.0;
NumberFormat percentInstance = NumberFormat.getPercentInstance();
// 设置保留几位小数,这里设置的是保留两位小数
percentInstance.setMinimumFractionDigits(0);
String percent = percentInstance.format(completeClass2 / totalClass1);
list1.put("ratio",percent);
}
String semester = "";
if (list1.get("semester").equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.put("schoolYearSemester",list1.get("schoolYear") + semester);
});
return list;
}
List<String> labSubs = new ArrayList<>();
//根据用户角色返回对应数据
for (SysRole role : roles) {
if (role.getRoleKey().equals("admin")){
List<Map<String, Object>> list = schoolExperimentPlanMapper.countExperiment(schoolExperimentPlanVo);
list.forEach(list1 -> {
//总班级数
int totalClass = Integer.parseInt(list1.get("totalClass").toString());
//已完成班级数
int completeClass = Integer.parseInt(list1.get("completeClass").toString());
//计算完成比例
if (totalClass == 0){
list1.put("ratio","0%");
}else {
//计算完成比例
double totalClass1 = totalClass * 100.0;
double completeClass2 = completeClass * 100.0;
NumberFormat percentInstance = NumberFormat.getPercentInstance();
// 设置保留几位小数,这里设置的是保留两位小数
percentInstance.setMinimumFractionDigits(0);
String percent = percentInstance.format(completeClass2 / totalClass1);
list1.put("ratio",percent);
}
String semester = "";
if (list1.get("semester").equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.put("schoolYearSemester",list1.get("schoolYear") + semester);
});
return list;
}
switch (role.getRoleKey()){
case "phy_lab_admin":
labSubs.add("1");
break;
case "che_lab_admin":
labSubs.add("2");
break;
case "bio_lab_admin":
labSubs.add("3");
break;
default:break;
}
}
schoolExperimentPlanVo.setSubs(labSubs);
List<Map<String, Object>> list = schoolExperimentPlanMapper.countExperiment(schoolExperimentPlanVo);
list.forEach(list1 -> {
//总班级数
int totalClass = Integer.parseInt(list1.get("totalClass").toString());
//已完成班级数
int completeClass = Integer.parseInt(list1.get("completeClass").toString());
//计算完成比例
if (totalClass == 0){
list1.put("ratio","0%");
}else {
//计算完成比例
double totalClass1 = totalClass * 100.0;
double completeClass2 = completeClass * 100.0;
NumberFormat percentInstance = NumberFormat.getPercentInstance();
// 设置保留几位小数,这里设置的是保留两位小数
percentInstance.setMinimumFractionDigits(0);
String percent = percentInstance.format(completeClass2 / totalClass1);
list1.put("ratio",percent);
}
String semester = "";
if (list1.get("semester").equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.put("schoolYearSemester",list1.get("schoolYear") + semester);
});
return list;
}
/**
* 级部-实验室完成情况明细
* @param schoolExperimentPlanVo
* @return
*/
@Override
public List<Map<String, Object>> gradeCountExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo) {
return schoolExperimentPlanMapper.countExperiment(schoolExperimentPlanVo);
}
}
package yangtz.cs.liu.campus.service.impl.schoolLab;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearRelationMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearRelationService;
@Service
public class SchoolLabClassYearRelationServiceImpl extends ServiceImpl<SchoolLabClassYearRelationMapper, SchoolLabClassYearRelation> implements ISchoolLabClassYearRelationService {
}
package yangtz.cs.liu.campus.service.impl.schoolLab;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import java.util.List;
import java.text.SimpleDateFormat;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlan;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
/**
* 年级实验室预约Service业务层处理
......@@ -35,14 +40,20 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
@Autowired
private SchoolLabClassYearMapper schoolLabClassYearMapper;
@Autowired
private ISchoolExperimentPlanService schoolExperimentPlanService;
@Autowired
private SchoolExperimentPlanMapper schoolExperimentPlanMapper;
@Autowired
private SchoolLabMapper schoolLabMapper;
@Autowired
private SchoolLabClassYearRelationMapper relationMapper;
@Autowired
private SchoolClassMapper schoolClassMapper;
@Autowired
private SchoolTeacherLabApplyMapper schoolTeacherLabApplyMapper;
/**
* 查询年级实验室预约
*
......@@ -50,7 +61,7 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
* @return 年级实验室预约
*/
@Override
public SchoolLabClassYear selectSchoolLabClassYearById(Long id)
public SchoolLabClassYearVo selectSchoolLabClassYearById(Long id)
{
return schoolLabClassYearMapper.selectSchoolLabClassYearById(id);
}
......@@ -58,13 +69,13 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
/**
* 查询年级实验室预约列表
*
* @param schoolLabClassYear 年级实验室预约
* @param schoolLabClassYearVo 年级实验室预约
* @return 年级实验室预约
*/
@Override
public List<SchoolLabClassYear> selectSchoolLabClassYearList(SchoolLabClassYear schoolLabClassYear)
public List<SchoolLabClassYearVo> selectSchoolLabClassYearList(SchoolLabClassYearVo schoolLabClassYearVo)
{
return schoolLabClassYearMapper.selectSchoolLabClassYearList(schoolLabClassYear);
return schoolLabClassYearMapper.selectSchoolLabClassYearList(schoolLabClassYearVo);
}
/**
......@@ -84,6 +95,30 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
}
/**
* 新增年级实验室预约和实验室关系信息
*
* @param schoolLabClassYear 年级实验室预约对象
*/
public void insertSchoolLabClassYearRelation(SchoolLabClassYear schoolLabClassYear)
{
List<SchoolLabClassYearRelation> schoolLabClassYearRelationList = schoolLabClassYear.getSchoolLabClassYearRelationList();
Long id = schoolLabClassYear.getId();
if (StringUtils.isNotNull(schoolLabClassYearRelationList))
{
List<SchoolLabClassYearRelation> list = new ArrayList<SchoolLabClassYearRelation>();
for (SchoolLabClassYearRelation schoolLabClassYearRelation : schoolLabClassYearRelationList)
{
schoolLabClassYearRelation.setLabClassYearId(id);
list.add(schoolLabClassYearRelation);
}
if (list.size() > 0)
{
schoolLabClassYearMapper.batchSchoolLabClassYearRelation(list);
}
}
}
/**
* 修改年级实验室预约
*
* @param schoolLabClassYear 年级实验室预约
......@@ -93,6 +128,7 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
@Override
public int updateSchoolLabClassYear(SchoolLabClassYear schoolLabClassYear)
{
schoolLabClassYear.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolLabClassYear.setUpdateTime(DateUtils.getNowDate());
schoolLabClassYearMapper.deleteSchoolLabClassYearRelationByLabClassYearId(schoolLabClassYear.getId());
insertSchoolLabClassYearRelation(schoolLabClassYear);
......@@ -109,7 +145,6 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
@Override
public int deleteSchoolLabClassYearByIds(Long[] ids)
{
schoolLabClassYearMapper.deleteSchoolLabClassYearRelationByLabClassYearIds(ids);
return schoolLabClassYearMapper.deleteSchoolLabClassYearByIds(ids);
}
......@@ -123,32 +158,291 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
@Override
public int deleteSchoolLabClassYearById(Long id)
{
schoolLabClassYearMapper.deleteSchoolLabClassYearRelationByLabClassYearId(id);
return schoolLabClassYearMapper.deleteSchoolLabClassYearById(id);
}
/**
* 新增年级实验室预约和实验室关系信息
*
* @param schoolLabClassYear 年级实验室预约对象
* 实验室管理-年级实验室预约列表
* @param schoolLabClassYearVo
* @return
*/
public void insertSchoolLabClassYearRelation(SchoolLabClassYear schoolLabClassYear)
{
List<SchoolLabClassYearRelation> schoolLabClassYearRelationList = schoolLabClassYear.getSchoolLabClassYearRelationList();
Long id = schoolLabClassYear.getId();
if (StringUtils.isNotNull(schoolLabClassYearRelationList))
@Override
public List<SchoolLabClassYearVo> getLabClassYear(SchoolLabClassYearVo schoolLabClassYearVo) {
//获取当前登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//获取用户角色集合
List<SysRole> roles = user.getRoles();
if (user.isAdmin()){
List<SchoolLabClassYearVo> labClassYear = schoolLabClassYearMapper.getLabClassYear(schoolLabClassYearVo);
labClassYear.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3") || list1.getDeclareState().equals("2")){
LambdaQueryWrapper<SchoolLabClassYearRelation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYearRelation::getLabClassYearId,list1.getId());
List<SchoolLabClassYearRelation> relations = relationMapper.selectList(wrapper);
list1.setSchoolLabClassYearRelationList(relations);
}
});
return labClassYear;
}
List<String> labSubs = new ArrayList<>();
for (SysRole role : roles) {
if (role.getRoleKey().equals("admin")){
List<SchoolLabClassYearVo> labClassYear = schoolLabClassYearMapper.getLabClassYear(schoolLabClassYearVo);
labClassYear.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3") || list1.getDeclareState().equals("2")){
LambdaQueryWrapper<SchoolLabClassYearRelation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYearRelation::getLabClassYearId,list1.getId());
List<SchoolLabClassYearRelation> relations = relationMapper.selectList(wrapper);
list1.setSchoolLabClassYearRelationList(relations);
}
});
return labClassYear;
}
switch (role.getRoleKey()){
case "phy_lab_admin":
labSubs.add("1");
break;
case "che_lab_admin":
labSubs.add("2");
break;
case "bio_lab_admin":
labSubs.add("3");
break;
default:break;
}
}
schoolLabClassYearVo.setSubs(labSubs);
List<SchoolLabClassYearVo> labClassYear = schoolLabClassYearMapper.getLabClassYear(schoolLabClassYearVo);
labClassYear.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
list1.setPlannedTime(format.format(list1.getPlannedStartTime()) + "至" + format.format(list1.getPlannedEndTime()));
if (list1.getDeclareState().equals("3") || list1.getDeclareState().equals("2")){
LambdaQueryWrapper<SchoolLabClassYearRelation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYearRelation::getLabClassYearId,list1.getId());
List<SchoolLabClassYearRelation> relations = relationMapper.selectList(wrapper);
list1.setSchoolLabClassYearRelationList(relations);
}
});
return labClassYear;
}
/**
* 实验室管理-年级实验室-分配实验室
* @param schoolLabClassYearVo
* @return
*/
@Override
@Transactional
public int updateLabClassYear(SchoolLabClassYearVo schoolLabClassYearVo) {
List<SchoolLabClassYearRelation> schoolLabClassYearRelationList = schoolLabClassYearVo.getSchoolLabClassYearRelationList();
Long id = schoolLabClassYearVo.getId();
if (StringUtils.isNull(schoolLabClassYearRelationList)){
throw new ServiceException("您未选择实验室");
}
List<SchoolLabClassYearRelation> list = new ArrayList<SchoolLabClassYearRelation>();
for (SchoolLabClassYearRelation schoolLabClassYearRelation : schoolLabClassYearRelationList)
{
List<SchoolLabClassYearRelation> list = new ArrayList<SchoolLabClassYearRelation>();
for (SchoolLabClassYearRelation schoolLabClassYearRelation : schoolLabClassYearRelationList)
{
schoolLabClassYearRelation.setLabClassYearId(id);
list.add(schoolLabClassYearRelation);
schoolLabClassYearRelation.setLabClassYearId(id);
list.add(schoolLabClassYearRelation);
}
if (list.size() > 0)
{
schoolLabClassYearMapper.deleteSchoolLabClassYearRelationByLabClassYearId(id);
schoolLabClassYearMapper.batchSchoolLabClassYearRelation(list);
}
SchoolLabClassYear schoolLabClassYear = new SchoolLabClassYear();
BeanUtils.copyProperties(schoolLabClassYearVo,schoolLabClassYear);
return schoolLabClassYearMapper.updateById(schoolLabClassYear);
}
/**
* 获取实验室
* @return
*/
@Override
public List<Map<String, Object>> getLabList(SchoolLabClassYearVo schoolLabClassYearVo) {
//计划开始时间
Date plannedStartTime = schoolLabClassYearVo.getPlannedStartTime();
//计划结束时间
Date plannedEndTime = schoolLabClassYearVo.getPlannedEndTime();
List<Map<String, Object>> list = new ArrayList<>();
//查询所有实验室
LambdaQueryWrapper<SchoolLab> wrapper = new LambdaQueryWrapper<>();
List<SchoolLab> schoolLabs = schoolLabMapper.selectList(wrapper);
//查询所有已分配实验室的年级实验室预约
LambdaQueryWrapper<SchoolLabClassYear> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolLabClassYear::getDeclareState,"3");
List<SchoolLabClassYear> schoolLabClassYears = schoolLabClassYearMapper.selectList(lqw);
//在时间范围内的年级实验室预约id集合
List<Long> labClassYearIds = new ArrayList<>();
//筛选在计划时间范围内的年级实验室预约
for (SchoolLabClassYear schoolLabClassYear : schoolLabClassYears) {
//开始时间
Date startTime = schoolLabClassYear.getPlannedStartTime();
//结束时间
Date endTime = schoolLabClassYear.getPlannedEndTime();
if ((startTime.after(plannedStartTime) && startTime.before(plannedEndTime)) || (endTime.after(plannedStartTime) && endTime.before(plannedEndTime))){
labClassYearIds.add(schoolLabClassYear.getId());
}
if (list.size() > 0)
{
schoolLabClassYearMapper.batchSchoolLabClassYearRelation(list);
}
if (labClassYearIds.size() > 0){
//根据年级实验室预约主键id查询实验室id
List<Long> labIds = schoolLabClassYearMapper.seletLabId(labClassYearIds);
for (SchoolLab schoolLab : schoolLabs) {
Map<String, Object> map = new HashMap<>();
map.put("labId",schoolLab.getId());
map.put("labName",schoolLab.getLabName());
for (Long labId : labIds) {
if (schoolLab.getId().equals(labId)){
map.put("useState","使用中");
break;
}else {
map.put("useState","空闲");
}
}
list.add(map);
}
return list;
}
for (SchoolLab schoolLab : schoolLabs) {
Map<String, Object> map = new HashMap<>();
map.put("labId",schoolLab.getId());
map.put("labName",schoolLab.getLabName());
map.put("useState","空闲");
list.add(map);
}
return list;
}
/**
* 实验室管理-年级实验室预约查看详情
* @param id
* @return
*/
@Override
public SchoolLabClassYearVo getLabClassYearById(Long id) {
return schoolLabClassYearMapper.getLabClassYearById(id);
}
/**
* 教师-实验室安排列表
* @param schoolLabClassYearVo
* @return
*/
@Override
public List<SchoolLabClassYearVo> getTeacherLabList(SchoolLabClassYearVo schoolLabClassYearVo) {
return schoolLabClassYearMapper.getTeacherLabList(schoolLabClassYearVo);
}
/**
* xwh-新增年级预约
* @param schoolLabClassYear
* @return
*/
@Override
@Transactional
public int insertSchoolLabClassYearVo(SchoolLabClassYear schoolLabClassYear) {
int rows = 0;
//判断计划时间在不在选择的实验计划的时间范围内
Long experimentPlanId = schoolLabClassYear.getExperimentPlanId();
SchoolExperimentPlanVo schoolExperimentPlanVo = schoolExperimentPlanService.selectSchoolExperimentPlanById(experimentPlanId);
//实验计划开始时间
String plannedStartTime = schoolExperimentPlanVo.getPlannedStartTime();
//实验计划结束时间
String plannedEndTime = schoolExperimentPlanVo.getPlannedEndTime();
//年级实验室预约计划开始时间
String startTime = DateUtils.formatDate(schoolLabClassYear.getPlannedStartTime());
//年级实验室预约计划结束时间
String endTime = DateUtils.formatDate(schoolLabClassYear.getPlannedEndTime());
int plannedStartMonth = Integer.parseInt(plannedStartTime.substring(5));
int plannedEndMonth = Integer.parseInt(plannedEndTime.substring(5));
int startMonth = Integer.parseInt(startTime.substring(5,7));
int endMonth = Integer.parseInt(endTime.substring(5,7));
if ((startMonth >= plannedStartMonth && startMonth <= plannedEndMonth) && (endMonth >= plannedStartMonth && endMonth <= plannedEndMonth)){
SysUser user = SecurityUtils.getLoginUser().getUser();
schoolLabClassYear.setApplyId(user.getUserId());
schoolLabClassYear.setApplyName(user.getUserName());
schoolLabClassYear.setApplyTime(DateUtils.getNowDate());
schoolLabClassYear.setCreateBy(user.getUserName());
schoolLabClassYear.setCreateTime(DateUtils.getNowDate());
rows = schoolLabClassYearMapper.insertSchoolLabClassYear(schoolLabClassYear);
}else {
throw new ServiceException("请选择实验计划范围内的时间");
}
//修改对应实验计划,预约状态改为已预约
SchoolExperimentPlan schoolExperimentPlan = new SchoolExperimentPlan();
schoolExperimentPlan.setId(experimentPlanId);
schoolExperimentPlan.setIsAppointment("1");
schoolExperimentPlanMapper.updateById(schoolExperimentPlan);
return rows;
}
/**
* xwh-修改年级预约
* @param schoolLabClassYear
* @return
*/
@Override
@Transactional
public int updateSchoolLabClassYearVo(SchoolLabClassYear schoolLabClassYear) {
int rows = 0;
//判断计划时间在不在选择的实验计划的时间范围内
Long experimentPlanId = schoolLabClassYear.getExperimentPlanId();
SchoolExperimentPlanVo schoolExperimentPlanVo = schoolExperimentPlanService.selectSchoolExperimentPlanById(experimentPlanId);
//实验计划开始时间
String plannedStartTime = schoolExperimentPlanVo.getPlannedStartTime();
//实验计划结束时间
String plannedEndTime = schoolExperimentPlanVo.getPlannedEndTime();
//年级实验室预约计划开始时间
String startTime = DateUtils.formatDate(schoolLabClassYear.getPlannedStartTime());
//年级实验室预约计划结束时间
String endTime = DateUtils.formatDate(schoolLabClassYear.getPlannedEndTime());
int plannedStartMonth = Integer.parseInt(plannedStartTime.substring(5));
int plannedEndMonth = Integer.parseInt(plannedEndTime.substring(5));
int startMonth = Integer.parseInt(startTime.substring(5,7));
int endMonth = Integer.parseInt(endTime.substring(5,7));
if ((startMonth >= plannedStartMonth && startMonth <= plannedEndMonth) && (endMonth >= plannedStartMonth && endMonth <= plannedEndMonth)){
schoolLabClassYear.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolLabClassYear.setUpdateTime(DateUtils.getNowDate());
rows = schoolLabClassYearMapper.updateSchoolLabClassYear(schoolLabClassYear);
}else {
throw new ServiceException("请选择实验计划范围内的时间");
}
return rows;
}
/**
......@@ -190,10 +484,10 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
//1.获取列表获取本级部今年所有的计划
List<ClassSituationVo> schoolLab = schoolLabClassYearMapper.getexperimentList(classSituationVo);
for (ClassSituationVo date :schoolLab){
SchoolLabClassYear schoolLabClassYears = new SchoolLabClassYear();
schoolLabClassYears.setExperimentPlanId(date.getId().toString());
List<SchoolLabClassYear> schoolLabClassYear = schoolLabClassYearMapper.selectSchoolLabClassYearList(
schoolLabClassYears);
SchoolLabClassYearVo schoolLabClassYearsVo = new SchoolLabClassYearVo();
schoolLabClassYearsVo.setExperimentPlanId(date.getId());
List<SchoolLabClassYearVo> schoolLabClassYear = schoolLabClassYearMapper.selectSchoolLabClassYearList(
schoolLabClassYearsVo);
if (schoolLabClassYear.isEmpty()){
//未申请计划完成为0
date.setComplete(0);
......
package yangtz.cs.liu.campus.service.impl.schoolLab;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.award.Award;
import yangtz.cs.liu.campus.mapper.accessory.AccessoryMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabCompetitionMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabCompetition;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabCompetitionService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabCompetitionVo;
/**
* 实验室竞赛Service业务层处理
......@@ -21,6 +30,8 @@ public class SchoolLabCompetitionServiceImpl extends ServiceImpl<SchoolLabCompet
{
@Autowired
private SchoolLabCompetitionMapper schoolLabCompetitionMapper;
@Autowired
private AccessoryMapper accessoryMapper;
/**
* 查询实验室竞赛
......@@ -29,47 +40,73 @@ public class SchoolLabCompetitionServiceImpl extends ServiceImpl<SchoolLabCompet
* @return 实验室竞赛
*/
@Override
public SchoolLabCompetition selectSchoolLabCompetitionById(Long id)
public SchoolLabCompetitionVo selectSchoolLabCompetitionById(Long id)
{
return schoolLabCompetitionMapper.selectSchoolLabCompetitionById(id);
SchoolLabCompetitionVo schoolLabCompetitionVo = schoolLabCompetitionMapper.selectSchoolLabCompetitionById(id);
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,schoolLabCompetitionVo.getId())
.eq(SchoolAccessory::getAccessoryType,"证书照片");
List<SchoolAccessory> schoolAccessories = accessoryMapper.selectList(wrapper);
if (schoolAccessories.size() > 0){
schoolLabCompetitionVo.setSchoolAccessoryList(schoolAccessories);
}
return schoolLabCompetitionVo;
}
/**
* 查询实验室竞赛列表
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 实验室竞赛
*/
@Override
public List<SchoolLabCompetition> selectSchoolLabCompetitionList(SchoolLabCompetition schoolLabCompetition)
public List<SchoolLabCompetitionVo> selectSchoolLabCompetitionList(SchoolLabCompetitionVo schoolLabCompetitionVo)
{
return schoolLabCompetitionMapper.selectSchoolLabCompetitionList(schoolLabCompetition);
List<SchoolLabCompetitionVo> schoolLabCompetitionVos = schoolLabCompetitionMapper.selectSchoolLabCompetitionList(schoolLabCompetitionVo);
for (SchoolLabCompetitionVo labCompetitionVo : schoolLabCompetitionVos) {
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,labCompetitionVo.getId())
.eq(SchoolAccessory::getAccessoryType,"证书照片");
List<SchoolAccessory> schoolAccessories = accessoryMapper.selectList(wrapper);
if (schoolAccessories.size() > 0){
labCompetitionVo.setSchoolAccessoryList(schoolAccessories);
}
}
return schoolLabCompetitionVos;
}
/**
* 新增实验室竞赛
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 结果
*/
@Override
public int insertSchoolLabCompetition(SchoolLabCompetition schoolLabCompetition)
@Transactional
public int insertSchoolLabCompetition(SchoolLabCompetitionVo schoolLabCompetitionVo)
{
schoolLabCompetition.setCreateTime(DateUtils.getNowDate());
return schoolLabCompetitionMapper.insertSchoolLabCompetition(schoolLabCompetition);
schoolLabCompetitionVo.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolLabCompetitionVo.setCreateTime(DateUtils.getNowDate());
int rows = schoolLabCompetitionMapper.insertSchoolLabCompetition(schoolLabCompetitionVo);
insertSchoolAccessory(schoolLabCompetitionVo);
return rows;
}
/**
* 修改实验室竞赛
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 结果
*/
@Override
public int updateSchoolLabCompetition(SchoolLabCompetition schoolLabCompetition)
@Transactional
public int updateSchoolLabCompetition(SchoolLabCompetitionVo schoolLabCompetitionVo)
{
schoolLabCompetition.setUpdateTime(DateUtils.getNowDate());
return schoolLabCompetitionMapper.updateSchoolLabCompetition(schoolLabCompetition);
schoolLabCompetitionVo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolLabCompetitionVo.setUpdateTime(DateUtils.getNowDate());
schoolLabCompetitionMapper.deleteSchoolAccessoryByBusinessId(schoolLabCompetitionVo.getId());
insertSchoolAccessory(schoolLabCompetitionVo);
return schoolLabCompetitionMapper.updateSchoolLabCompetition(schoolLabCompetitionVo);
}
/**
......@@ -79,8 +116,10 @@ public class SchoolLabCompetitionServiceImpl extends ServiceImpl<SchoolLabCompet
* @return 结果
*/
@Override
@Transactional
public int deleteSchoolLabCompetitionByIds(Long[] ids)
{
schoolLabCompetitionMapper.deleteSchoolAccessoryByBusinessIds(ids);
return schoolLabCompetitionMapper.deleteSchoolLabCompetitionByIds(ids);
}
......@@ -91,8 +130,37 @@ public class SchoolLabCompetitionServiceImpl extends ServiceImpl<SchoolLabCompet
* @return 结果
*/
@Override
@Transactional
public int deleteSchoolLabCompetitionById(Long id)
{
schoolLabCompetitionMapper.deleteSchoolAccessoryByBusinessId(id);
return schoolLabCompetitionMapper.deleteSchoolLabCompetitionById(id);
}
/**
* 新增证书照片
* @param
*/
public void insertSchoolAccessory(SchoolLabCompetitionVo schoolLabCompetitionVo)
{
List<SchoolAccessory> schoolAccessoryList = schoolLabCompetitionVo.getSchoolAccessoryList();
Long id = schoolLabCompetitionVo.getId();
if (StringUtils.isNotNull(schoolAccessoryList))
{
List<SchoolAccessory> list = new ArrayList<SchoolAccessory>();
for (SchoolAccessory schoolAccessory : schoolAccessoryList)
{
schoolAccessory.setModuleName("实验室竞赛");
schoolAccessory.setAccessoryType("证书照片");
schoolAccessory.setBusinessId(id);
schoolAccessory.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolAccessory.setCreateTime(DateUtils.getNowDate());
list.add(schoolAccessory);
}
if (list.size() > 0)
{
schoolLabCompetitionMapper.batchSchoolAccessory(list);
}
}
}
}
......@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
import java.util.ArrayList;
import java.util.List;
......@@ -36,7 +37,7 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab>
* @return 实验室
*/
@Override
public SchoolLab selectSchoolLabById(Long id)
public SchoolLabVo selectSchoolLabById(Long id)
{
return schoolLabMapper.selectSchoolLabById(id);
}
......@@ -44,29 +45,44 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab>
/**
* 查询实验室列表
*
* @param schoolLab 实验室
* @param schoolLabVo 实验室
* @return 实验室
*/
@Override
public List<SchoolLab> selectSchoolLabList(SchoolLab schoolLab)
public List<SchoolLabVo> selectSchoolLabList(SchoolLabVo schoolLabVo)
{
List<SchoolLab> list = new ArrayList<>();
List<SchoolLabVo> list = new ArrayList<>();
//获取当前登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
//获取用户角色集合
List<SysRole> roles = user.getRoles();
List<String> labSubs = new ArrayList<>();
if (user.isAdmin()){
return schoolLabMapper.selectSchoolLabList(schoolLabVo);
}
for (SysRole role : roles) {
if (role.getRoleKey().equals("admin")){
return schoolLabMapper.selectSchoolLabList(schoolLab);
}else if (role.getRoleKey().equals("phy_lab_admin") || role.getRoleKey().equals("che_lab_admin") || role.getRoleKey().equals("bio_lab_admin")){
schoolLab.setInChargeId(user.getUserId());
return schoolLabMapper.selectSchoolLabList(schoolLab);
return schoolLabMapper.selectSchoolLabList(schoolLabVo);
}
switch (role.getRoleKey()){
case "phy_lab_admin":
labSubs.add("1");
break;
case "che_lab_admin":
labSubs.add("2");
break;
case "bio_lab_admin":
labSubs.add("3");
break;
default:break;
}
}
if (user.isAdmin()){
return schoolLabMapper.selectSchoolLabList(schoolLab);
}
return list;
schoolLabVo.setLabSubs(labSubs);
return schoolLabMapper.selectSchoolLabList(schoolLabVo);
}
/**
......@@ -146,11 +162,15 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab>
return schoolLabMapper.getLabAdminAll();
}
if (list.size() <= 0){
throw new ServiceException("查询到您实验室管理员信息");
throw new ServiceException("查询到您实验室管理员信息");
}
return list;
}
/**
* 获取学科
* @return
*/
@Override
public List<Map<String, String>> getSub() {
List<Map<String, String>> list = new ArrayList<>();
......
package yangtz.cs.liu.campus.service.impl.schoolLab;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherExperimentApplyMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoollTeacherExperimentApplyLabsMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
/**
* 教师个人实验申请Service业务层处理
......@@ -29,7 +40,7 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
* @return 教师个人实验申请
*/
@Override
public SchoolTeacherExperimentApply selectSchoolTeacherExperimentApplyById(Long id)
public SchoolTeacherExperimentApplyVo selectSchoolTeacherExperimentApplyById(Long id)
{
return schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyById(id);
}
......@@ -37,39 +48,47 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
/**
* 查询教师个人实验申请列表
*
* @param schoolTeacherExperimentApply 教师个人实验申请
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 教师个人实验申请
*/
@Override
public List<SchoolTeacherExperimentApply> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApply schoolTeacherExperimentApply)
public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
return schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApply);
return schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
}
/**
* 新增教师个人实验申请
*
* @param schoolTeacherExperimentApply 教师个人实验申请
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 结果
*/
@Override
public int insertSchoolTeacherExperimentApply(SchoolTeacherExperimentApply schoolTeacherExperimentApply)
public int insertSchoolTeacherExperimentApply(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
schoolTeacherExperimentApply.setCreateTime(DateUtils.getNowDate());
return schoolTeacherExperimentApplyMapper.insertSchoolTeacherExperimentApply(schoolTeacherExperimentApply);
SysUser user = SecurityUtils.getLoginUser().getUser();
schoolTeacherExperimentApplyVo.setApplyId(user.getUserId());
schoolTeacherExperimentApplyVo.setApplyName(user.getUserName());
schoolTeacherExperimentApplyVo.setApplyTime(DateUtils.getNowDate());
schoolTeacherExperimentApplyVo.setCreateBy(user.getUserName());
schoolTeacherExperimentApplyVo.setCreateTime(DateUtils.getNowDate());
int rows = schoolTeacherExperimentApplyMapper.insertSchoolTeacherExperimentApply(schoolTeacherExperimentApplyVo);
return rows;
}
/**
* 修改教师个人实验申请
*
* @param schoolTeacherExperimentApply 教师个人实验申请
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 结果
*/
@Override
public int updateSchoolTeacherExperimentApply(SchoolTeacherExperimentApply schoolTeacherExperimentApply)
public int updateSchoolTeacherExperimentApply(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
schoolTeacherExperimentApply.setUpdateTime(DateUtils.getNowDate());
return schoolTeacherExperimentApplyMapper.updateSchoolTeacherExperimentApply(schoolTeacherExperimentApply);
SysUser user = SecurityUtils.getLoginUser().getUser();
schoolTeacherExperimentApplyVo.setUpdateBy(user.getUserName());
schoolTeacherExperimentApplyVo.setUpdateTime(DateUtils.getNowDate());
return schoolTeacherExperimentApplyMapper.updateSchoolTeacherExperimentApply(schoolTeacherExperimentApplyVo);
}
/**
......@@ -95,4 +114,28 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
{
return schoolTeacherExperimentApplyMapper.deleteSchoolTeacherExperimentApplyById(id);
}
/**
* 实验室管理-教师个人演示实验审批-分配实验室
* @param schoolTeacherExperimentApplyVo
* @return
*/
@Override
public int teacherExperimentLabs(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo) {
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabsList = schoolTeacherExperimentApplyVo.getSchoolTeacherExperimentApplyLabsList();
Long id = schoolTeacherExperimentApplyVo.getId();
if (StringUtils.isNull(schoolTeacherExperimentApplyLabsList)){
throw new ServiceException("请选择实验室");
}
List<SchoolTeacherExperimentApplyLabs> list = new ArrayList<>();
for (SchoolTeacherExperimentApplyLabs schoolTeacherExperimentApplyLabs : schoolTeacherExperimentApplyLabsList) {
schoolTeacherExperimentApplyLabs.setTeacherExperimentApplyId(id);
list.add(schoolTeacherExperimentApplyLabs);
}
if (list.size() > 0){
schoolTeacherExperimentApplyMapper.deleteSchoolTeacherExperimentApplyLabsId(id);
schoolTeacherExperimentApplyMapper.batchSchoolTeacherExperimentApplyLabs(list);
}
return schoolTeacherExperimentApplyMapper.updateSchoolTeacherExperimentApply(schoolTeacherExperimentApplyVo);
}
}
package yangtz.cs.liu.campus.service.impl.schoolLab;
import com.ruoyi.common.utils.StringUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import java.util.Map;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlan;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlanClass;
import org.springframework.transaction.annotation.Transactional;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolExperimentPlanMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.mapper.accessory.AccessoryMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearRelationMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
/**
* 教师实验室申请Service业务层处理
......@@ -34,10 +37,11 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
@Autowired
private SchoolTeacherLabApplyMapper schoolTeacherLabApplyMapper;
@Autowired
private SchoolExperimentPlanMapper schoolExperimentPlanMapper;
private SchoolLabClassYearMapper schoolLabClassYearMapper;
@Autowired
private SchoolClassMapper schoolClassMapper;
private SchoolLabClassYearRelationMapper schoolLabClassYearRelationMapper;
@Autowired
private AccessoryMapper accessoryMapper;
/**
* 查询教师实验室申请
......@@ -46,7 +50,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
* @return 教师实验室申请
*/
@Override
public SchoolTeacherLabApply selectSchoolTeacherLabApplyById(Long id)
public SchoolTeacherLabApplyVo selectSchoolTeacherLabApplyById(Long id)
{
return schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyById(id);
}
......@@ -54,39 +58,45 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
/**
* 查询教师实验室申请列表
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 教师实验室申请
*/
@Override
public List<SchoolTeacherLabApply> selectSchoolTeacherLabApplyList(SchoolTeacherLabApply schoolTeacherLabApply)
public List<SchoolTeacherLabApplyVo> selectSchoolTeacherLabApplyList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
return schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(schoolTeacherLabApply);
return schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo);
}
/**
* 新增教师实验室申请
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 结果
*/
@Override
public int insertSchoolTeacherLabApply(SchoolTeacherLabApply schoolTeacherLabApply)
public int insertSchoolTeacherLabApply(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
schoolTeacherLabApply.setCreateTime(DateUtils.getNowDate());
return schoolTeacherLabApplyMapper.insertSchoolTeacherLabApply(schoolTeacherLabApply);
SysUser user = SecurityUtils.getLoginUser().getUser();
schoolTeacherLabApplyVo.setApplyId(user.getUserId());
schoolTeacherLabApplyVo.setApplyName(user.getUserName());
schoolTeacherLabApplyVo.setApplyTime(DateUtils.getNowDate());
schoolTeacherLabApplyVo.setCreateBy(user.getUserName());
schoolTeacherLabApplyVo.setCreateTime(DateUtils.getNowDate());
return schoolTeacherLabApplyMapper.insertSchoolTeacherLabApply(schoolTeacherLabApplyVo);
}
/**
* 修改教师实验室申请
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 结果
*/
@Override
public int updateSchoolTeacherLabApply(SchoolTeacherLabApply schoolTeacherLabApply)
public int updateSchoolTeacherLabApply(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
schoolTeacherLabApply.setUpdateTime(DateUtils.getNowDate());
return schoolTeacherLabApplyMapper.updateSchoolTeacherLabApply(schoolTeacherLabApply);
schoolTeacherLabApplyVo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolTeacherLabApplyVo.setUpdateTime(DateUtils.getNowDate());
return schoolTeacherLabApplyMapper.updateSchoolTeacherLabApply(schoolTeacherLabApplyVo);
}
/**
......@@ -98,6 +108,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
@Override
public int deleteSchoolTeacherLabApplyByIds(Long[] ids)
{
schoolTeacherLabApplyMapper.deleteSchoolAccessoryByBusinessIds(ids);
return schoolTeacherLabApplyMapper.deleteSchoolTeacherLabApplyByIds(ids);
}
......@@ -110,17 +121,357 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
@Override
public int deleteSchoolTeacherLabApplyById(Long id)
{
schoolTeacherLabApplyMapper.deleteSchoolAccessoryByBusinessId(id);
return schoolTeacherLabApplyMapper.deleteSchoolTeacherLabApplyById(id);
}
/**
* 获取实验室使用状态
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
public List<Map<String, Object>> getTeacherLab(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
//判断实验时间是否在计划之间之内
LambdaQueryWrapper<SchoolLabClassYear> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYear::getId,schoolTeacherLabApplyVo.getLabClassYearId());
SchoolLabClassYear schoolLabClassYear = schoolLabClassYearMapper.selectOne(wrapper);
//计划开始时间
Date plannedStartTime = schoolLabClassYear.getPlannedStartTime();
//计划结束时间
Date plannedEndTime = schoolLabClassYear.getPlannedEndTime();
//实验时间
Date experimentTime = schoolTeacherLabApplyVo.getExperimentTime();
if (experimentTime.before(plannedStartTime) || experimentTime.after(plannedEndTime)){
throw new ServiceException("请选择计划时间内的时间");
}
//返回集合
List<Map<String, Object>> list = new ArrayList<>();
//查询该年级实验室预约中已经分配的实验室id
LambdaQueryWrapper<SchoolLabClassYearRelation> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(SchoolLabClassYearRelation::getLabClassYearId,schoolTeacherLabApplyVo.getLabClassYearId());
List<SchoolLabClassYearRelation> schoolLabClassYearRelations = schoolLabClassYearRelationMapper.selectList(wrapper1);
//根据日期和节次查询正在使用的实验室
LambdaQueryWrapper<SchoolTeacherLabApply> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(SchoolTeacherLabApply::getLabClassYearId,schoolTeacherLabApplyVo.getLabClassYearId())
.eq(SchoolTeacherLabApply::getExperimentTime,schoolTeacherLabApplyVo.getExperimentTime())
.eq(SchoolTeacherLabApply::getSection,schoolTeacherLabApplyVo.getSection());
List<SchoolTeacherLabApply> schoolTeacherLabApplies = schoolTeacherLabApplyMapper.selectList(wrapper2);
//判断哪些实验室在使用中
if (schoolTeacherLabApplies.size() > 0){
for (SchoolLabClassYearRelation schoolLabClassYearRelation : schoolLabClassYearRelations) {
Map<String,Object> map = new HashMap<>();
map.put("labId",schoolLabClassYearRelation.getLabId());
map.put("labName",schoolLabClassYearRelation.getLabName());
for (SchoolTeacherLabApply schoolTeacherLabApply : schoolTeacherLabApplies) {
if (schoolLabClassYearRelation.getLabId().equals(schoolTeacherLabApply.getLabId())){
map.put("useState","使用中");
break;
}else {
map.put("useState","空闲");
}
}
list.add(map);
}
return list;
}
for (SchoolLabClassYearRelation schoolLabClassYearRelation : schoolLabClassYearRelations) {
Map<String, Object> map = new HashMap<>();
map.put("labId",schoolLabClassYearRelation.getLabId());
map.put("labName",schoolLabClassYearRelation.getLabName());
map.put("useState","空闲");
list.add(map);
}
return list;
}
/**
* 获取班级
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
public List<Map<String, Object>> getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
SysUser user = SecurityUtils.getLoginUser().getUser();
//如果是管理员,返回该实验计划所有班级
if (user.isAdmin()){
return schoolTeacherLabApplyMapper.getTeacherClassAll(schoolTeacherLabApplyVo);
}
//如果是教师,返回该教师对应的班级
schoolTeacherLabApplyVo.setTeacherId(user.getUserId());
return schoolTeacherLabApplyMapper.getTeacherClass(schoolTeacherLabApplyVo);
}
/**
* 上传附件
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
public int updateTeacherLab(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
//教师实验室预约id
Long id = schoolTeacherLabApplyVo.getId();
//附件信息集合
List<SchoolAccessory> schoolAccessoryList = schoolTeacherLabApplyVo.getSchoolAccessoryList();
List<SchoolAccessory> list = new ArrayList<>();
for (SchoolAccessory schoolAccessory : schoolAccessoryList) {
schoolAccessory.setBusinessId(id);
schoolAccessory.setModuleName("教师-教师实验室记录");
schoolAccessory.setAccessoryType("教师实验室附件");
schoolAccessory.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolAccessory.setCreateTime(DateUtils.getNowDate());
list.add(schoolAccessory);
}
if (list.size() > 0){
schoolTeacherLabApplyMapper.batchSchoolAccessory(list);
}
SchoolTeacherLabApply schoolTeacherLabApply = new SchoolTeacherLabApply();
schoolTeacherLabApply.setId(id);
schoolTeacherLabApply.setState("1");
return schoolTeacherLabApplyMapper.updateById(schoolTeacherLabApply);
}
/**
* 实验室管理-教师申请列表
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
public List<SchoolTeacherLabApplyVo> getTeacherLabApplyList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
//获取登录用户
SysUser user = SecurityUtils.getLoginUser().getUser();
if (user.isAdmin()){
List<SchoolTeacherLabApplyVo> schoolTeacherLabApplyVos = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo);
for (SchoolTeacherLabApplyVo teacherLabApplyVo : schoolTeacherLabApplyVos) {
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,teacherLabApplyVo.getId())
.eq(SchoolAccessory::getAccessoryType,"教师实验室附件");
List<SchoolAccessory> schoolAccessories = accessoryMapper.selectList(wrapper);
if (schoolAccessories.size() > 0){
teacherLabApplyVo.setSchoolAccessoryList(schoolAccessories);
}
String semester = "";
if (teacherLabApplyVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
teacherLabApplyVo.setSchoolYearSemester(teacherLabApplyVo.getSchoolYear() + semester);
}
return schoolTeacherLabApplyVos;
}
//管理员通道
List<String> subs = new ArrayList<>();
List<SysRole> roles = user.getRoles();
for (SysRole role : roles) {
if (role.getRoleKey().equals("admin")) {
List<SchoolTeacherLabApplyVo> schoolTeacherLabApplyVos = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo);
for (SchoolTeacherLabApplyVo teacherLabApplyVo : schoolTeacherLabApplyVos) {
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,teacherLabApplyVo.getId())
.eq(SchoolAccessory::getAccessoryType,"教师实验室附件");
List<SchoolAccessory> schoolAccessories = accessoryMapper.selectList(wrapper);
if (schoolAccessories.size() > 0){
teacherLabApplyVo.setSchoolAccessoryList(schoolAccessories);
}
String semester = "";
if (teacherLabApplyVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
teacherLabApplyVo.setSchoolYearSemester(teacherLabApplyVo.getSchoolYear() + semester);
}
return schoolTeacherLabApplyVos;
}
switch (role.getRoleKey()){
case "phy_lab_admin":
subs.add("1");
break;
case "che_lab_admin":
subs.add("2");
break;
case "bio_lab_admin":
subs.add("3");
break;
default:break;
}
}
schoolTeacherLabApplyVo.setSubs(subs);
List<SchoolTeacherLabApplyVo> schoolTeacherLabApplyVos = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo);
for (SchoolTeacherLabApplyVo teacherLabApplyVo : schoolTeacherLabApplyVos) {
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,teacherLabApplyVo.getId())
.eq(SchoolAccessory::getAccessoryType,"教师实验室附件");
List<SchoolAccessory> schoolAccessories = accessoryMapper.selectList(wrapper);
if (schoolAccessories.size() > 0){
teacherLabApplyVo.setSchoolAccessoryList(schoolAccessories);
}
String semester = "";
if (teacherLabApplyVo.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
teacherLabApplyVo.setSchoolYearSemester(teacherLabApplyVo.getSchoolYear() + semester);
}
return schoolTeacherLabApplyVos;
}
/**
* 实验室管理-教师申请审批确认
* @param schoolTeacherLabApply
* @return
*/
@Override
public int updateState(SchoolTeacherLabApply schoolTeacherLabApply) {
return schoolTeacherLabApplyMapper.updateById(schoolTeacherLabApply);
}
/**
* 查看班级完成详情
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
public List<Map<String, Object>> getClassDetails(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
List<Map<String, Object>> classDetails = schoolTeacherLabApplyMapper.getClassDetails(schoolTeacherLabApplyVo);
classDetails.forEach(classDetails1 -> {
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,classDetails1.get("id"))
.eq(SchoolAccessory::getAccessoryType,"教师实验室附件");
List<SchoolAccessory> schoolAccessories = accessoryMapper.selectList(wrapper);
if (schoolAccessories.size() > 0){
classDetails1.put("schoolAccessories",schoolAccessories);
}
});
return classDetails;
}
/**
* 教师实验统计
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
public List<Map<String, Object>> getCountTeacher(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
return schoolTeacherLabApplyMapper.getCountTeacher(schoolTeacherLabApplyVo);
}
/**
* 级部-班级完成情况明细
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
public List<Map<String, Object>> gradeCountClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
return schoolTeacherLabApplyMapper.gradeCountClass(schoolTeacherLabApplyVo);
}
/**
* 级部-班级完成情况明细-查看班级完成情况详情
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
public List<SchoolTeacherLabApplyVo> getGradeClassDetails(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
List<SchoolTeacherLabApplyVo> list = schoolTeacherLabApplyMapper.getGradeClassDetails(schoolTeacherLabApplyVo);
list.forEach(list1 -> {
String semester = "";
if (list1.getSemester().equals("1")){
semester = "上学期";
}else {
semester = "下学期";
}
list1.setSchoolYearSemester(list1.getSchoolYear() + semester);
});
return list;
}
/**
* xwh-新增教师申请
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
@Transactional
public int insertSchoolTeacherLabApplyVo(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
//判断选择的班级是否存在此次实验
LambdaQueryWrapper<SchoolTeacherLabApply> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolTeacherLabApply::getClassId,schoolTeacherLabApplyVo.getClassId())
.eq(SchoolTeacherLabApply::getLabClassYearId,schoolTeacherLabApplyVo.getLabClassYearId());
SchoolTeacherLabApply schoolTeacherLabApply = schoolTeacherLabApplyMapper.selectOne(lqw);
if (StringUtils.isNotNull(schoolTeacherLabApply)){
throw new ServiceException("已存在该班级此次实验申请");
}
//判断实验时间是否在计划之间之内
LambdaQueryWrapper<SchoolLabClassYear> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYear::getId,schoolTeacherLabApplyVo.getLabClassYearId());
SchoolLabClassYear schoolLabClassYear = schoolLabClassYearMapper.selectOne(wrapper);
//计划开始时间
Date plannedStartTime = schoolLabClassYear.getPlannedStartTime();
//计划结束时间
Date plannedEndTime = schoolLabClassYear.getPlannedEndTime();
//实验时间
Date experimentTime = schoolTeacherLabApplyVo.getExperimentTime();
if (experimentTime.before(plannedStartTime) || experimentTime.after(plannedEndTime)){
throw new ServiceException("请选择计划时间内的时间");
}
//判断是否选择了实验室
if (StringUtils.isNull(schoolTeacherLabApplyVo.getLabId())){
throw new ServiceException("请选择实验室");
}
SysUser user = SecurityUtils.getLoginUser().getUser();
schoolTeacherLabApplyVo.setApplyId(user.getUserId());
schoolTeacherLabApplyVo.setApplyName(user.getUserName());
schoolTeacherLabApplyVo.setApplyTime(DateUtils.getNowDate());
schoolTeacherLabApplyVo.setCreateBy(user.getUserName());
schoolTeacherLabApplyVo.setCreateTime(DateUtils.getNowDate());
return schoolTeacherLabApplyMapper.insertSchoolTeacherLabApply(schoolTeacherLabApplyVo);
}
/**
* xwh-修改教师申请
* @param schoolTeacherLabApplyVo
* @return
*/
@Override
@Transactional
public int updateSchoolTeacherLabApplyVo(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
//判断实验时间是否在计划之间之内
LambdaQueryWrapper<SchoolLabClassYear> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYear::getId,schoolTeacherLabApplyVo.getLabClassYearId());
SchoolLabClassYear schoolLabClassYear = schoolLabClassYearMapper.selectOne(wrapper);
//计划开始时间
Date plannedStartTime = schoolLabClassYear.getPlannedStartTime();
//计划结束时间
Date plannedEndTime = schoolLabClassYear.getPlannedEndTime();
//实验时间
Date experimentTime = schoolTeacherLabApplyVo.getExperimentTime();
if (experimentTime.before(plannedStartTime) || experimentTime.after(plannedEndTime)){
throw new ServiceException("请选择计划时间内的时间");
}
schoolTeacherLabApplyVo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolTeacherLabApplyVo.setUpdateTime(DateUtils.getNowDate());
return schoolTeacherLabApplyMapper.updateSchoolTeacherLabApply(schoolTeacherLabApplyVo);
}
/**
* 获取班级详情
* @param one
* @return
*/
@Override
public List<SchoolTeacherLabApply> getTeacherExperimentList(ClassSituationVo one) {
SchoolTeacherLabApply schoolTeacherLabApply = new SchoolTeacherLabApply();
public List<SchoolTeacherLabApplyVo> getTeacherExperimentList(ClassSituationVo one) {
SchoolTeacherLabApplyVo schoolTeacherLabApply = new SchoolTeacherLabApplyVo();
schoolTeacherLabApply.setLabClassYearId(one.getLabClassYearId().toString());
schoolTeacherLabApply.setSchoolYear(one.getSchoolYear().toString());
schoolTeacherLabApply.setSemester(one.getSemester());
......@@ -128,8 +479,8 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
schoolTeacherLabApply.setState(one.getState());
schoolTeacherLabApply.setClassName(one.getClassName());
//1.已经进行的班级
List<SchoolTeacherLabApply> schoolTeacherLabApplies = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(
schoolTeacherLabApply);
List<SchoolTeacherLabApplyVo> schoolTeacherLabApplies = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(
schoolTeacherLabApply);
return schoolTeacherLabApplies;
}
......@@ -142,7 +493,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
@Override
public List<Map<String, String>> selectTeacherList(SchoolTeacherLabApply schoolTeacherLabApply) {
List<Map<String, String>> maps = schoolTeacherLabApplyMapper.selectTeacherList(
schoolTeacherLabApply);
schoolTeacherLabApply);
return maps;
}
}
package yangtz.cs.liu.campus.service.impl.schoolLab;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoollTeacherExperimentApplyLabsMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoollTeacherExperimentApplyLabsService;
@Service
public class SchoollTeacherExperimentApplyLabsServiceImpl extends ServiceImpl<SchoollTeacherExperimentApplyLabsMapper, SchoolTeacherExperimentApplyLabs> implements ISchoollTeacherExperimentApplyLabsService {
}
......@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlan;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanMbVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import java.util.List;
......@@ -69,12 +70,42 @@ public interface ISchoolExperimentPlanService extends IService<SchoolExperimentP
* @param schoolYear
* @return
*/
List<Map<String,String>> getGrade(int schoolYear);
List<Map<String,Object>> getGrade(int schoolYear,Long userId);
/**
* 根据级部查询对应班级
* @param gradeId
* @return
*/
List<Map<String,String>> getSchoolClass(Long gradeId);
List<Map<String,Object>> getSchoolClass(Long gradeId);
List<Map<String,String>> getSub(Long gradeId);
/**
* 实验室管理-级部实验计划查看列表
* @param schoolExperimentPlanVo
* @return
*/
List<SchoolExperimentPlanVo> getExperimentList(SchoolExperimentPlanVo schoolExperimentPlanVo);
/**
* 领导-查看实验室完成情况列表
* @param schoolExperimentPlanVo
* @return
*/
List<Map<String,Object>> countExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo);
/**
* 实验室管理-查看实验室完成情况列表
* @param schoolExperimentPlanVo
* @return
*/
List<Map<String,Object>> countExperimentAdmin(SchoolExperimentPlanVo schoolExperimentPlanVo);
/**
* 级部-实验室完成情况明细
* @param schoolExperimentPlanVo
* @return
*/
List<Map<String, Object>> gradeCountExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo);
}
package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
public interface ISchoolLabClassYearRelationService extends IService<SchoolLabClassYearRelation> {
}
......@@ -2,9 +2,11 @@ package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import java.util.List;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import java.util.Map;
/**
* 年级实验室预约Service接口
......@@ -21,15 +23,15 @@ public interface ISchoolLabClassYearService extends IService<SchoolLabClassYear>
* @param id 年级实验室预约主键
* @return 年级实验室预约
*/
public SchoolLabClassYear selectSchoolLabClassYearById(Long id);
public SchoolLabClassYearVo selectSchoolLabClassYearById(Long id);
/**
* 查询年级实验室预约列表
*
* @param schoolLabClassYear 年级实验室预约
* @param schoolLabClassYearVo 年级实验室预约
* @return 年级实验室预约集合
*/
public List<SchoolLabClassYear> selectSchoolLabClassYearList(SchoolLabClassYear schoolLabClassYear);
public List<SchoolLabClassYearVo> selectSchoolLabClassYearList(SchoolLabClassYearVo schoolLabClassYearVo);
/**
* 新增年级实验室预约
......@@ -63,8 +65,55 @@ public interface ISchoolLabClassYearService extends IService<SchoolLabClassYear>
*/
public int deleteSchoolLabClassYearById(Long id);
/**
* 实验室管理-年级实验室预约列表
* @param schoolLabClassYearVo
* @return
*/
List<SchoolLabClassYearVo> getLabClassYear(SchoolLabClassYearVo schoolLabClassYearVo);
/**
* 实验室管理-年级实验室-分配实验室
* @param schoolLabClassYearVo
* @return
*/
int updateLabClassYear(SchoolLabClassYearVo schoolLabClassYearVo);
/**
* 获取实验室
* @param schoolLabClassYearVo
* @return
*/
List<Map<String,Object>> getLabList(SchoolLabClassYearVo schoolLabClassYearVo);
/**
* 实验室管理-年级实验室预约查看详情
* @param id
* @return
*/
SchoolLabClassYearVo getLabClassYearById(Long id);
/**
* 教师-实验室安排列表
* @param schoolLabClassYearVo
* @return
*/
List<SchoolLabClassYearVo> getTeacherLabList(SchoolLabClassYearVo schoolLabClassYearVo);
/**
* xwh-新增年级预约
* @param schoolLabClassYear
* @return
*/
int insertSchoolLabClassYearVo(SchoolLabClassYear schoolLabClassYear);
/**
* xwh-修改年级预约
* @param schoolLabClassYear
* @return
*/
int updateSchoolLabClassYearVo(SchoolLabClassYear schoolLabClassYear);
public List<ClassSituationVo> classSituation(ClassSituationVo classSituationVo);
public List<ClassSituationVo> getexperimentList(ClassSituationVo classSituationVo);
}
......@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabCompetition;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabCompetitionVo;
import java.util.List;
......@@ -19,31 +20,31 @@ public interface ISchoolLabCompetitionService extends IService<SchoolLabCompetit
* @param id 实验室竞赛主键
* @return 实验室竞赛
*/
public SchoolLabCompetition selectSchoolLabCompetitionById(Long id);
public SchoolLabCompetitionVo selectSchoolLabCompetitionById(Long id);
/**
* 查询实验室竞赛列表
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 实验室竞赛集合
*/
public List<SchoolLabCompetition> selectSchoolLabCompetitionList(SchoolLabCompetition schoolLabCompetition);
public List<SchoolLabCompetitionVo> selectSchoolLabCompetitionList(SchoolLabCompetitionVo schoolLabCompetitionVo);
/**
* 新增实验室竞赛
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 结果
*/
public int insertSchoolLabCompetition(SchoolLabCompetition schoolLabCompetition);
public int insertSchoolLabCompetition(SchoolLabCompetitionVo schoolLabCompetitionVo);
/**
* 修改实验室竞赛
*
* @param schoolLabCompetition 实验室竞赛
* @param schoolLabCompetitionVo 实验室竞赛
* @return 结果
*/
public int updateSchoolLabCompetition(SchoolLabCompetition schoolLabCompetition);
public int updateSchoolLabCompetition(SchoolLabCompetitionVo schoolLabCompetitionVo);
/**
* 批量删除实验室竞赛
......
......@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
import java.util.List;
import java.util.Map;
......@@ -21,15 +22,15 @@ public interface ISchoolLabService extends IService<SchoolLab>
* @param id 实验室主键
* @return 实验室
*/
public SchoolLab selectSchoolLabById(Long id);
public SchoolLabVo selectSchoolLabById(Long id);
/**
* 查询实验室列表
*
* @param schoolLab 实验室
* @param schoolLabVo 实验室
* @return 实验室集合
*/
public List<SchoolLab> selectSchoolLabList(SchoolLab schoolLab);
public List<SchoolLabVo> selectSchoolLabList(SchoolLabVo schoolLabVo);
/**
* 新增实验室
......
......@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
import java.util.List;
......@@ -19,15 +20,15 @@ public interface ISchoolTeacherExperimentApplyService extends IService<SchoolTea
* @param id 教师个人实验申请主键
* @return 教师个人实验申请
*/
public SchoolTeacherExperimentApply selectSchoolTeacherExperimentApplyById(Long id);
public SchoolTeacherExperimentApplyVo selectSchoolTeacherExperimentApplyById(Long id);
/**
* 查询教师个人实验申请列表
*
* @param schoolTeacherExperimentApply 教师个人实验申请
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 教师个人实验申请集合
*/
public List<SchoolTeacherExperimentApply> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApply schoolTeacherExperimentApply);
public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 新增教师个人实验申请
......@@ -35,7 +36,7 @@ public interface ISchoolTeacherExperimentApplyService extends IService<SchoolTea
* @param schoolTeacherExperimentApply 教师个人实验申请
* @return 结果
*/
public int insertSchoolTeacherExperimentApply(SchoolTeacherExperimentApply schoolTeacherExperimentApply);
public int insertSchoolTeacherExperimentApply(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApply);
/**
* 修改教师个人实验申请
......@@ -43,7 +44,7 @@ public interface ISchoolTeacherExperimentApplyService extends IService<SchoolTea
* @param schoolTeacherExperimentApply 教师个人实验申请
* @return 结果
*/
public int updateSchoolTeacherExperimentApply(SchoolTeacherExperimentApply schoolTeacherExperimentApply);
public int updateSchoolTeacherExperimentApply(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApply);
/**
* 批量删除教师个人实验申请
......@@ -60,4 +61,12 @@ public interface ISchoolTeacherExperimentApplyService extends IService<SchoolTea
* @return 结果
*/
public int deleteSchoolTeacherExperimentApplyById(Long id);
/**
* 实验室管理-教师个人演示实验审批-分配实验室
* @param schoolTeacherExperimentApplyVo
* @return
*/
int teacherExperimentLabs(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
}
package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Map;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import java.util.List;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import java.util.Map;
/**
* 教师实验室申请Service接口
......@@ -22,31 +22,31 @@ public interface ISchoolTeacherLabApplyService extends IService<SchoolTeacherLab
* @param id 教师实验室申请主键
* @return 教师实验室申请
*/
public SchoolTeacherLabApply selectSchoolTeacherLabApplyById(Long id);
public SchoolTeacherLabApplyVo selectSchoolTeacherLabApplyById(Long id);
/**
* 查询教师实验室申请列表
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 教师实验室申请集合
*/
public List<SchoolTeacherLabApply> selectSchoolTeacherLabApplyList(SchoolTeacherLabApply schoolTeacherLabApply);
public List<SchoolTeacherLabApplyVo> selectSchoolTeacherLabApplyList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 新增教师实验室申请
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 结果
*/
public int insertSchoolTeacherLabApply(SchoolTeacherLabApply schoolTeacherLabApply);
public int insertSchoolTeacherLabApply(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 修改教师实验室申请
*
* @param schoolTeacherLabApply 教师实验室申请
* @param schoolTeacherLabApplyVo 教师实验室申请
* @return 结果
*/
public int updateSchoolTeacherLabApply(SchoolTeacherLabApply schoolTeacherLabApply);
public int updateSchoolTeacherLabApply(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 批量删除教师实验室申请
......@@ -64,7 +64,83 @@ public interface ISchoolTeacherLabApplyService extends IService<SchoolTeacherLab
*/
public int deleteSchoolTeacherLabApplyById(Long id);
/**
* 获取实验室使用状态
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String, Object>> getTeacherLab(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 获取班级
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String, Object>> getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 上传附件
* @param schoolTeacherLabApplyVo
* @return
*/
int updateTeacherLab(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 实验室管理-教师申请列表
* @param schoolTeacherLabApplyVo
* @return
*/
List<SchoolTeacherLabApplyVo> getTeacherLabApplyList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 实验室管理-教师申请审批确认
* @param schoolTeacherLabApply
* @return
*/
int updateState(SchoolTeacherLabApply schoolTeacherLabApply);
/**
* 查看班级完成详情
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String,Object>> getClassDetails(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 教师实验统计
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String,Object>> getCountTeacher(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 级部-班级完成情况明细
* @param schoolTeacherLabApplyVo
* @return
*/
List<Map<String,Object>> gradeCountClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* 级部-班级完成情况明细-查看班级完成情况详情
* @param schoolTeacherLabApplyVo
* @return
*/
List<SchoolTeacherLabApplyVo> getGradeClassDetails(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* xwh-新增教师申请
* @param schoolTeacherLabApplyVo
* @return
*/
int insertSchoolTeacherLabApplyVo(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
/**
* xwh-修改教师申请
* @param schoolTeacherLabApplyVo
* @return
*/
int updateSchoolTeacherLabApplyVo(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo);
List<SchoolTeacherLabApply> getTeacherExperimentList(ClassSituationVo one);
List<SchoolTeacherLabApplyVo> getTeacherExperimentList(ClassSituationVo one);
List<Map<String,String>> selectTeacherList(SchoolTeacherLabApply schoolTeacherLabApply);
}
package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
public interface ISchoollTeacherExperimentApplyLabsService extends IService<SchoolTeacherExperimentApplyLabs> {
}
......@@ -8,75 +8,75 @@ import lombok.Data;
@Data
public class ClassSituationVo {
/**
* 实验室计划id
*/
private Long id;
/**
* 级部预约id
*/
private Long labClassYearId;
/**
* 实验室计划id
*/
private Long id;
/**
* 级部预约id
*/
private Long labClassYearId;
/**
* 级部id
*/
private Long gradeId;
/**
* 级部
*/
private String grade;
/**
* 班级id
*/
private Long classId;
/**
* 级部id
*/
private Long gradeId;
/**
* 级部
*/
private String grade;
/**
* 班级id
*/
private Long classId;
/**
* 学年
*/
private String schoolYear;
/**
* 学期
*/
private String semester;
/**
* 学年
*/
private String schoolYear;
/**
* 学期
*/
private String semester;
/**
* 班级
*/
private String className;
/**
* 班级
*/
private String className;
/**
* 实验室名称
*/
private String experimentName;
/**
* 实验室名称
*/
private String experimentName;
/**
* 实验室是否使用完成 (0未完成,1完成)
*/
private String state;
/**
* 实验室是否使用完成 (0未完成,1完成)
*/
private String state;
/**
* 实验时间
*/
private String experimentTime;
/**
* 实验时间
*/
private String experimentTime;
/**
* 已完成实验数
*/
private Integer complete;
/**
* 总数
*/
private Integer count;
/**
* 已完成实验数
*/
private Integer complete;
/**
* 总数
*/
private Integer count;
/**
* 未完成实验数
*/
private Integer incomplete;
/**
* 未完成实验数
*/
private Integer incomplete;
/**
* 完成比例
*/
private Integer proportion;
/**
* 完成比例
*/
private Integer proportion;
}
......@@ -23,11 +23,12 @@ public class SchoolExperimentPlanVo extends BaseEntity
private Long id;
/** 学科(1物理,2化学,3生物) */
@Excel(name = "学科", readConverterExp = "1=物理,2=化学,3=生物")
@Excel(name = "学科", combo = {"物理","化学","生物"}, readConverterExp = "1=物理,2=化学,3=生物")
private String sub;
private List<String> subs;
/** 级部id */
@Excel(name = "级部id")
private Long gradeId;
private List<Long> gradeIds;
......@@ -37,16 +38,18 @@ public class SchoolExperimentPlanVo extends BaseEntity
private String grade;
/** 学年 */
@Excel(name = "学年")
private String schoolYear;
/** 学年+学期 */
private String schoolYearSemester;
/** 学期(1上学期,2下学期) */
@Excel(name = "学期", combo = {"上学期","下学期"}, readConverterExp = "1=上学期,2=下学期")
private String semester;
/** 实验分类(1分组实验,2演示实验,3探究实验) */
@Excel(name = "实验分类", readConverterExp = "1=分组实验,2=演示实验,3=探究实验")
@Excel(name = "实验分类", combo = {"分组实验","演示实验","探究实验"}, readConverterExp = "1=分组实验,2=演示实验,3=探究实验")
private String experimentClassify;
/** 实验名称 */
......@@ -58,13 +61,15 @@ public class SchoolExperimentPlanVo extends BaseEntity
private String chapterContent;
/** 是否已预约 */
@Excel(name = "是否已预约", readConverterExp = "0=否,1=是")
@Excel(name = "是否已预约", combo = {"是","否"}, readConverterExp = "0=否,1=是")
private String isAppointment;
/** 计划开始时间 */
@Excel(name = "计划开始时间")
private String plannedStartTime;
/** 计划结束时间 */
@Excel(name = "计划结束时间")
private String plannedEndTime;
/** 计划时间 */
......
......@@ -26,7 +26,16 @@ public class SchoolLabClassYearVo extends BaseEntity
private Long id;
/** 实验计划id */
private String experimentPlanId;
private Long experimentPlanId;
/** 实验名称 */
private String experimentName;
/** 级部id */
private Long gradeId;
/** 级部id集合 */
private List<Long> gradeIds;
/** 级部 */
@Excel(name = "级部")
......@@ -36,6 +45,9 @@ public class SchoolLabClassYearVo extends BaseEntity
@Excel(name = "学年")
private String schoolYear;
/** 学年+学期 */
private String schoolYearSemester;
/** 学期(1上学期,2下学期) */
@Excel(name = "学期", readConverterExp = "1=上学期,2=下学期")
private String semester;
......@@ -44,6 +56,8 @@ public class SchoolLabClassYearVo extends BaseEntity
@Excel(name = "学科", readConverterExp = "1=物理,2=化学,3=生物")
private String sub;
private List<String> subs;
/** 实验分类(1分组实验,2演示实验,3探究实验) */
@Excel(name = "实验分类", readConverterExp = "1=分组实验,2=演示实验,3=探究实验")
private String experimentClassify;
......@@ -58,6 +72,9 @@ public class SchoolLabClassYearVo extends BaseEntity
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date plannedEndTime;
/** 计划时间 */
private String plannedTime;
/** 章节内容 */
@Excel(name = "章节内容")
private String chapterContent;
......
......@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import java.util.List;
/**
* 实验室竞赛对象Vo
......@@ -61,4 +64,7 @@ public class SchoolLabCompetitionVo extends BaseEntity
/** 备注3 */
@Excel(name = "备注3")
private String remark3;
/** 图片信息集合 */
private List<SchoolAccessory> schoolAccessoryList;
}
......@@ -6,6 +6,8 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.List;
/**
* 实验室对象Vo
*
......@@ -28,6 +30,9 @@ public class SchoolLabVo extends BaseEntity
@Excel(name = "实验室学科", readConverterExp = "1=物理,2=化学,3=生物")
private String labSub;
/** 实验室学科集合 */
private List<String> labSubs;
/** 负责人id */
private Long inChargeId;
......@@ -42,4 +47,7 @@ public class SchoolLabVo extends BaseEntity
/** 实验室用品 */
@Excel(name = "实验室用品")
private String labUseGoods;
/** 使用状态 */
private String useState;
}
package yangtz.cs.liu.campus.vo.schoolLab;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -8,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
/**
* 教师个人实验申请对象Vo
......@@ -29,6 +31,8 @@ public class SchoolTeacherExperimentApplyVo extends BaseEntity
@Excel(name = "学科", readConverterExp = "1=物理,2=化学,3=生物")
private String sub;
private List<String> subs;
/** 级部id */
private Long gradeId;
......@@ -44,6 +48,19 @@ public class SchoolTeacherExperimentApplyVo extends BaseEntity
@Excel(name = "学期")
private String semester;
/** 学年+学期 */
private String schoolYearSemester;
/** 规划开始时间 */
@Excel(name = "规划开始时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date plannedStartTime;
/** 规划结束时间 */
@Excel(name = "规划结束时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date plannedEndTime;
/** 规划时间 */
@Excel(name = "规划时间")
private String plannedTime;
......@@ -60,13 +77,6 @@ public class SchoolTeacherExperimentApplyVo extends BaseEntity
@Excel(name = "实验用品")
private String experimentUseGoods;
/** 实验室id */
private String labId;
/** 实验室名称 */
@Excel(name = "实验室名称")
private String labName;
/** 申报状态(0未申报,1已申报,2已阅读,3已分配) */
@Excel(name = "申报状态", readConverterExp = "0=未申报,1=已申报,2=已阅读,3=已分配")
private String declareState;
......@@ -82,4 +92,7 @@ public class SchoolTeacherExperimentApplyVo extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "申报时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
/** 教师个人实验申请实验室列表 */
private List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabsList;
}
package yangtz.cs.liu.campus.vo.schoolLab;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -8,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
/**
* 教师实验室申请对象Vo
......@@ -28,14 +30,31 @@ public class SchoolTeacherLabApplyVo extends BaseEntity
/** 年级实验室预约主键id */
private String labClassYearId;
/** 教师id */
private Long teacherId;
/** 实验分类(1分组实验,2演示实验,3探究实验) */
@Excel(name = "实验分类", readConverterExp = "1=分组实验,2=演示实验,3=探究实验")
private String experimentClassify;
/** 实验计划id */
private Long experimentPlanId;
/** 实验名称 */
private String experimentName;
/** 学科(1物理,2化学,3生物) */
@Excel(name = "学科", readConverterExp = "1=物理,2=化学,3=生物")
private String sub;
/** 学科集合 */
private List<String> subs;
/** 级部id */
private Long gradeId;
private List<Long> gradeIds;
/** 级部 */
@Excel(name = "级部")
private String grade;
......@@ -48,6 +67,9 @@ public class SchoolTeacherLabApplyVo extends BaseEntity
@Excel(name = "学期", readConverterExp = "1=上学期,2=下学期")
private String semester;
/** 学年+学期 */
private String schoolYearSemester;
/** 班级id */
private String classId;
......@@ -90,4 +112,18 @@ public class SchoolTeacherLabApplyVo extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
/** 实验室是否使用完成 (0未完成,1完成) */
private String state;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endTime;
/** 附件信息集合 */
private List<SchoolAccessory> schoolAccessoryList;
}
......@@ -3,15 +3,8 @@ package yangtz.cs.liu.wechat.controller.experiment;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
......@@ -19,6 +12,12 @@ import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import java.util.List;
import java.util.Map;
/**
* 实验室管理员
......@@ -51,9 +50,9 @@ public class ExperimentAdministratorsControoler extends BaseController {
* 年级实验室分分配列表
*/
@GetMapping("/classYear/list")
public AjaxResult classYearList(SchoolLabClassYear schoolLabClassYear)
public AjaxResult classYearList(SchoolLabClassYearVo schoolLabClassYearVo)
{
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYear));
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo));
}
/**
......@@ -79,9 +78,9 @@ public class ExperimentAdministratorsControoler extends BaseController {
* 教师实验室预约列表
*/
@GetMapping(value = "/teacher/list")
public AjaxResult teacherList(SchoolTeacherLabApply schoolTeacherLabApply)
public AjaxResult teacherList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApply));
return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo));
}
/**
......@@ -106,9 +105,9 @@ public class ExperimentAdministratorsControoler extends BaseController {
*/
@GetMapping(value = "/apply/list")
public AjaxResult applyList(SchoolTeacherExperimentApply schoolTeacherExperimentApply)
public AjaxResult applyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
return AjaxResult.success(schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApply));
return AjaxResult.success(schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo));
}
/**
......@@ -140,7 +139,7 @@ public class ExperimentAdministratorsControoler extends BaseController {
}
/**
*实验室完成详情
* 实验室完成详情
*/
@GetMapping("/teacherExperimentList")
public AjaxResult teacherExperimentList(ClassSituationVo classSituationVo){
......@@ -149,7 +148,7 @@ public class ExperimentAdministratorsControoler extends BaseController {
SchoolLabClassYear one = schoolLabClassYearService.getOne(lw);
classSituationVo.setLabClassYearId(one.getId());
List<SchoolTeacherLabApply> teacherExperimentList = schoolTeacherLabApplyService.getTeacherExperimentList(
List<SchoolTeacherLabApplyVo> teacherExperimentList = schoolTeacherLabApplyService.getTeacherExperimentList(
classSituationVo);
return AjaxResult.success(teacherExperimentList);
}
......
package yangtz.cs.liu.wechat.controller.experiment;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import java.util.List;
/**
* 实验室 级部申请
......@@ -72,7 +64,7 @@ public class ExperimentLevelController extends BaseController {
*获取级部预约列表
*/
@GetMapping("/list")
public AjaxResult list(SchoolLabClassYear schoolLabClassYear)
public AjaxResult list(SchoolLabClassYearVo schoolLabClassYear)
{
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYear));
}
......@@ -111,8 +103,8 @@ public class ExperimentLevelController extends BaseController {
* 班级完成详情
*/
@GetMapping("/getClassExperimentalDetails")
public AjaxResult getClassExperimentalDetails(SchoolTeacherLabApply schoolTeacherLabApply){
List<SchoolTeacherLabApply> list = schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApply);
public AjaxResult getClassExperimentalDetails(SchoolTeacherLabApplyVo schoolTeacherLabApply){
List<SchoolTeacherLabApplyVo> list = schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApply);
return AjaxResult.success(list);
}
......@@ -130,18 +122,18 @@ public class ExperimentLevelController extends BaseController {
}
/**
*实验室完成详情
* 实验室完成详情
*/
@GetMapping("/teacherExperimentList")
public AjaxResult teacherExperimentList(ClassSituationVo classSituationVo){
SchoolLabClassYear schoolLabClassYear = new SchoolLabClassYear();
schoolLabClassYear.setExperimentPlanId(classSituationVo.getId().toString());
List<SchoolLabClassYear> schoolLabClassYears = schoolLabClassYearService.selectSchoolLabClassYearList(
SchoolLabClassYearVo schoolLabClassYear = new SchoolLabClassYearVo();
schoolLabClassYear.setExperimentPlanId(classSituationVo.getId());
List<SchoolLabClassYearVo> schoolLabClassYears = schoolLabClassYearService.selectSchoolLabClassYearList(
schoolLabClassYear);
if (!schoolLabClassYears.isEmpty()){
classSituationVo.setLabClassYearId(schoolLabClassYears.get(0).getId());
}
List<SchoolTeacherLabApply> teacherExperimentList = schoolTeacherLabApplyService.getTeacherExperimentList(
List<SchoolTeacherLabApplyVo> teacherExperimentList = schoolTeacherLabApplyService.getTeacherExperimentList(
classSituationVo);
return AjaxResult.success(teacherExperimentList);
}
......
package yangtz.cs.liu.wechat.controller.experiment;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import java.util.List;
/**
* 实验室 老师申请
......@@ -49,10 +44,10 @@ public class TeacherExperimentController extends BaseController {
*/
@GetMapping(value = "/classYear/list")
public AjaxResult classYearlist(SchoolLabClassYear schoolLabClassYear)
public AjaxResult classYearlist(SchoolLabClassYearVo schoolLabClassYearVo)
{
List<SchoolLabClassYear> schoolLabClassYears = schoolLabClassYearService.selectSchoolLabClassYearList(
schoolLabClassYear);
List<SchoolLabClassYearVo> schoolLabClassYears = schoolLabClassYearService.selectSchoolLabClassYearList(
schoolLabClassYearVo);
return AjaxResult.success(schoolLabClassYears);
}
......@@ -79,9 +74,9 @@ public class TeacherExperimentController extends BaseController {
* 实验室申请记录
*/
@GetMapping(value = "/list")
public AjaxResult list(SchoolTeacherLabApply schoolTeacherLabApply)
public AjaxResult list(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApply));
return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo));
}
/**
* 实验室申请详情
......@@ -97,9 +92,9 @@ public class TeacherExperimentController extends BaseController {
*/
@GetMapping(value = "/apply/list")
public AjaxResult applyList(SchoolTeacherExperimentApply schoolTeacherExperimentApply)
public AjaxResult applyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
return AjaxResult.success(schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApply));
return AjaxResult.success(schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo));
}
/**
......
......@@ -38,14 +38,6 @@
order by g.grade_value, g.class_value
</select>
<select id="getClassName" parameterType="Long" resultType="String">
select g.class_name
from school_class g
where g.del_flag = '0' and g.id=#{classId}
</select>
<select id="getUserClassByParent" resultType="SchoolClass">
SELECT sg.pic_url,
sg.class_value,
......
......@@ -45,29 +45,60 @@
del_flag = '0'
<if test="sub != null and sub != ''"> and sub = #{sub}</if>
<if test="gradeId != null "> and grade_id = #{gradeId}</if>
<if test="grade != null and grade != ''"> and grade = #{grade}</if>
<if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</if>
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="chapterContent != null and chapterContent != ''"> and chapter_content = #{chapterContent}</if>
<if test="isAppointment != null and isAppointment != ''"> and is_appointment = #{isAppointment}</if>
<if test="plannedStartTime != null and plannedStartTime != ''"> and planned_start_time = #{plannedStartTime}</if>
<if test="plannedEndTime != null and plannedEndTime != ''"> and planned_end_time = #{plannedEndTime}</if>
<if test="experimentUseGoods != null and experimentUseGoods != ''"> and experiment_use_goods = #{experimentUseGoods}</if>
<if test="gradeIds != null">
and grade_id in
<foreach item="gradeId" collection="gradeIds" open="(" separator="," close=")">
#{gradeId}
</foreach>
</if>
</where>
order by create_time DESC
</select>
<select id="getExperimentList" parameterType="SchoolExperimentPlanVo" resultMap="SchoolExperimentPlanVoResult">
<include refid="selectSchoolExperimentPlanVo"/>
<where>
del_flag = '0'
<if test="sub != null and sub != ''"> and sub = #{sub}</if>
<if test="gradeId != null "> and grade_id = #{gradeId}</if>
<if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</if>
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="chapterContent != null and chapterContent != ''"> and chapter_content = #{chapterContent}</if>
<if test="plannedStartTime != null and plannedStartTime != ''"> and planned_start_time = #{plannedStartTime}</if>
<if test="plannedEndTime != null and plannedEndTime != ''"> and planned_end_time = #{plannedEndTime}</if>
<if test="experimentUseGoods != null and experimentUseGoods != ''"> and experiment_use_goods = #{experimentUseGoods}</if>
<if test="gradeIds != null"> and grade in (#{gradeIds})</if>
<if test="subs != null ">
and sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
</where>
order by create_time DESC
</select>
<select id="selectSchoolExperimentPlanById" parameterType="Long" resultMap="ExperimentPlanClassResult">
select a.id, a.sub, a.grade_id, a.grade, a.school_year, a.semester, a.experiment_classify, a.experiment_name, a.chapter_content, a.planned_start_time, a.planned_end_time, a.experiment_use_goods, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag,
b.id as sub_id, b.experiment_plan_id as sub_experiment_plan_id, b.class_id as sub_class_id, b.del_flag as sub_del_flag
b.id as sub_id, b.experiment_plan_id as sub_experiment_plan_id, b.class_id as sub_class_id, b.del_flag as sub_del_flag
from school_experiment_plan a
left join school_experiment_plan_class b on b.experiment_plan_id = a.id
where a.id = #{id}
</select>
<insert id="insertSchoolExperimentPlan" parameterType="SchoolExperimentPlan" useGeneratedKeys="true" keyProperty="id">
<insert id="insertSchoolExperimentPlan" parameterType="SchoolExperimentPlanVo" useGeneratedKeys="true" keyProperty="id">
insert into school_experiment_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sub != null">sub,</if>
......@@ -173,10 +204,9 @@
left join school_class_headmaster sch on sch.class_id = sc.id
left join school_grade_mentor sgm on sgm.grade_id = sg.id
WHERE
sg.del_flag = '0'
<if test="schoolYear != -1">and sg.school_year = #{schoolYear}</if>
<if test="userId != null">and scm.teacher_id = #{userId} or sch.teacher_id = #{userId} or sgm.teacher_id = #{userId}</if>
AND sg.del_flag = '0'
GROUP BY sg.id,sg.school_year,sg.grade_value,sg.grade_year,sg.grade_name
ORDER BY sg.grade_year DESC
</select>
......@@ -184,4 +214,35 @@
<select id="getSchoolClass" parameterType="Long" resultType="Map">
select id as classId,class_name as className from school_class WHERE grade_id = #{gradeId} and del_flag = '0'
</select>
<select id="countExperiment" parameterType="SchoolExperimentPlanVo" resultType="Map">
SELECT
ep.id as id, ep.grade_id as gradeId, ep.grade as grade, ep.school_year as schoolYear, ep.semester as semester, ep.experiment_name as experimentName, ep.sub as sub,
COUNT(epc.id) as totalClass,
(SELECT COUNT(tla.id) FROM school_teacher_lab_apply tla WHERE tla.del_flag = '0' AND tla.state = '1' AND tla.lab_class_year_id in (SELECT id FROM school_lab_class_year lcy WHERE lcy.del_flag = '0' AND lcy.experiment_plan_id = ep.id)) as completeClass
FROM
school_experiment_plan ep
LEFT JOIN school_experiment_plan_class epc ON ep.id = epc.experiment_plan_id AND epc.del_flag = '0'
WHERE
ep.del_flag = '0'
<if test="sub != null and sub != ''"> and ep.sub = #{sub}</if>
<if test="gradeId != null "> and ep.grade_id = #{gradeId}</if>
<if test="grade != null and grade != ''"> and ep.grade like concat('%', #{grade}, '%')</if>
<if test="experimentName != null and experimentName != ''"> and ep.experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="schoolYear != null and schoolYear != ''"> and ep.school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and ep.semester = #{semester}</if>
<if test="subs != null ">
and ep.sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
<if test="gradeIds != null">
and ep.grade_id in
<foreach item="gradeId" collection="gradeIds" open="(" separator="," close=")">
#{gradeId}
</foreach>
</if>
GROUP BY ep.id,ep.grade_id,ep.grade,ep.school_year,ep.semester,ep.experiment_name,ep.sub
</select>
</mapper>
\ No newline at end of file
......@@ -4,9 +4,10 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearMapper">
<resultMap type="SchoolLabClassYear" id="SchoolLabClassYearResult">
<resultMap type="SchoolLabClassYearVo" id="SchoolLabClassYearVoResult">
<result property="id" column="id" />
<result property="experimentPlanId" column="experiment_plan_id" />
<result property="experimentName" column="experiment_name" />
<result property="grade" column="grade" />
<result property="schoolYear" column="school_year" />
<result property="semester" column="semester" />
......@@ -27,7 +28,7 @@
<result property="delFlag" column="del_flag" />
</resultMap>
<resultMap id="SchoolLabClassYearSchoolLabClassYearRelationResult" type="SchoolLabClassYear" extends="SchoolLabClassYearResult">
<resultMap id="SchoolLabClassYearSchoolLabClassYearRelationResult" type="SchoolLabClassYearVo" extends="SchoolLabClassYearVoResult">
<collection property="schoolLabClassYearRelationList" notNullColumn="sub_id" javaType="java.util.List" resultMap="SchoolLabClassYearRelationResult" />
</resultMap>
......@@ -35,68 +36,99 @@
<result property="id" column="sub_id" />
<result property="labClassYearId" column="sub_lab_class_year_id" />
<result property="labId" column="sub_lab_id" />
<result property="labName" column="sub_lab_name" />
<result property="delFlag" column="sub_del_flag" />
</resultMap>
<sql id="selectSchoolLabClassYearVo">
select id, experiment_plan_id, grade, school_year, semester, sub, experiment_classify, planned_start_time, planned_end_time, chapter_content, experiment_use_goods, declare_state, apply_id, apply_name, apply_time, create_by, create_time, update_by, update_time, del_flag from school_lab_class_year
select id, experiment_plan_id, experiment_name, grade_id, grade, school_year, semester, sub, experiment_classify, planned_start_time, planned_end_time, chapter_content, experiment_use_goods, declare_state, apply_id, apply_name, apply_time, create_by, create_time, update_by, update_time, del_flag from school_lab_class_year
</sql>
<select id="selectSchoolLabClassYearList" parameterType="SchoolLabClassYear" resultMap="SchoolLabClassYearResult">
<select id="selectSchoolLabClassYearList" parameterType="SchoolLabClassYearVo" resultMap="SchoolLabClassYearVoResult">
<include refid="selectSchoolLabClassYearVo"/>
<where>
del_flag = '0'
<if test="experimentPlanId != null and experimentPlanId != ''"> and experiment_plan_id = #{experimentPlanId}</if>
<if test="grade != null and grade != ''"> and grade = #{grade}</if>
<if test="experimentPlanId != null "> and experiment_plan_id = #{experimentPlanId}</if>
<if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</if>
<if test="gradeId != null "> and grade_id = #{gradeId}</if>
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="sub != null and sub != ''"> and sub = #{sub}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="plannedStartTime != null "> and planned_start_time = #{plannedStartTime}</if>
<if test="plannedEndTime != null "> and planned_end_time = #{plannedEndTime}</if>
<if test="plannedStartTime != null and plannedEndTime != null">
and planned_start_time between #{plannedStartTime} and #{plannedEndTime}
and planned_end_time between #{plannedStartTime} and #{plannedEndTime}
</if>
<if test="chapterContent != null and chapterContent != ''"> and chapter_content = #{chapterContent}</if>
<if test="experimentUseGoods != null and experimentUseGoods != ''"> and experiment_use_goods = #{experimentUseGoods}</if>
<if test="declareState != null and declareState != ''"> and declare_state = #{declareState}</if>
<if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="gradeIds != null ">
and grade_id in
<foreach item="gradeId" collection="gradeIds" open="(" separator="," close=")">
#{gradeId}
</foreach>
</if>
</where>
order by create_time DESC
</select>
<select id="selectSchoolLabClassYearById" parameterType="Long" resultMap="SchoolLabClassYearSchoolLabClassYearRelationResult">
select a.id, a.experiment_plan_id, a.grade, a.school_year, a.semester, a.sub, a.experiment_classify, a.planned_start_time, a.planned_end_time, a.chapter_content, a.experiment_use_goods, a.declare_state, a.apply_id, a.apply_name, a.apply_time, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag,
b.id as sub_id, b.lab_class_year_id as sub_lab_class_year_id, b.lab_id as sub_lab_id, b.del_flag as sub_del_flag
from school_lab_class_year a
left join school_lab_class_year_relation b on b.lab_class_year_id = a.id
where a.id = #{id}
<select id="getLabClassYear" parameterType="SchoolLabClassYearVo" resultMap="SchoolLabClassYearVoResult">
<include refid="selectSchoolLabClassYearVo"/>
<where>
del_flag = '0' and declare_state != '0'
<if test="experimentPlanId != null"> and experiment_plan_id = #{experimentPlanId}</if>
<if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</if>
<if test="gradeId != null "> and grade_id = #{gradeId}</if>
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="sub != null and sub != ''"> and sub = #{sub}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="plannedStartTime != null and plannedEndTime != null">
and planned_start_time between #{plannedStartTime} and #{plannedEndTime}
and planned_end_time between #{plannedStartTime} and #{plannedEndTime}
</if>
<if test="chapterContent != null and chapterContent != ''"> and chapter_content = #{chapterContent}</if>
<if test="experimentUseGoods != null and experimentUseGoods != ''"> and experiment_use_goods = #{experimentUseGoods}</if>
<if test="declareState != null and declareState != ''"> and declare_state = #{declareState}</if>
<if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="subs != null ">
and sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
</where>
order by create_time DESC
</select>
<select id="classSituation" parameterType="ClassSituationVo" resultType="ClassSituationVo">
SELECT epc.class_id ,COUNT(ep.id) as count,lcy.experiment_plan_id labClassYearId FROM school_experiment_plan ep LEFT JOIN school_experiment_plan_class epc on ep.id=epc.experiment_plan_id
left join school_lab_class_year lcy on lcy.experiment_plan_id = ep.id
WHERE ep.del_flag=0 and epc.del_flag=0 AND ep.school_year = #{schoolYear} AND ep.semester=#{semester}
and ep.grade_id = #{gradeId}
GROUP BY epc.class_id
<select id="selectSchoolLabClassYearById" parameterType="Long" resultMap="SchoolLabClassYearVoResult">
select a.id, a.experiment_plan_id, a.experiment_name, a.grade_id, a.grade, a.school_year, a.semester, a.sub, a.experiment_classify, a.planned_start_time, a.planned_end_time, a.chapter_content, a.experiment_use_goods, a.declare_state, a.apply_id, a.apply_name, a.apply_time, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag
from school_lab_class_year a
where a.id = #{id}
</select>
<select id="getexperimentList" parameterType="ClassSituationVo" resultType="ClassSituationVo">
SELECT ep.id,ep.experiment_name,ep.school_year,ep.grade, ep.semester,COUNT(pc.class_id) as count FROM school_experiment_plan ep
LEFT JOIN school_experiment_plan_class pc on ep.id = pc.experiment_plan_id
WHERE ep.school_year = #{schoolYear} AND ep.semester =#{semester} AND ep.del_flag = 0 AND pc.del_flag=0
<if test="experimentName != null "> and ep.experiment_name like concat('%', #{experimentName}, '%') </if>
<if test="grade != null "> and ep.grade = #{grade}</if>
GROUP BY ep.id
<select id="getLabClassYearById" parameterType="Long" resultMap="SchoolLabClassYearSchoolLabClassYearRelationResult">
select a.id, a.experiment_plan_id,a.experiment_name, a.grade_id, a.grade, a.school_year, a.semester, a.sub, a.experiment_classify, a.planned_start_time, a.planned_end_time, a.chapter_content, a.experiment_use_goods, a.declare_state, a.apply_id, a.apply_name, a.apply_time, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag,
b.id as sub_id, b.lab_class_year_id as sub_lab_class_year_id, b.lab_id as sub_lab_id, b.lab_name as sub_lab_name, b.del_flag as sub_del_flag
from school_lab_class_year a
left join school_lab_class_year_relation b on b.lab_class_year_id = a.id
where a.id = #{id}
</select>
<insert id="insertSchoolLabClassYear" parameterType="SchoolLabClassYear" useGeneratedKeys="true" keyProperty="id">
insert into school_lab_class_year
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="experimentPlanId != null">experiment_plan_id,</if>
<if test="experimentName != null and experimentName != ''">experiment_name,</if>
<if test="grade != null">grade,</if>
<if test="gradeId != null">grade_id,</if>
<if test="schoolYear != null">school_year,</if>
<if test="semester != null">semester,</if>
<if test="sub != null">sub,</if>
......@@ -117,7 +149,9 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="experimentPlanId != null">#{experimentPlanId},</if>
<if test="experimentName != null and experimentName != ''">#{experimentName},</if>
<if test="grade != null">#{grade},</if>
<if test="gradeId != null">#{gradeId},</if>
<if test="schoolYear != null">#{schoolYear},</if>
<if test="semester != null">#{semester},</if>
<if test="sub != null">#{sub},</if>
......@@ -142,7 +176,9 @@
update school_lab_class_year
<trim prefix="SET" suffixOverrides=",">
<if test="experimentPlanId != null">experiment_plan_id = #{experimentPlanId},</if>
<if test="experimentName != null and experimentName != ''">experiment_name = #{experimentName},</if>
<if test="grade != null">grade = #{grade},</if>
<if test="gradeId != null">grade_id = #{gradeId},</if>
<if test="schoolYear != null">school_year = #{schoolYear},</if>
<if test="semester != null">semester = #{semester},</if>
<if test="sub != null">sub = #{sub},</if>
......@@ -177,19 +213,65 @@
<update id="deleteSchoolLabClassYearRelationByLabClassYearIds" parameterType="String">
update school_lab_class_year_relation set del_flag = '1' where lab_class_year_id in
<foreach item="labClassYearId" collection="array" open="(" separator="," close=")">
#{labClassYearId}
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="deleteSchoolLabClassYearRelationByLabClassYearId" parameterType="Long">
update school_lab_class_year_relation set del_flag = '1' where lab_class_year_id = #{labClassYearId}
</update>
<delete id="deleteSchoolLabClassYearRelationByLabClassYearId" parameterType="Long">
delete from school_lab_class_year_relation where lab_class_year_id = #{id}
</delete>
<insert id="batchSchoolLabClassYearRelation">
insert into school_lab_class_year_relation( id, lab_class_year_id, lab_id, del_flag) values
insert into school_lab_class_year_relation( id, lab_class_year_id, lab_id, lab_name) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.labClassYearId}, #{item.labId}, #{item.delFlag})
( #{item.id}, #{item.labClassYearId}, #{item.labId},#{item.labName})
</foreach>
</insert>
<select id="seletLabId" resultType="Long">
select lab_id from school_lab_class_year_relation where del_flag = '0' and lab_class_year_id in
<foreach item="labClassYearId" collection="labClassYearIds" open="(" separator="," close=")">
#{labClassYearId}
</foreach>
</select>
<select id="getTeacherLabList" parameterType="SchoolLabClassYearVo" resultMap="SchoolLabClassYearVoResult">
<include refid="selectSchoolLabClassYearVo"/>
WHERE del_flag = '0'
and experiment_plan_id IN
(SELECT DISTINCT experiment_plan_id FROM school_experiment_plan_class
WHERE del_flag = '0' and class_id in
(SELECT class_id FROM school_class_mentor
WHERE del_flag = '0' and course_id in (6,8,9) and teacher_id = #{applyId}))
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="subs != null ">
and sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
<if test="declareState != null and declareState != ''"> and declare_state = #{declareState}</if>
</select>
<select id="classSituation" parameterType="ClassSituationVo" resultType="ClassSituationVo">
SELECT epc.class_id ,COUNT(ep.id) as count,lcy.experiment_plan_id labClassYearId FROM school_experiment_plan ep LEFT JOIN school_experiment_plan_class epc on ep.id=epc.experiment_plan_id
left join school_lab_class_year lcy on lcy.experiment_plan_id = ep.id
WHERE ep.del_flag=0 and epc.del_flag=0 AND ep.school_year = #{schoolYear} AND ep.semester=#{semester}
and ep.grade_id = #{gradeId}
GROUP BY epc.class_id
</select>
<select id="getexperimentList" parameterType="ClassSituationVo" resultType="ClassSituationVo">
SELECT ep.id,ep.experiment_name,ep.school_year,ep.grade, ep.semester,COUNT(pc.class_id) as count FROM school_experiment_plan ep
LEFT JOIN school_experiment_plan_class pc on ep.id = pc.experiment_plan_id
WHERE ep.school_year = #{schoolYear} AND ep.semester =#{semester} AND ep.del_flag = 0 AND pc.del_flag=0
<if test="experimentName != null "> and ep.experiment_name like concat('%', #{experimentName}, '%') </if>
<if test="grade != null "> and ep.grade = #{grade}</if>
GROUP BY ep.id
</select>
</mapper>
\ No newline at end of file
......@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabCompetitionMapper">
<resultMap type="SchoolLabCompetition" id="SchoolLabCompetitionResult">
<resultMap type="SchoolLabCompetitionVo" id="SchoolLabCompetitionVoResult">
<result property="id" column="id" />
<result property="schoolYear" column="school_year" />
<result property="teacherId" column="teacher_id" />
......@@ -27,7 +27,7 @@
select id, school_year, teacher_id, teacher_name, entry_subject, competition_name, competition_type, competition_level, remark1, remark2, remark3, create_by, create_time, update_by, update_time, del_flag from school_lab_competition
</sql>
<select id="selectSchoolLabCompetitionList" parameterType="SchoolLabCompetition" resultMap="SchoolLabCompetitionResult">
<select id="selectSchoolLabCompetitionList" parameterType="SchoolLabCompetitionVo" resultMap="SchoolLabCompetitionVoResult">
<include refid="selectSchoolLabCompetitionVo"/>
<where>
del_flag = '0'
......@@ -42,14 +42,15 @@
<if test="remark2 != null and remark2 != ''"> and remark2 = #{remark2}</if>
<if test="remark3 != null and remark3 != ''"> and remark3 = #{remark3}</if>
</where>
order by create_time DESC
</select>
<select id="selectSchoolLabCompetitionById" parameterType="Long" resultMap="SchoolLabCompetitionResult">
<select id="selectSchoolLabCompetitionById" parameterType="Long" resultMap="SchoolLabCompetitionVoResult">
<include refid="selectSchoolLabCompetitionVo"/>
where id = #{id}
</select>
<insert id="insertSchoolLabCompetition" parameterType="SchoolLabCompetition" useGeneratedKeys="true" keyProperty="id">
<insert id="insertSchoolLabCompetition" parameterType="SchoolLabCompetitionVo" useGeneratedKeys="true" keyProperty="id">
insert into school_lab_competition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="schoolYear != null">school_year,</if>
......@@ -87,7 +88,7 @@
</trim>
</insert>
<update id="updateSchoolLabCompetition" parameterType="SchoolLabCompetition">
<update id="updateSchoolLabCompetition" parameterType="SchoolLabCompetitionVo">
update school_lab_competition
<trim prefix="SET" suffixOverrides=",">
<if test="schoolYear != null">school_year = #{schoolYear},</if>
......@@ -119,4 +120,22 @@
#{id}
</foreach>
</update>
<insert id="batchSchoolAccessory">
insert into school_accessory( id, business_id, module_name, accessory_type, accessory_url, accessory_name, create_by,create_time) values
<foreach item="item" index="index" collection="list" separator=",">
( 0, #{item.businessId}, #{item.moduleName}, #{item.accessoryType}, #{item.accessoryUrl}, #{item.accessoryName}, #{item.createBy}, #{item.createTime})
</foreach>
</insert>
<delete id="deleteSchoolAccessoryByBusinessIds" parameterType="String">
delete from school_accessory where accessory_type = "证书照片" and business_id in
<foreach item="businessId" collection="array" open="(" separator="," close=")">
#{businessId}
</foreach>
</delete>
<delete id="deleteSchoolAccessoryByBusinessId" parameterType="Long">
delete from school_accessory where accessory_type = "证书照片" and business_id = #{businessId}
</delete>
</mapper>
\ No newline at end of file
......@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabMapper">
<resultMap type="SchoolLab" id="SchoolLabResult">
<resultMap type="SchoolLabVo" id="SchoolLabVoResult">
<result property="id" column="id" />
<result property="labName" column="lab_name" />
<result property="labSub" column="lab_sub" />
......@@ -23,7 +23,7 @@
select id, lab_name, lab_sub, in_charge_id, in_charge_name, lab_state, lab_use_goods, create_by, create_time, update_by, update_time, del_flag from school_lab
</sql>
<select id="selectSchoolLabList" parameterType="SchoolLab" resultMap="SchoolLabResult">
<select id="selectSchoolLabList" parameterType="SchoolLabVo" resultMap="SchoolLabVoResult">
<include refid="selectSchoolLabVo"/>
<where>
del_flag = '0'
......@@ -33,10 +33,17 @@
<if test="inChargeName != null and inChargeName != ''"> and in_charge_name like concat('%', #{inChargeName}, '%')</if>
<if test="labState != null and labState != ''"> and lab_state = #{labState}</if>
<if test="labUseGoods != null and labUseGoods != ''"> and lab_use_goods = #{labUseGoods}</if>
<if test="labSubs != null">
and lab_sub in
<foreach item="labSub" collection="labSubs" open="(" separator="," close=")">
#{labSub}
</foreach>
</if>
</where>
order by create_time DESC
</select>
<select id="selectSchoolLabById" parameterType="Long" resultMap="SchoolLabResult">
<select id="selectSchoolLabById" parameterType="Long" resultMap="SchoolLabVoResult">
<include refid="selectSchoolLabVo"/>
where id = #{id}
</select>
......@@ -112,6 +119,7 @@
r.role_key = "phy_lab_admin"
or r.role_key = "che_lab_admin"
or r.role_key = "bio_lab_admin"
group by u.user_id,u.user_name
</select>
<select id="getLabAdmin" parameterType="String" resultType="Map">
......
......@@ -4,19 +4,18 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherExperimentApplyMapper">
<resultMap type="SchoolTeacherExperimentApply" id="SchoolTeacherExperimentApplyResult">
<resultMap type="SchoolTeacherExperimentApplyVo" id="SchoolTeacherExperimentApplyVoResult">
<result property="id" column="id" />
<result property="sub" column="sub" />
<result property="gradeId" column="grade_id" />
<result property="grade" column="grade" />
<result property="schoolYear" column="school_year" />
<result property="semester" column="semester" />
<result property="plannedTime" column="planned_time" />
<result property="plannedStartTime" column="planned_start_time" />
<result property="plannedEndTime" column="planned_end_time" />
<result property="experimentName" column="experiment_name" />
<result property="experimentClassify" column="experiment_classify" />
<result property="experimentUseGoods" column="experiment_use_goods" />
<result property="labId" column="lab_id" />
<result property="labName" column="lab_name" />
<result property="declareState" column="declare_state" />
<result property="applyId" column="apply_id" />
<result property="applyName" column="apply_name" />
......@@ -29,10 +28,10 @@
</resultMap>
<sql id="selectSchoolTeacherExperimentApplyVo">
select id, sub, grade_id, grade, school_year, semester, planned_time, experiment_name, experiment_classify, experiment_use_goods, lab_id, lab_name, declare_state, apply_id, apply_name, apply_time, create_by, create_time, update_by, update_time, del_flag from school_teacher_experiment_apply
select id, sub, grade_id, grade, school_year, semester, planned_start_time, planned_end_time, experiment_name, experiment_classify, experiment_use_goods, declare_state, apply_id, apply_name, apply_time, create_by, create_time, update_by, update_time, del_flag from school_teacher_experiment_apply
</sql>
<select id="selectSchoolTeacherExperimentApplyList" parameterType="SchoolTeacherExperimentApply" resultMap="SchoolTeacherExperimentApplyResult">
<select id="selectSchoolTeacherExperimentApplyList" parameterType="SchoolTeacherExperimentApplyVo" resultMap="SchoolTeacherExperimentApplyVoResult">
<include refid="selectSchoolTeacherExperimentApplyVo"/>
<where>
del_flag = '0'
......@@ -41,25 +40,32 @@
<if test="grade != null and grade != ''"> and grade = #{grade}</if>
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="plannedTime != null and plannedTime != ''"> and planned_time = #{plannedTime}</if>
<if test="plannedStartTime != null and plannedEndTime != null">
and planned_start_time between #{plannedStartTime} and #{plannedEndTime}
and planned_end_time between #{plannedStartTime} and #{plannedEndTime}
</if>
<if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="experimentUseGoods != null and experimentUseGoods != ''"> and experiment_use_goods = #{experimentUseGoods}</if>
<if test="labId != null and labId != ''"> and lab_id = #{labId}</if>
<if test="labName != null and labName != ''"> and lab_name like concat('%', #{labName}, '%')</if>
<if test="declareState != null and declareState != ''"> and declare_state = #{declareState}</if>
<if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="subs != null ">
and sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
</where>
</select>
<select id="selectSchoolTeacherExperimentApplyById" parameterType="Long" resultMap="SchoolTeacherExperimentApplyResult">
<select id="selectSchoolTeacherExperimentApplyById" parameterType="Long" resultMap="SchoolTeacherExperimentApplyVoResult">
<include refid="selectSchoolTeacherExperimentApplyVo"/>
where id = #{id}
</select>
<insert id="insertSchoolTeacherExperimentApply" parameterType="SchoolTeacherExperimentApply" useGeneratedKeys="true" keyProperty="id">
<insert id="insertSchoolTeacherExperimentApply" parameterType="SchoolTeacherExperimentApplyVo" useGeneratedKeys="true" keyProperty="id">
insert into school_teacher_experiment_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sub != null">sub,</if>
......@@ -67,12 +73,11 @@
<if test="grade != null">grade,</if>
<if test="schoolYear != null">school_year,</if>
<if test="semester != null">semester,</if>
<if test="plannedTime != null">planned_time,</if>
<if test="plannedStartTime != null">planned_start_time,</if>
<if test="plannedEndTime != null">planned_end_time,</if>
<if test="experimentName != null">experiment_name,</if>
<if test="experimentClassify != null">experiment_classify,</if>
<if test="experimentUseGoods != null">experiment_use_goods,</if>
<if test="labId != null">lab_id,</if>
<if test="labName != null">lab_name,</if>
<if test="declareState != null">declare_state,</if>
<if test="applyId != null">apply_id,</if>
<if test="applyName != null">apply_name,</if>
......@@ -89,12 +94,11 @@
<if test="grade != null">#{grade},</if>
<if test="schoolYear != null">#{schoolYear},</if>
<if test="semester != null">#{semester},</if>
<if test="plannedTime != null">#{plannedTime},</if>
<if test="plannedStartTime != null">#{plannedStartTime},</if>
<if test="plannedEndTime != null">#{plannedEndTime},</if>
<if test="experimentName != null">#{experimentName},</if>
<if test="experimentClassify != null">#{experimentClassify},</if>
<if test="experimentUseGoods != null">#{experimentUseGoods},</if>
<if test="labId != null">#{labId},</if>
<if test="labName != null">#{labName},</if>
<if test="declareState != null">#{declareState},</if>
<if test="applyId != null">#{applyId},</if>
<if test="applyName != null">#{applyName},</if>
......@@ -107,7 +111,7 @@
</trim>
</insert>
<update id="updateSchoolTeacherExperimentApply" parameterType="SchoolTeacherExperimentApply">
<update id="updateSchoolTeacherExperimentApply" parameterType="SchoolTeacherExperimentApplyVo">
update school_teacher_experiment_apply
<trim prefix="SET" suffixOverrides=",">
<if test="sub != null">sub = #{sub},</if>
......@@ -115,12 +119,11 @@
<if test="grade != null">grade = #{grade},</if>
<if test="schoolYear != null">school_year = #{schoolYear},</if>
<if test="semester != null">semester = #{semester},</if>
<if test="plannedTime != null">planned_time = #{plannedTime},</if>
<if test="plannedStartTime != null">planned_start_time = #{plannedStartTime},</if>
<if test="plannedEndTime != null">planned_end_time = #{plannedEndTime},</if>
<if test="experimentName != null">experiment_name = #{experimentName},</if>
<if test="experimentClassify != null">experiment_classify = #{experimentClassify},</if>
<if test="experimentUseGoods != null">experiment_use_goods = #{experimentUseGoods},</if>
<if test="labId != null">lab_id = #{labId},</if>
<if test="labName != null">lab_name = #{labName},</if>
<if test="declareState != null">declare_state = #{declareState},</if>
<if test="applyId != null">apply_id = #{applyId},</if>
<if test="applyName != null">apply_name = #{applyName},</if>
......@@ -144,4 +147,22 @@
#{id}
</foreach>
</update>
<update id="deleteSchoolTeacherExperimentApplyLabsIds" parameterType="String">
update school_teacher_experiment_apply_labs set del_flag = '1' where teacher_experiment_apply_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteSchoolTeacherExperimentApplyLabsId" parameterType="Long">
delete from school_teacher_experiment_apply_labs where teacher_experiment_apply_id = #{id}
</delete>
<insert id="batchSchoolTeacherExperimentApplyLabs">
insert into school_teacher_experiment_apply_labs( id, teacher_experiment_apply_id, lab_id, lab_name) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.teacherExperimentApplyId}, #{item.labId},#{item.labName})
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -4,11 +4,14 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper">
<resultMap type="SchoolTeacherLabApply" id="SchoolTeacherLabApplyResult">
<resultMap type="SchoolTeacherLabApplyVo" id="SchoolTeacherLabApplyVoResult">
<result property="id" column="id" />
<result property="labClassYearId" column="lab_class_year_id" />
<result property="experimentClassify" column="experiment_classify" />
<result property="experimentPlanId" column="experiment_plan_id" />
<result property="experimentName" column="experiment_name" />
<result property="sub" column="sub" />
<result property="gradeId" column="grade_id" />
<result property="grade" column="grade" />
<result property="schoolYear" column="school_year" />
<result property="semester" column="semester" />
......@@ -24,6 +27,7 @@
<result property="applyName" column="apply_name" />
<result property="applyTime" column="apply_time" />
<result property="remark" column="remark" />
<result property="state" column="state" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
......@@ -32,23 +36,25 @@
</resultMap>
<sql id="selectSchoolTeacherLabApplyVo">
select id, lab_class_year_id, experiment_classify, sub, grade,state, school_year, semester, class_id, class_name, chapter_content, experiment_time, section, lab_id, lab_name, apply_state, apply_id, apply_name, apply_time, remark, create_by, create_time, update_by, update_time, del_flag from school_teacher_lab_apply
select id, lab_class_year_id, experiment_classify, experiment_plan_id, experiment_name, sub, grade_id, grade, school_year, semester, class_id, class_name, chapter_content, experiment_time, section, lab_id, lab_name, apply_state, apply_id, apply_name, apply_time, remark,state, create_by, create_time, update_by, update_time, del_flag from school_teacher_lab_apply
</sql>
<select id="selectSchoolTeacherLabApplyList" parameterType="SchoolTeacherLabApply" resultMap="SchoolTeacherLabApplyResult">
<select id="selectSchoolTeacherLabApplyList" parameterType="SchoolTeacherLabApplyVo" resultMap="SchoolTeacherLabApplyVoResult">
<include refid="selectSchoolTeacherLabApplyVo"/>
<where>
del_flag = '0'
<if test="labClassYearId != null and labClassYearId != ''"> and lab_class_year_id = #{labClassYearId}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="sub != null and sub != ''"> and sub = #{sub}</if>
<if test="grade != null and grade != ''"> and grade = #{grade}</if>
<if test="gradeId != null"> and grade_id = #{gradeId}</if>
<if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</if>
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="classId != null and classId != ''"> and class_id = #{classId}</if>
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
<if test="chapterContent != null and chapterContent != ''"> and chapter_content = #{chapterContent}</if>
<if test="experimentTime != null "> and experiment_time = #{experimentTime}</if>
<if test="startTime != null and endTime != null "> and experiment_time between #{startTime} and #{endTime}</if>
<if test="section != null and section != ''"> and section = #{section}</if>
<if test="labId != null "> and lab_id = #{labId}</if>
<if test="labName != null and labName != ''"> and lab_name like concat('%', #{labName}, '%')</if>
......@@ -56,35 +62,45 @@
<if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="state != null "> and state = #{state}</if>
<if test="subs != null ">
and sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
</where>
order by create_time DESC
</select>
<select id="selectSchoolTeacherLabApplyById" parameterType="Long" resultMap="SchoolTeacherLabApplyResult">
<select id="selectSchoolTeacherLabApplyById" parameterType="Long" resultMap="SchoolTeacherLabApplyVoResult">
<include refid="selectSchoolTeacherLabApplyVo"/>
where id = #{id}
</select>
<insert id="insertSchoolTeacherLabApply" parameterType="SchoolTeacherLabApply" useGeneratedKeys="true" keyProperty="id">
<insert id="insertSchoolTeacherLabApply" parameterType="SchoolTeacherLabApplyVo" useGeneratedKeys="true" keyProperty="id">
insert into school_teacher_lab_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="labClassYearId != null">lab_class_year_id,</if>
<if test="experimentClassify != null">experiment_classify,</if>
<if test="experimentPlanId != null">experiment_plan_id,</if>
<if test="experimentName != null and experimentName != ''">experiment_name,</if>
<if test="sub != null">sub,</if>
<if test="gradeId != null">grade_id,</if>
<if test="grade != null">grade,</if>
<if test="schoolYear != null">school_year,</if>
<if test="semester != null">semester,</if>
<if test="classId != null">class_id,</if>
<if test="className != null">class_name,</if>
<if test="classId != null">class_id,class_name,</if>
<if test="chapterContent != null">chapter_content,</if>
<if test="experimentTime != null">experiment_time,</if>
<if test="section != null">section,</if>
<if test="labId != null">lab_id,</if>
<if test="labName != null">lab_name,</if>
<if test="labId != null">lab_id,lab_name,</if>
<if test="applyState != null">apply_state,</if>
<if test="applyId != null">apply_id,</if>
<if test="applyName != null">apply_name,</if>
<if test="applyTime != null">apply_time,</if>
<if test="remark != null">remark,</if>
<if test="state != null and state != ''">state,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
......@@ -94,22 +110,24 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="labClassYearId != null">#{labClassYearId},</if>
<if test="experimentClassify != null">#{experimentClassify},</if>
<if test="experimentPlanId != null">#{experimentPlanId},</if>
<if test="experimentName != null and experimentName != ''">#{experimentName},</if>
<if test="sub != null">#{sub},</if>
<if test="gradeId != null">#{gradeId},</if>
<if test="grade != null">#{grade},</if>
<if test="schoolYear != null">#{schoolYear},</if>
<if test="semester != null">#{semester},</if>
<if test="classId != null">#{classId},</if>
<if test="className != null">#{className},</if>
<if test="classId != null">#{classId},(select class_name from school_class where id = #{classId}),</if>
<if test="chapterContent != null">#{chapterContent},</if>
<if test="experimentTime != null">#{experimentTime},</if>
<if test="section != null">#{section},</if>
<if test="labId != null">#{labId},</if>
<if test="labName != null">#{labName},</if>
<if test="labId != null">#{labId},(select lab_name from school_lab where id = #{labId}),</if>
<if test="applyState != null">#{applyState},</if>
<if test="applyId != null">#{applyId},</if>
<if test="applyName != null">#{applyName},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="remark != null">#{remark},</if>
<if test="state != null and state != ''">#{state},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
......@@ -118,50 +136,29 @@
</trim>
</insert>
<select id="selectCompletedQuantity" resultType="Integer" parameterType="ClassSituationVo">
SELECT count(0) FROM school_teacher_lab_apply lp WHERE lp.school_year = #{schoolYear} AND lp.semester = #{semester} AND lp.state=1 AND lp.del_flag=0
<if test="id != null "> and lp.lab_class_year_id = #{id}</if>
</select>
<select id="selectTeacherList" resultType="Map" parameterType="SchoolTeacherLabApply">
SELECT apply_name applyName,school_year schoolYear,
COUNT(CASE WHEN experiment_classify = 1 THEN experiment_classify END) as fzcount,
COUNT(CASE WHEN experiment_classify = 2 THEN experiment_classify END) as sycount,
COUNT(CASE WHEN experiment_classify = 3 THEN experiment_classify END) as sjcount,
COUNT(experiment_classify) count
FROM school_teacher_lab_apply WHERE
school_year = #{schoolYear} AND semester = #{semester}
<if test="applyName != null and applyName != ''">
AND apply_name like concat('%', #{applyName}, '%')
</if>
GROUP BY apply_name
</select>
<update id="updateSchoolTeacherLabApply" parameterType="SchoolTeacherLabApply">
<update id="updateSchoolTeacherLabApply" parameterType="SchoolTeacherLabApplyVo">
update school_teacher_lab_apply
<trim prefix="SET" suffixOverrides=",">
<if test="labClassYearId != null">lab_class_year_id = #{labClassYearId},</if>
<if test="experimentClassify != null">experiment_classify = #{experimentClassify},</if>
<if test="experimentPlanId != null">experiment_plan_id = #{experimentPlanId},</if>
<if test="experimentName != null and experimentName != ''">experiment_name = #{experimentName},</if>
<if test="sub != null">sub = #{sub},</if>
<if test="gradeId != null">grade_id = #{gradeId},</if>
<if test="grade != null">grade = #{grade},</if>
<if test="schoolYear != null">school_year = #{schoolYear},</if>
<if test="semester != null">semester = #{semester},</if>
<if test="classId != null">class_id = #{classId},</if>
<if test="className != null">class_name = #{className},</if>
<if test="classId != null">class_id = #{classId},class_name = (select class_name from school_class where id = #{classId}),</if>
<if test="chapterContent != null">chapter_content = #{chapterContent},</if>
<if test="experimentTime != null">experiment_time = #{experimentTime},</if>
<if test="section != null">section = #{section},</if>
<if test="labId != null">lab_id = #{labId},</if>
<if test="labName != null">lab_name = #{labName},</if>
<if test="labId != null">lab_id = #{labId},lab_name = (select lab_name from school_lab where id = #{labId}),</if>
<if test="applyState != null">apply_state = #{applyState},</if>
<if test="applyId != null">apply_id = #{applyId},</if>
<if test="applyName != null">apply_name = #{applyName},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="state != null and state != ''">state = #{state},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
......@@ -181,4 +178,135 @@
#{id}
</foreach>
</update>
<delete id="deleteSchoolAccessoryByBusinessIds" parameterType="String">
delete from school_accessory where accessory_type = "教师实验室附件" and business_id in
<foreach item="businessId" collection="array" open="(" separator="," close=")">
#{businessId}
</foreach>
</delete>
<delete id="deleteSchoolAccessoryByBusinessId" parameterType="Long">
delete from school_accessory where accessory_type = "教师实验室附件" and business_id = #{businessId}
</delete>
<select id="getTeacherClass" parameterType="SchoolTeacherLabApplyVo" resultType="Map">
SELECT cm.class_id as classId,( SELECT c.class_name FROM school_class c WHERE c.id = cm.class_id ) AS className
FROM
school_class_mentor cm
WHERE
cm.del_flag = '0'
AND cm.teacher_id = #{teacherId}
AND cm.course_id IN ( "6", "8", "9" )
AND cm.class_id IN ( SELECT class_id FROM school_experiment_plan_class WHERE del_flag = '0' AND experiment_plan_id = #{experimentPlanId})
</select>
<select id="getTeacherClassAll" parameterType="SchoolTeacherLabApplyVo" resultType="Map">
SELECT epc.class_id as classId,( SELECT c.class_name FROM school_class c WHERE c.id = epc.class_id ) AS className
FROM
school_experiment_plan_class epc
WHERE
epc.del_flag = '0'
AND epc.experiment_plan_id = #{experimentPlanId}
</select>
<insert id="batchSchoolAccessory">
insert into school_accessory( id, business_id, module_name, accessory_type, accessory_url, accessory_name, create_by,create_time) values
<foreach item="item" index="index" collection="list" separator=",">
( 0, #{item.businessId}, #{item.moduleName}, #{item.accessoryType}, #{item.accessoryUrl}, #{item.accessoryName}, #{item.createBy}, #{item.createTime})
</foreach>
</insert>
<select id="getClassDetails" parameterType="SchoolTeacherLabApplyVo" resultType="Map">
SELECT
tla.id as id,
tla.experiment_classify as experimentClassify,
tla.class_id as classId,
c.class_name as className,
tla.experiment_time as experimentTime,
tla.section as section,
tla.state as state
FROM
school_teacher_lab_apply tla
LEFT JOIN school_class c on tla.class_id = c.id
WHERE
tla.experiment_plan_id = #{experimentPlanId} AND tla.del_flag = '0'
<if test="experimentClassify != null and experimentClassify != ''"> and tla.experiment_classify = #{experimentClassify}</if>
<if test="classId != null and classId != ''"> and tla.class_id = #{classId}</if>
<if test="className != null and className != ''"> and c.class_name like concat('%', #{className}, '%')</if>
<if test="startTime != null and endTime != null "> and tla.experiment_time between #{startTime} and #{endTime}</if>
</select>
<select id="getCountTeacher" parameterType="SchoolTeacherLabApplyVo" resultType="Map">
SELECT apply_name applyName,school_year schoolYear,
COUNT(CASE WHEN experiment_classify = 1 THEN experiment_classify END) as fzcount,
COUNT(CASE WHEN experiment_classify = 2 THEN experiment_classify END) as sycount,
COUNT(CASE WHEN experiment_classify = 3 THEN experiment_classify END) as sjcount,
COUNT(CASE WHEN state = 1 THEN state END) ywccount
FROM school_teacher_lab_apply WHERE school_year = #{schoolYear} AND semester = #{semester}
<if test="applyName != null and applyName != ''">
AND apply_name like concat('%', #{applyName}, '%')
</if>
GROUP BY apply_name
</select>
<select id="gradeCountClass" parameterType="SchoolTeacherLabApplyVo" resultType="Map">
SELECT
ep.grade_id as gradeId,
ep.grade as grade,
ep.school_year as schoolYear,
ep.semester as semester,
epc.class_id as classId,
c.class_name as className,
COUNT( epc.class_id ) as jhsys,
( SELECT COUNT( CASE WHEN state = 1 THEN state END ) FROM school_teacher_lab_apply WHERE del_flag = '0' AND class_id = epc.class_id and grade_id = ep.grade_id ) as ywcsys
FROM
school_experiment_plan ep
LEFT JOIN school_experiment_plan_class epc ON ep.id = epc.experiment_plan_id
LEFT JOIN school_class c ON epc.class_id = c.id
WHERE
ep.del_flag = '0' and epc.del_flag = '0'
<if test="semester != null and semester != ''">and ep.semester = #{semester}</if>
<if test="schoolYear != null and schoolYear != ''">and ep.school_year = #{schoolYear}</if>
<if test="gradeId != null">and ep.grade_id = #{gradeId}</if>
<if test="classId != null and classId != ''"> and epc.class_id = #{classId}</if>
<if test="className != null and className != ''"> and c.class_name like concat('%', #{className}, '%')</if>
<if test="gradeIds != null">
and ep.grade_id in
<foreach item="gradeId" collection="gradeIds" open="(" separator="," close=")">
#{gradeId}
</foreach>
</if>
GROUP BY ep.grade_id, ep.grade, ep.school_year, ep.semester, epc.class_id, c.class_name
</select>
<select id="getGradeClassDetails" parameterType="SchoolTeacherLabApplyVo" resultMap="SchoolTeacherLabApplyVoResult">
<include refid="selectSchoolTeacherLabApplyVo"/>
WHERE del_flag = '0'
<if test="semester != null and semester != ''">and semester = #{semester}</if>
<if test="schoolYear != null and schoolYear != ''">and school_year = #{schoolYear}</if>
<if test="gradeId != null">and grade_id = #{gradeId}</if>
<if test="classId != null and classId != ''"> and class_id = #{classId}</if>
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
</select>
<select id="selectCompletedQuantity" resultType="Integer" parameterType="ClassSituationVo">
SELECT count(0) FROM school_teacher_lab_apply lp WHERE lp.school_year = #{schoolYear} AND lp.semester = #{semester} AND lp.state=1 AND lp.del_flag=0
<if test="id != null "> and lp.lab_class_year_id = #{id}</if>
</select>
<select id="selectTeacherList" resultType="Map" parameterType="SchoolTeacherLabApply">
SELECT apply_name applyName,school_year schoolYear,
COUNT(CASE WHEN experiment_classify = 1 THEN experiment_classify END) as fzcount,
COUNT(CASE WHEN experiment_classify = 2 THEN experiment_classify END) as sycount,
COUNT(CASE WHEN experiment_classify = 3 THEN experiment_classify END) as sjcount,
COUNT(experiment_classify) count
FROM school_teacher_lab_apply WHERE
school_year = #{schoolYear} AND semester = #{semester}
<if test="applyName != null and applyName != ''">
AND apply_name like concat('%', #{applyName}, '%')
</if>
GROUP BY apply_name
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment