修改班级园历部分功能

This commit is contained in:
sk1551 2020-05-08 12:34:31 +08:00
parent de155d71ae
commit 11855e06f8
9 changed files with 171 additions and 89 deletions

View File

@ -9,6 +9,15 @@ export function listSchoolcalendarclass(query) {
}) })
} }
// 不分页查询班级列表
export function listSchoolcalendarclassAll(query) {
return request({
url: '/benyi/schoolcalendarclass/listAll',
method: 'get',
params: query
})
}
// 查询园历管理(班级)详细 // 查询园历管理(班级)详细
export function getSchoolcalendarclass(id) { export function getSchoolcalendarclass(id) {
return request({ return request({

View File

@ -12,13 +12,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属班级" prop="classid"> <el-form-item label="所属班级" prop="classid">
<el-input <el-select v-model="queryParams.classid" placeholder="请选择班级" >
v-model="queryParams.classid" <el-option
placeholder="请输入所属班级" v-for="item in classListAll"
clearable :key="item.classid"
size="small" :label="item.byClass.bjmc"
@keyup.enter.native="handleQuery" :value="item.classid"
/> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="学年学期" prop="xnxq"> <el-form-item label="学年学期" prop="xnxq">
<el-select v-model="queryParams.xnxq" placeholder="请选择学年学期" clearable size="small"> <el-select v-model="queryParams.xnxq" placeholder="请选择学年学期" clearable size="small">
@ -90,7 +91,7 @@
<el-table-column label="编号" align="center" prop="id" /> <el-table-column label="编号" align="center" prop="id" />
<el-table-column label="名称" align="center" prop="name" /> <el-table-column label="名称" align="center" prop="name" />
<el-table-column label="活动类型" align="center" prop="type" :formatter="typeFormat" /> <el-table-column label="活动类型" align="center" prop="type" :formatter="typeFormat" />
<el-table-column label="所属班级" align="center" prop="classid" /> <el-table-column label="所属班级" align="center" prop="byClass.bjmc" />
<el-table-column label="学年学期" align="center" prop="xnxq" :formatter="xnxqFormat" /> <el-table-column label="学年学期" align="center" prop="xnxq" :formatter="xnxqFormat" />
<el-table-column label="活动时间" align="center" prop="activitytime" width="180"/> <el-table-column label="活动时间" align="center" prop="activitytime" width="180"/>
<el-table-column label="创建时间" align="center" prop="createtime" width="180"> <el-table-column label="创建时间" align="center" prop="createtime" width="180">
@ -160,7 +161,14 @@
</template> </template>
<script> <script>
import { listSchoolcalendarclass, getSchoolcalendarclass, delSchoolcalendarclass, addSchoolcalendarclass, updateSchoolcalendarclass, exportSchoolcalendarclass } from "@/api/benyi/schoolcalendarclass"; import {
listSchoolcalendarclass,
listSchoolcalendarclassAll,
getSchoolcalendarclass,
delSchoolcalendarclass,
addSchoolcalendarclass,
updateSchoolcalendarclass,
exportSchoolcalendarclass } from "@/api/benyi/schoolcalendarclass";
export default { export default {
name: "Schoolcalendarclass", name: "Schoolcalendarclass",
@ -178,6 +186,8 @@ export default {
total: 0, total: 0,
// () // ()
schoolcalendarclassList: [], schoolcalendarclassList: [],
//
classListAll: [],
// //
title: "", title: "",
// //
@ -208,6 +218,7 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getListAll();
this.getDicts("sys_schoolcalendartype").then(response => { this.getDicts("sys_schoolcalendartype").then(response => {
this.typeOptions = response.data; this.typeOptions = response.data;
}); });
@ -225,6 +236,12 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
/** 查询所有班级名称列表 */
getListAll(){
listSchoolcalendarclassAll(this.queryParams).then(response => {
this.classListAll = response.rows;
});
},
// //
typeFormat(row, column) { typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.type); return this.selectDictLabel(this.typeOptions, row.type);

View File

@ -50,9 +50,22 @@ public class BySchoolcalendarClassController extends BaseController
{ {
startPage(); startPage();
List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass); List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
System.out.println("---------------------分页"+list);
return getDataTable(list); return getDataTable(list);
} }
/**
* 不分页查询园历管理(班级)列表
*/
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:list')")
@GetMapping("/listAll")
public TableDataInfo listAll(BySchoolcalendarClass bySchoolcalendarClass)
{
List<BySchoolcalendarClass> listAll = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
System.out.println("---------------------没有分页"+listAll);
return getDataTable(listAll);
}
/** /**
* 导出园历管理(班级)列表 * 导出园历管理(班级)列表
*/ */

View File

@ -1,6 +1,7 @@
package com.ruoyi.project.benyi.domain; package com.ruoyi.project.benyi.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.project.system.domain.ByClass;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.framework.aspectj.lang.annotation.Excel;
@ -53,6 +54,8 @@ public class BySchoolcalendarClass extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime; private Date createtime;
private ByClass byClass;
public void setId(Long id) public void setId(Long id)
@ -142,6 +145,7 @@ public class BySchoolcalendarClass extends BaseEntity
.append("activitytime", getActivitytime()) .append("activitytime", getActivitytime())
.append("createuserid", getCreateuserid()) .append("createuserid", getCreateuserid())
.append("createtime", getCreatetime()) .append("createtime", getCreatetime())
.append("byClass", getByClass())
.toString(); .toString();
} }
@ -152,4 +156,12 @@ public class BySchoolcalendarClass extends BaseEntity
public void setCreatetime(Date createtime) { public void setCreatetime(Date createtime) {
this.createtime = createtime; this.createtime = createtime;
} }
public ByClass getByClass() {
return byClass;
}
public void setByClass(ByClass byClass) {
this.byClass = byClass;
}
} }

View File

@ -95,13 +95,18 @@ public class SchoolCommon {
return false; return false;
} }
/**
* 判断当前用户是否拥有班级
**/
public String getClassId() { public String getClassId() {
SysUser sysUser = getUser(); SysUser sysUser = getUser();
ByClass byClass = new ByClass(); ByClass byClass = new ByClass();
byClass.setZbjs(sysUser.getUserId()); byClass.setZbjs(sysUser.getUserId());
byClass.setPbjs(sysUser.getUserId()); byClass.setPbjs(sysUser.getUserId());
byClass.setZljs(sysUser.getUserId()); byClass.setZljs(sysUser.getUserId());
//新的返回byclass1返回整条数据
ByClass byClass1 = byClassService.selectByClassByUserId(byClass); ByClass byClass1 = byClassService.selectByClassByUserId(byClass);
System.out.println("--------------------"+ byClass1);
if(byClass1 != null) { if(byClass1 != null) {
return byClass1.getBjbh(); return byClass1.getBjbh();
} else { } else {

View File

@ -58,6 +58,7 @@ public class ByTeacherJbxxController extends BaseController
public TableDataInfo list2(ByTeacherJbxx byTeacherJbxx) public TableDataInfo list2(ByTeacherJbxx byTeacherJbxx)
{ {
List<ByTeacherJbxx> list2 = byTeacherJbxxService.selectByTeacherJbxxList(byTeacherJbxx); List<ByTeacherJbxx> list2 = byTeacherJbxxService.selectByTeacherJbxxList(byTeacherJbxx);
System.out.println("-------------------"+list2);
return getDataTable(list2); return getDataTable(list2);
} }

View File

@ -14,23 +14,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="activitytime" column="activitytime" /> <result property="activitytime" column="activitytime" />
<result property="createuserid" column="createuserid" /> <result property="createuserid" column="createuserid" />
<result property="createtime" column="createtime" /> <result property="createtime" column="createtime" />
<association property="byClass" column="bjbh" javaType="ByClass" resultMap="ByClassResult" />
</resultMap>
<resultMap type="ByClass" id="ByClassResult">
<result property="bjbh" column="bjbh"/>
<result property="deptId" column="dept_id"/>
<result property="bjtype" column="bjtype"/>
<result property="bhxh" column="bhxh"/>
<result property="xn" column="xn"/>
<result property="bjmc" column="bjmc"/>
<result property="bjrych" column="bjrych"/>
<result property="jbny" column="jbny"/>
<result property="zbjs" column="zbjs"/>
<result property="zbjsxm" column="zbjsxm"/>
<result property="pbjs" column="pbjs"/>
<result property="pbjsxm" column="pbjsxm"/>
<result property="zljs" column="zljs"/>
<result property="zljsxm" column="zljsxm"/>
<result property="isdel" column="isdel"/>
<result property="createtime" column="createtime"/>
</resultMap> </resultMap>
<sql id="selectBySchoolcalendarClassVo"> <sql id="selectBySchoolcalendarClassVo">
select id, name, type, classid, xnxq, deptId, activitytime, createuserid, createtime from by_schoolcalendar_class select id, name, type, classid, xnxq, deptId, activitytime, createuserid, createtime
from by_schoolcalendar_class
</sql> </sql>
<select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult"> <select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult">
<include refid="selectBySchoolcalendarClassVo"/> select sc.id, sc.name, sc.type, sc.classid, sc.xnxq, sc.deptId, sc.activitytime, sc.createuserid, sc.createtime,
c.bjbh, c.bjmc
from by_schoolcalendar_class sc
left join by_class c on sc.classid = c.bjbh
<where> <where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> sc.classid = c.bjbh
<if test="type != null and type != ''"> and type = #{type}</if> <if test="name != null and name != ''"> and sc.name like concat('%', #{name}, '%')</if>
<if test="classid != null and classid != ''"> and classid = #{classid}</if> <if test="type != null and type != ''"> and sc.type = #{type}</if>
<if test="xnxq != null and xnxq != ''"> and xnxq = #{xnxq}</if> <if test="classid != null and classid != ''"> and sc.classid = #{classid}</if>
<if test="deptid != null "> and deptId = #{deptid}</if> <if test="xnxq != null and xnxq != ''"> and sc.xnxq = #{xnxq}</if>
<if test="activitytime != null "> and activitytime = #{activitytime}</if> <if test="deptid != null "> and sc.deptId = #{deptid}</if>
<if test="createuserid != null "> and createuserid = #{createuserid}</if> <if test="activitytime != null "> and sc.activitytime = #{activitytime}</if>
<if test="createtime != null "> and createtime = #{createtime}</if> <if test="createuserid != null "> and sc.createuserid = #{createuserid}</if>
<if test="createtime != null "> and sc.createtime = #{createtime}</if>
</where> </where>
</select> </select>

View File

@ -63,9 +63,9 @@
<select id="selectByClassByUserId" parameterType="ByClass" resultMap="ByClassResult"> <select id="selectByClassByUserId" parameterType="ByClass" resultMap="ByClassResult">
<include refid="selectByClassVo"/> <include refid="selectByClassVo"/>
<where> <where>
<if test="zbjs != null ">and zbjs = #{zbjs}</if> <if test="zbjs != null ">or zbjs = #{zbjs}</if>
<if test="pbjs != null ">and pbjs = #{pbjs}</if> <if test="pbjs != null ">or pbjs = #{pbjs}</if>
<if test="zljs != null ">and zljs = #{zljs}</if> <if test="zljs != null ">or zljs = #{zljs}</if>
</where> </where>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${dataScope} ${dataScope}