班级信息bug和月计划

This commit is contained in:
paidaxing444 2020-08-18 18:51:45 +08:00
parent 343046356f
commit 7c5ac8e992
17 changed files with 1117 additions and 30 deletions

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询主题整合月计划列表
export function listMonthplan(query) {
return request({
url: '/benyi/thememonthplan/list',
method: 'get',
params: query
})
}
// 查询主题整合月计划详细
export function getMonthplan(id) {
return request({
url: '/benyi/thememonthplan/' + id,
method: 'get'
})
}
// 新增主题整合月计划
export function addMonthplan(data) {
return request({
url: '/benyi/thememonthplan',
method: 'post',
data: data
})
}
// 修改主题整合月计划
export function updateMonthplan(data) {
return request({
url: '/benyi/thememonthplan',
method: 'put',
data: data
})
}
// 删除主题整合月计划
export function delMonthplan(id) {
return request({
url: '/benyi/thememonthplan/' + id,
method: 'delete'
})
}
// 导出主题整合月计划
export function exportMonthplan(query) {
return request({
url: '/benyi/thememonthplan/export',
method: 'get',
params: query
})
}

View File

@ -43,6 +43,14 @@ export function delClass(bjbh) {
})
}
// 清空班级教师信息
export function delJsClass(bjbh) {
return request({
url: '/system/class/deljs/' + bjbh,
method: 'delete'
})
}
// 导出班级信息
export function exportClass(query) {
return request({

View File

@ -0,0 +1,312 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="计划名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入计划名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属班级" prop="classid">
<el-input
v-model="queryParams.classid"
placeholder="请输入所属班级"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="学年学期" prop="xnxq">
<el-input
v-model="queryParams.xnxq"
placeholder="请输入学年学期"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划月份" prop="month">
<el-input
v-model="queryParams.month"
placeholder="请输入计划月份"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</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"
v-hasPermi="['benyi:thememonthplan:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['benyi:thememonthplan:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['benyi:thememonthplan:remove']"
>删除</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="monthplanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="计划名称" align="center" prop="name" />
<el-table-column label="所属班级" align="center" prop="classid" />
<el-table-column label="学年学期" align="center" prop="xnxq" />
<el-table-column label="计划月份" align="center" prop="month" />
<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)"
v-hasPermi="['benyi:thememonthplan:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['benyi:thememonthplan:remove']"
>删除</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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="计划名称" prop="name">
<el-input v-model="form.name" placeholder="请输入计划名称" />
</el-form-item>
<el-form-item label="所属班级" prop="classid">
<el-input v-model="form.classid" placeholder="请输入所属班级" />
</el-form-item>
<el-form-item label="学年学期" prop="xnxq">
<el-input v-model="form.xnxq" placeholder="请输入学年学期" />
</el-form-item>
<el-form-item label="计划月份" prop="month">
<el-input v-model="form.month" placeholder="请输入计划月份" />
</el-form-item>
<el-form-item label="本月主题" prop="themes">
<el-input v-model="form.themes" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="本月自定义主题" prop="selfthemes">
<el-input v-model="form.selfthemes" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="家长支持" prop="support">
<el-input v-model="form.support" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" type="textarea" 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 {
listMonthplan,
getMonthplan,
delMonthplan,
addMonthplan,
updateMonthplan,
} from "@/api/benyi/thememonthplan";
export default {
name: "Monthplan",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
total: 0,
//
monthplanList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
classid: undefined,
xnxq: undefined,
month: undefined,
themes: undefined,
selfthemes: undefined,
support: undefined,
remarks: undefined,
createuserid: undefined,
},
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询主题整合月计划列表 */
getList() {
this.loading = true;
listMonthplan(this.queryParams).then((response) => {
this.monthplanList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
name: undefined,
classid: undefined,
xnxq: undefined,
month: undefined,
themes: undefined,
selfthemes: undefined,
support: undefined,
remarks: undefined,
createuserid: undefined,
createTime: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
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 id = row.id || this.ids;
getMonthplan(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改主题整合月计划";
});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != undefined) {
updateMonthplan(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addMonthplan(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(
'是否确认删除主题整合月计划编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delMonthplan(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
},
};
</script>

View File

@ -0,0 +1,3 @@
<template >
<router-view />
</template>

View File

@ -128,7 +128,14 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:class:remove']"
>删除</el-button>
>删除班级</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleEditJs(scope.row)"
v-hasPermi="['system:class:edit']"
>清空教师</el-button>
</template>
</el-table-column>
</el-table>
@ -206,7 +213,8 @@ import {
delClass,
addClass,
updateClass,
exportClass
exportClass,
delJsClass
} from "@/api/system/class";
import { getUsersByRoleId } from "@/api/system/user";
@ -399,6 +407,22 @@ export default {
})
.catch(function() {});
},
handleEditJs(row) {
const bjbhs = row.bjbh || this.ids;
this.$confirm("是否确认清空选中的班级教师信息?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(function() {
return delJsClass(bjbhs);
})
.then(() => {
this.getList();
this.msgSuccess("清空成功");
})
.catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;

View File

@ -123,7 +123,7 @@
<!-- 添加或修改教师基本信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="flag">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="flag">
<el-form-item label="id" prop="id" v-show="false">
<el-input v-model="form.id" />
</el-form-item>

View File

@ -0,0 +1,97 @@
package com.ruoyi.project.benyi.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.benyi.domain.ByThemeMonthplan;
import com.ruoyi.project.benyi.service.IByThemeMonthplanService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 主题整合月计划Controller
*
* @author tsbz
* @date 2020-08-17
*/
@RestController
@RequestMapping("/benyi/thememonthplan")
public class ByThemeMonthplanController extends BaseController {
@Autowired
private IByThemeMonthplanService byThemeMonthplanService;
/**
* 查询主题整合月计划列表
*/
@PreAuthorize("@ss.hasPermi('benyi:thememonthplan:list')")
@GetMapping("/list")
public TableDataInfo list(ByThemeMonthplan byThemeMonthplan) {
startPage();
List<ByThemeMonthplan> list = byThemeMonthplanService.selectByThemeMonthplanList(byThemeMonthplan);
return getDataTable(list);
}
/**
* 导出主题整合月计划列表
*/
@PreAuthorize("@ss.hasPermi('benyi:thememonthplan:export')")
@Log(title = "主题整合月计划", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ByThemeMonthplan byThemeMonthplan) {
List<ByThemeMonthplan> list = byThemeMonthplanService.selectByThemeMonthplanList(byThemeMonthplan);
ExcelUtil<ByThemeMonthplan> util = new ExcelUtil<ByThemeMonthplan>(ByThemeMonthplan.class);
return util.exportExcel(list, "thememonthplan");
}
/**
* 获取主题整合月计划详细信息
*/
@PreAuthorize("@ss.hasPermi('benyi:thememonthplan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(byThemeMonthplanService.selectByThemeMonthplanById(id));
}
/**
* 新增主题整合月计划
*/
@PreAuthorize("@ss.hasPermi('benyi:thememonthplan:add')")
@Log(title = "主题整合月计划", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ByThemeMonthplan byThemeMonthplan) {
return toAjax(byThemeMonthplanService.insertByThemeMonthplan(byThemeMonthplan));
}
/**
* 修改主题整合月计划
*/
@PreAuthorize("@ss.hasPermi('benyi:thememonthplan:edit')")
@Log(title = "主题整合月计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ByThemeMonthplan byThemeMonthplan) {
return toAjax(byThemeMonthplanService.updateByThemeMonthplan(byThemeMonthplan));
}
/**
* 删除主题整合月计划
*/
@PreAuthorize("@ss.hasPermi('benyi:thememonthplan:remove')")
@Log(title = "主题整合月计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(byThemeMonthplanService.deleteByThemeMonthplanByIds(ids));
}
}

View File

@ -0,0 +1,172 @@
package com.ruoyi.project.benyi.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 主题整合月计划对象 by_theme_monthplan
*
* @author tsbz
* @date 2020-08-17
*/
public class ByThemeMonthplan extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
private Long id;
/**
* 计划名称
*/
@Excel(name = "计划名称")
private String name;
/**
* 所属班级
*/
@Excel(name = "所属班级")
private String classid;
/**
* 学年学期
*/
@Excel(name = "学年学期")
private String xnxq;
/**
* 计划月份
*/
@Excel(name = "计划月份")
private String month;
/**
* 本月主题
*/
@Excel(name = "本月主题")
private String themes;
/**
* 本月自定义主题
*/
@Excel(name = "本月自定义主题")
private String selfthemes;
/**
* 家长支持
*/
@Excel(name = "家长支持")
private String support;
/**
* 备注
*/
@Excel(name = "备注")
private String remarks;
/**
* 创建人
*/
@Excel(name = "创建人")
private Long createuserid;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setClassid(String classid) {
this.classid = classid;
}
public String getClassid() {
return classid;
}
public void setXnxq(String xnxq) {
this.xnxq = xnxq;
}
public String getXnxq() {
return xnxq;
}
public void setMonth(String month) {
this.month = month;
}
public String getMonth() {
return month;
}
public void setThemes(String themes) {
this.themes = themes;
}
public String getThemes() {
return themes;
}
public void setSelfthemes(String selfthemes) {
this.selfthemes = selfthemes;
}
public String getSelfthemes() {
return selfthemes;
}
public void setSupport(String support) {
this.support = support;
}
public String getSupport() {
return support;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getRemarks() {
return remarks;
}
public void setCreateuserid(Long createuserid) {
this.createuserid = createuserid;
}
public Long getCreateuserid() {
return createuserid;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("classid", getClassid())
.append("xnxq", getXnxq())
.append("month", getMonth())
.append("themes", getThemes())
.append("selfthemes", getSelfthemes())
.append("support", getSupport())
.append("remarks", getRemarks())
.append("createuserid", getCreateuserid())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.mapper;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByThemeMonthplan;
/**
* 主题整合月计划Mapper接口
*
* @author tsbz
* @date 2020-08-17
*/
public interface ByThemeMonthplanMapper {
/**
* 查询主题整合月计划
*
* @param id 主题整合月计划ID
* @return 主题整合月计划
*/
public ByThemeMonthplan selectByThemeMonthplanById(Long id);
/**
* 查询主题整合月计划列表
*
* @param byThemeMonthplan 主题整合月计划
* @return 主题整合月计划集合
*/
public List<ByThemeMonthplan> selectByThemeMonthplanList(ByThemeMonthplan byThemeMonthplan);
/**
* 新增主题整合月计划
*
* @param byThemeMonthplan 主题整合月计划
* @return 结果
*/
public int insertByThemeMonthplan(ByThemeMonthplan byThemeMonthplan);
/**
* 修改主题整合月计划
*
* @param byThemeMonthplan 主题整合月计划
* @return 结果
*/
public int updateByThemeMonthplan(ByThemeMonthplan byThemeMonthplan);
/**
* 删除主题整合月计划
*
* @param id 主题整合月计划ID
* @return 结果
*/
public int deleteByThemeMonthplanById(Long id);
/**
* 批量删除主题整合月计划
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteByThemeMonthplanByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.service;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByThemeMonthplan;
/**
* 主题整合月计划Service接口
*
* @author tsbz
* @date 2020-08-17
*/
public interface IByThemeMonthplanService {
/**
* 查询主题整合月计划
*
* @param id 主题整合月计划ID
* @return 主题整合月计划
*/
public ByThemeMonthplan selectByThemeMonthplanById(Long id);
/**
* 查询主题整合月计划列表
*
* @param byThemeMonthplan 主题整合月计划
* @return 主题整合月计划集合
*/
public List<ByThemeMonthplan> selectByThemeMonthplanList(ByThemeMonthplan byThemeMonthplan);
/**
* 新增主题整合月计划
*
* @param byThemeMonthplan 主题整合月计划
* @return 结果
*/
public int insertByThemeMonthplan(ByThemeMonthplan byThemeMonthplan);
/**
* 修改主题整合月计划
*
* @param byThemeMonthplan 主题整合月计划
* @return 结果
*/
public int updateByThemeMonthplan(ByThemeMonthplan byThemeMonthplan);
/**
* 批量删除主题整合月计划
*
* @param ids 需要删除的主题整合月计划ID
* @return 结果
*/
public int deleteByThemeMonthplanByIds(Long[] ids);
/**
* 删除主题整合月计划信息
*
* @param id 主题整合月计划ID
* @return 结果
*/
public int deleteByThemeMonthplanById(Long id);
}

View File

@ -0,0 +1,89 @@
package com.ruoyi.project.benyi.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.benyi.mapper.ByThemeMonthplanMapper;
import com.ruoyi.project.benyi.domain.ByThemeMonthplan;
import com.ruoyi.project.benyi.service.IByThemeMonthplanService;
/**
* 主题整合月计划Service业务层处理
*
* @author tsbz
* @date 2020-08-17
*/
@Service
public class ByThemeMonthplanServiceImpl implements IByThemeMonthplanService {
@Autowired
private ByThemeMonthplanMapper byThemeMonthplanMapper;
/**
* 查询主题整合月计划
*
* @param id 主题整合月计划ID
* @return 主题整合月计划
*/
@Override
public ByThemeMonthplan selectByThemeMonthplanById(Long id) {
return byThemeMonthplanMapper.selectByThemeMonthplanById(id);
}
/**
* 查询主题整合月计划列表
*
* @param byThemeMonthplan 主题整合月计划
* @return 主题整合月计划
*/
@Override
public List<ByThemeMonthplan> selectByThemeMonthplanList(ByThemeMonthplan byThemeMonthplan) {
return byThemeMonthplanMapper.selectByThemeMonthplanList(byThemeMonthplan);
}
/**
* 新增主题整合月计划
*
* @param byThemeMonthplan 主题整合月计划
* @return 结果
*/
@Override
public int insertByThemeMonthplan(ByThemeMonthplan byThemeMonthplan) {
byThemeMonthplan.setCreateTime(DateUtils.getNowDate());
return byThemeMonthplanMapper.insertByThemeMonthplan(byThemeMonthplan);
}
/**
* 修改主题整合月计划
*
* @param byThemeMonthplan 主题整合月计划
* @return 结果
*/
@Override
public int updateByThemeMonthplan(ByThemeMonthplan byThemeMonthplan) {
return byThemeMonthplanMapper.updateByThemeMonthplan(byThemeMonthplan);
}
/**
* 批量删除主题整合月计划
*
* @param ids 需要删除的主题整合月计划ID
* @return 结果
*/
@Override
public int deleteByThemeMonthplanByIds(Long[] ids) {
return byThemeMonthplanMapper.deleteByThemeMonthplanByIds(ids);
}
/**
* 删除主题整合月计划信息
*
* @param id 主题整合月计划ID
* @return 结果
*/
@Override
public int deleteByThemeMonthplanById(Long id) {
return byThemeMonthplanMapper.deleteByThemeMonthplanById(id);
}
}

View File

@ -42,7 +42,7 @@ public class ByClassController extends BaseController {
/**
* 查询班级信息列表
*/
@PreAuthorize("@ss.hasPermi('system:class:list')"+ "||@ss.hasPermi('system:school:list')")
//@PreAuthorize("@ss.hasPermi('system:class:list')"+ "||@ss.hasPermi('system:school:list')")
@GetMapping("/list")
public TableDataInfo list(ByClass byClass) {
startPage();
@ -80,15 +80,48 @@ public class ByClassController extends BaseController {
public AjaxResult add(@RequestBody ByClass byClass) {
//首先判断 当前用户是否为学校
if(schoolCommon.isSchool()){
String strBjbh = UUID.randomUUID().toString().replace("-","");
if (schoolCommon.isSchool()) {
//首先检查教师是否已经是班长配班助教;为了限制一个账号多种班级权限
if (byClass.getZbjs() != null) {
ByClass byClassNew = new ByClass();
byClassNew.setZbjs(byClass.getZbjs());
byClassNew.setPbjs(byClass.getZbjs());
byClassNew.setZljs(byClass.getZbjs());
byClassNew = byClassService.selectByClassByUserId(byClassNew);
if (byClassNew != null && !schoolCommon.isStringEmpty(byClassNew.getBjbh())) {
return AjaxResult.error("当前主班教师已设置为其他班级教师,无法重复,创建班级失败");
}
}
if (byClass.getPbjs() != null) {
ByClass byClassNew = new ByClass();
byClassNew.setZbjs(byClass.getPbjs());
byClassNew.setPbjs(byClass.getPbjs());
byClassNew.setZljs(byClass.getPbjs());
byClassNew = byClassService.selectByClassByUserId(byClassNew);
if (byClassNew != null && !schoolCommon.isStringEmpty(byClassNew.getBjbh())) {
return AjaxResult.error("当前配班教师已设置为其他班级教师,无法重复,创建班级失败");
}
}
if (byClass.getZljs() != null) {
ByClass byClassNew = new ByClass();
byClassNew.setZbjs(byClass.getZljs());
byClassNew.setPbjs(byClass.getZljs());
byClassNew.setZljs(byClass.getZljs());
byClassNew = byClassService.selectByClassByUserId(byClassNew);
if (byClassNew != null && !schoolCommon.isStringEmpty(byClassNew.getBjbh())) {
return AjaxResult.error("当前助理教师已设置为其他班级教师,无法重复,创建班级失败");
}
}
String strBjbh = UUID.randomUUID().toString().replace("-", "");
System.out.println("bjbh:==" + strBjbh);
byClass.setBjbh(strBjbh);
byClass.setDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byClass.setXn(schoolCommon.getCurrentXn());
byClass.setCreatetime(new Date());
return toAjax(byClassService.insertByClass(byClass));}
else {
return toAjax(byClassService.insertByClass(byClass));
} else {
return AjaxResult.error("当前用户非幼儿园,无法创建班级");
}
}
@ -101,12 +134,72 @@ public class ByClassController extends BaseController {
@PutMapping
public AjaxResult edit(@RequestBody ByClass byClass) {
//首先判断 当前用户是否为学校
if(schoolCommon.isSchool()) {
if (schoolCommon.isSchool()) {
//判断主班教师配班教师助理教师的值是否有变化
ByClass byClassNew = byClassService.selectByClassById(byClass.getBjbh());
if (byClass.getZbjs() != null) {
if (byClassNew.getZbjs() == null || !byClassNew.getZbjs().equals(byClass.getZbjs())) {
ByClass byClassInfoNew = new ByClass();
byClassInfoNew.setZbjs(byClass.getZbjs());
byClassInfoNew.setPbjs(byClass.getZbjs());
byClassInfoNew.setZljs(byClass.getZbjs());
byClassInfoNew = byClassService.selectByClassByUserId(byClassInfoNew);
if (byClassInfoNew != null && !schoolCommon.isStringEmpty(byClassInfoNew.getBjbh())) {
return AjaxResult.error("当前主班教师已设置为其他班级教师,无法重复,修改班级信息失败");
}
}
}
if (byClass.getPbjs() != null) {
if (byClassNew.getPbjs() == null || !byClassNew.getPbjs().equals(byClass.getPbjs())) {
ByClass byClassInfoNew = new ByClass();
byClassInfoNew.setZbjs(byClass.getPbjs());
byClassInfoNew.setPbjs(byClass.getPbjs());
byClassInfoNew.setZljs(byClass.getPbjs());
byClassInfoNew = byClassService.selectByClassByUserId(byClassInfoNew);
if (byClassInfoNew != null && !schoolCommon.isStringEmpty(byClassInfoNew.getBjbh())) {
return AjaxResult.error("当前配班教师已设置为其他班级教师,无法重复,修改班级信息失败");
}
}
}
if (byClass.getZljs() != null) {
if (byClassNew.getZljs() == null || !byClassNew.getZljs().equals(byClass.getZljs())) {
ByClass byClassInfoNew = new ByClass();
byClassInfoNew.setZbjs(byClass.getZljs());
byClassInfoNew.setPbjs(byClass.getZljs());
byClassInfoNew.setZljs(byClass.getZljs());
byClassInfoNew = byClassService.selectByClassByUserId(byClassInfoNew);
if (byClassInfoNew != null && !schoolCommon.isStringEmpty(byClassInfoNew.getBjbh())) {
return AjaxResult.error("当前助理教师已设置为其他班级教师,无法重复,修改班级信息失败");
}
}
}
return toAjax(byClassService.updateByClass(byClass));
}
return AjaxResult.error("当前用户非幼儿园,无法编辑班级");
}
/**
* 清空班级教师信息
*/
@PreAuthorize("@ss.hasPermi('system:class:edit')")
@Log(title = "班级信息", businessType = BusinessType.UPDATE)
@DeleteMapping("/deljs/{bjbhs}")
public AjaxResult deljs(@PathVariable String bjbhs) {
//首先判断 当前用户是否为学校
if (schoolCommon.isSchool()) {
ByClass byClass=byClassService.selectByClassById(bjbhs);
byClass.setZbjs(null);
byClass.setPbjs(null);
byClass.setZljs(null);
return toAjax(byClassService.updateByClass(byClass));
}
return AjaxResult.error("当前用户非幼儿园,无法删除班级");
}
/**
* 删除班级信息
*/
@ -115,7 +208,7 @@ public class ByClassController extends BaseController {
@DeleteMapping("/{bjbhs}")
public AjaxResult remove(@PathVariable String[] bjbhs) {
//首先判断 当前用户是否为学校
if(schoolCommon.isSchool()) {
if (schoolCommon.isSchool()) {
return toAjax(byClassService.deleteByClassByIds(bjbhs));
}
return AjaxResult.error("当前用户非幼儿园,无法删除班级");

View File

@ -65,7 +65,7 @@ public class ByTeacherJbxxController extends BaseController
/**
* 查询教师基本信息列表
*/
@PreAuthorize("@ss.hasPermi('system:teacher:list')"+ "||@ss.hasPermi('system:user:list')")
//@PreAuthorize("@ss.hasPermi('system:teacher:list')"+ "||@ss.hasPermi('system:user:list')")
@GetMapping("/listgroupxw")
public TableDataInfo listGroupXw(ByTeacherJbxx byTeacherJbxx)
{

View File

@ -65,7 +65,7 @@ public class SysDeptController extends BaseController {
/**
* 根据用户获取部门列表信息-用于切换岗位
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
//@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping(value = {"/getDeptsInfo"})
public TableDataInfo getDeptsInfo() {
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
@ -76,7 +76,7 @@ public class SysDeptController extends BaseController {
/**
* 切换岗位
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
//@PreAuthorize("@ss.hasPermi('system:user:query')")
@PostMapping(value = {"/changeDept/{deptId}"})
public AjaxResult changeDept(@PathVariable Long deptId) {
System.out.println("开始切换...");

View File

@ -66,7 +66,7 @@ public class SysUserController extends BaseController {
/**
* 获取用户列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
//@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list")
public TableDataInfo list(SysUser user) {
startPage();

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.benyi.mapper.ByThemeMonthplanMapper">
<resultMap type="ByThemeMonthplan" id="ByThemeMonthplanResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="classid" column="classid"/>
<result property="xnxq" column="xnxq"/>
<result property="month" column="month"/>
<result property="themes" column="themes"/>
<result property="selfthemes" column="selfthemes"/>
<result property="support" column="support"/>
<result property="remarks" column="remarks"/>
<result property="createuserid" column="createuserid"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectByThemeMonthplanVo">
select id, name, classid, xnxq, month, themes, selfthemes, support, remarks, createuserid, create_time from by_theme_monthplan
</sql>
<select id="selectByThemeMonthplanList" parameterType="ByThemeMonthplan" resultMap="ByThemeMonthplanResult">
<include refid="selectByThemeMonthplanVo"/>
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="classid != null and classid != ''">and classid = #{classid}</if>
<if test="xnxq != null and xnxq != ''">and xnxq = #{xnxq}</if>
<if test="month != null and month != ''">and month = #{month}</if>
<if test="themes != null and themes != ''">and themes = #{themes}</if>
<if test="selfthemes != null and selfthemes != ''">and selfthemes = #{selfthemes}</if>
<if test="support != null and support != ''">and support = #{support}</if>
<if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
<if test="createuserid != null ">and createuserid = #{createuserid}</if>
</where>
</select>
<select id="selectByThemeMonthplanById" parameterType="Long" resultMap="ByThemeMonthplanResult">
<include refid="selectByThemeMonthplanVo"/>
where id = #{id}
</select>
<insert id="insertByThemeMonthplan" parameterType="ByThemeMonthplan" useGeneratedKeys="true" keyProperty="id">
insert into by_theme_monthplan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if>
<if test="classid != null and classid != ''">classid,</if>
<if test="xnxq != null and xnxq != ''">xnxq,</if>
<if test="month != null and month != ''">month,</if>
<if test="themes != null and themes != ''">themes,</if>
<if test="selfthemes != null and selfthemes != ''">selfthemes,</if>
<if test="support != null and support != ''">support,</if>
<if test="remarks != null and remarks != ''">remarks,</if>
<if test="createuserid != null ">createuserid,</if>
<if test="createTime != null ">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
<if test="classid != null and classid != ''">#{classid},</if>
<if test="xnxq != null and xnxq != ''">#{xnxq},</if>
<if test="month != null and month != ''">#{month},</if>
<if test="themes != null and themes != ''">#{themes},</if>
<if test="selfthemes != null and selfthemes != ''">#{selfthemes},</if>
<if test="support != null and support != ''">#{support},</if>
<if test="remarks != null and remarks != ''">#{remarks},</if>
<if test="createuserid != null ">#{createuserid},</if>
<if test="createTime != null ">#{createTime},</if>
</trim>
</insert>
<update id="updateByThemeMonthplan" parameterType="ByThemeMonthplan">
update by_theme_monthplan
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="classid != null and classid != ''">classid = #{classid},</if>
<if test="xnxq != null and xnxq != ''">xnxq = #{xnxq},</if>
<if test="month != null and month != ''">month = #{month},</if>
<if test="themes != null and themes != ''">themes = #{themes},</if>
<if test="selfthemes != null and selfthemes != ''">selfthemes = #{selfthemes},</if>
<if test="support != null and support != ''">support = #{support},</if>
<if test="remarks != null and remarks != ''">remarks = #{remarks},</if>
<if test="createuserid != null ">createuserid = #{createuserid},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteByThemeMonthplanById" parameterType="Long">
delete from by_theme_monthplan where id = #{id}
</delete>
<delete id="deleteByThemeMonthplanByIds" parameterType="String">
delete from by_theme_monthplan where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -44,9 +44,9 @@
<if test="zbjs != null ">and zbjs = #{zbjs}</if>
<if test="pbjs != null ">and pbjs = #{pbjs}</if>
<if test="zljs != null ">and zljs = #{zljs}</if>
<if test="zbjsxm != null and zbjsxm != ''" >and zbjsxm like concat('%', #{zbjsxm}, '%')</if>
<if test="pbjsxm != null and pbjsxm != ''" >and pbjsxm like concat('%', #{pbjsxm}, '%')</if>
<if test="zljsxm != null and zljsxm != ''" >and zljsxm like concat('%', #{zljsxm}, '%')</if>
<if test="zbjsxm != null and zbjsxm != ''">and zbjsxm like concat('%', #{zbjsxm}, '%')</if>
<if test="pbjsxm != null and pbjsxm != ''">and pbjsxm like concat('%', #{pbjsxm}, '%')</if>
<if test="zljsxm != null and zljsxm != ''">and zljsxm like concat('%', #{zljsxm}, '%')</if>
<if test="isdel != null and isdel != ''">and isdel = #{isdel}</if>
<if test="createtime != null ">and createtime = #{createtime}</if>
<!-- 数据范围过滤 -->
@ -60,13 +60,26 @@
where bjbh = #{bjbh}
</select>
<!--<select id="selectByClassByUserId" parameterType="ByClass" resultMap="ByClassResult">-->
<!--<include refid="selectByClassVo"/>-->
<!--<where>-->
<!--<if test="zbjs != null ">or zbjs = #{zbjs}</if>-->
<!--<if test="pbjs != null ">or pbjs = #{pbjs}</if>-->
<!--<if test="zljs != null ">or zljs = #{zljs}</if>-->
<!--and isdel = 0-->
<!--</where>-->
<!--&lt;!&ndash; 数据范围过滤 &ndash;&gt;-->
<!--${dataScope}-->
<!--</select>-->
<select id="selectByClassByUserId" parameterType="ByClass" resultMap="ByClassResult">
<include refid="selectByClassVo"/>
<where>
<if test="zbjs != null ">or zbjs = #{zbjs}</if>
<if test="pbjs != null ">or pbjs = #{pbjs}</if>
<if test="zljs != null ">or zljs = #{zljs}</if>
</where>
where
(zbjs = #{zbjs}
or pbjs = #{pbjs}
or zljs = #{zljs}
)
and isdel = 0
<!-- 数据范围过滤 -->
${dataScope}
</select>
@ -115,9 +128,9 @@
<if test="bjmc != null and bjmc != ''">bjmc = #{bjmc},</if>
<if test="bjrych != null and bjrych != ''">bjrych = #{bjrych},</if>
<if test="jbny != null ">jbny = #{jbny},</if>
<if test="zbjs != null ">zbjs = #{zbjs},</if>
<if test="pbjs != null ">pbjs = #{pbjs},</if>
<if test="zljs != null ">zljs = #{zljs},</if>
zbjs = #{zbjs},
pbjs = #{pbjs},
zljs = #{zljs},
<if test="isdel != null and isdel != ''">isdel = #{isdel},</if>
<if test="createtime != null ">createtime = #{createtime},</if>
</trim>