小班禁止添加备课&学校显示截至日期

This commit is contained in:
sk1551 2021-01-30 15:12:56 +08:00
parent 128fb0dd4f
commit e83d4754cb
6 changed files with 176 additions and 152 deletions

View File

@ -116,6 +116,7 @@
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<!--<el-table-column label="创建人" align="center" prop="createUser" />-->
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="开通截至时间" align="center" prop="openDeadline" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button

View File

@ -102,28 +102,34 @@ public class ByMathTermplanController extends BaseController {
String classId = schoolCommon.getClassId();
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
int iCount = schoolCommon.getDifMonth(byMathTermplan.getStartmonth(), byMathTermplan.getEndmonth());
System.out.println("月份差=" + iCount);
String uuid = schoolCommon.getUuid();
byMathTermplan.setId(uuid);
byMathTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byMathTermplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byMathTermplan.setClassid(classId);
byMathTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-游戏数学学期计划");
// 判断当前班级是否为托班
String bjtypeNew = byClassService.selectByClassById(classId).getBjtype();
if (bjtypeNew.equals("1")) {
return AjaxResult.error("当前班级为托班,无法创建计划");
}else {
int iCount = schoolCommon.getDifMonth(byMathTermplan.getStartmonth(), byMathTermplan.getEndmonth());
System.out.println("月份差=" + iCount);
String uuid = schoolCommon.getUuid();
byMathTermplan.setId(uuid);
byMathTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byMathTermplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byMathTermplan.setClassid(classId);
byMathTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-游戏数学学期计划");
// 自动创建游戏数学学期计划明细
ByMathTermplanitem byMathTermplanitem = null;
for (int i = 0; i <= iCount; i++) {
byMathTermplanitem = new ByMathTermplanitem();
byMathTermplanitem.setTpid(uuid);
byMathTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byMathTermplanitem.setMonth(schoolCommon.DateAddMonths(i, byMathTermplan.getStartmonth()));
//创建时间
byMathTermplanitem.setCreateTime(new Date());
//新增每月计划
byMathTermplanitemService.insertByMathTermplanitem(byMathTermplanitem);
// 自动创建游戏数学学期计划明细
ByMathTermplanitem byMathTermplanitem = null;
for (int i = 0; i <= iCount; i++) {
byMathTermplanitem = new ByMathTermplanitem();
byMathTermplanitem.setTpid(uuid);
byMathTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byMathTermplanitem.setMonth(schoolCommon.DateAddMonths(i, byMathTermplan.getStartmonth()));
//创建时间
byMathTermplanitem.setCreateTime(new Date());
//新增每月计划
byMathTermplanitemService.insertByMathTermplanitem(byMathTermplanitem);
}
return toAjax(byMathTermplanService.insertByMathTermplan(byMathTermplan));
}
return toAjax(byMathTermplanService.insertByMathTermplan(byMathTermplan));
} else {
return AjaxResult.error("当前用户非幼儿园教师,无法创建计划");
}

View File

@ -110,48 +110,53 @@ public class ByThemeMonthplanController extends BaseController {
String classId = schoolCommon.getClassId();
//首先判断当前账户是否为幼儿园账号
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
//根据当前月份 查找学期计划的主题
ByThemeTermplan byThemeTermplan = new ByThemeTermplan();
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeTermplan.setClassid(classId);
byThemeTermplan.setStatus("2");
byThemeTermplan.setXnxq(byThemeMonthplan.getXnxq());
List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan);
String strThemeIds = "";
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
String themeId = list.get(i).getId();
ByThemeTermplanitem byThemeTermplanitem = new ByThemeTermplanitem();
byThemeTermplanitem.setTpid(themeId);
byThemeTermplanitem.setMonth(byThemeMonthplan.getMonth());
List<ByThemeTermplanitem> listItem = byThemeTermplanitemService.selectByThemeTermplanitemList(byThemeTermplanitem);
if (listItem != null && listItem.size() > 0) {
for (int j = 0; j < listItem.size(); j++) {
String themeIds = listItem.get(j).getThemeconent();
if (!schoolCommon.isStringEmpty(themeIds)) {
strThemeIds = strThemeIds + themeIds;
// 判断当前班级是否为托班
String bjtypeNew = byClassService.selectByClassById(classId).getBjtype();
if (bjtypeNew.equals("1")) {
return AjaxResult.error("当前班级为托班,无法创建计划");
}else {
//根据当前月份 查找学期计划的主题
ByThemeTermplan byThemeTermplan = new ByThemeTermplan();
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeTermplan.setClassid(classId);
byThemeTermplan.setStatus("2");
byThemeTermplan.setXnxq(byThemeMonthplan.getXnxq());
List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan);
String strThemeIds = "";
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
String themeId = list.get(i).getId();
ByThemeTermplanitem byThemeTermplanitem = new ByThemeTermplanitem();
byThemeTermplanitem.setTpid(themeId);
byThemeTermplanitem.setMonth(byThemeMonthplan.getMonth());
List<ByThemeTermplanitem> listItem = byThemeTermplanitemService.selectByThemeTermplanitemList(byThemeTermplanitem);
if (listItem != null && listItem.size() > 0) {
for (int j = 0; j < listItem.size(); j++) {
String themeIds = listItem.get(j).getThemeconent();
if (!schoolCommon.isStringEmpty(themeIds)) {
strThemeIds = strThemeIds + themeIds;
}
}
}
}
} else {
return AjaxResult.error("当前班级未制定学期计划或学期计划未审批,无法创建月计划");
}
} else {
return AjaxResult.error("当前班级未制定学期计划或学期计划未审批,无法创建月计划");
}
if (schoolCommon.isStringEmpty(strThemeIds)) {
return AjaxResult.error("当前班级制定的学期计划未设置月份主题,无法创建月计划");
}
if (schoolCommon.isStringEmpty(strThemeIds)) {
return AjaxResult.error("当前班级制定的学期计划未设置月份主题,无法创建月计划");
}
String uuid = schoolCommon.getUuid();
byThemeMonthplan.setId(uuid);
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeMonthplan.setClassid(classId);
byThemeMonthplan.setThemes(strThemeIds);//主题id
byThemeMonthplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
byThemeMonthplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合月计划" + "(" + sdf.format(byThemeMonthplan.getMonth()) + ")");
return toAjax(byThemeMonthplanService.insertByThemeMonthplan(byThemeMonthplan));
String uuid = schoolCommon.getUuid();
byThemeMonthplan.setId(uuid);
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeMonthplan.setClassid(classId);
byThemeMonthplan.setThemes(strThemeIds);//主题id
byThemeMonthplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
byThemeMonthplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合月计划" + "(" + sdf.format(byThemeMonthplan.getMonth()) + ")");
return toAjax(byThemeMonthplanService.insertByThemeMonthplan(byThemeMonthplan));
}
} else {
return AjaxResult.error("当前用户非幼儿园教师,无法创建月计划");
}

View File

@ -10,6 +10,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.project.benyi.domain.ByThemeTermplanitem;
import com.ruoyi.project.benyi.service.IByThemeTermplanitemService;
import com.ruoyi.project.common.SchoolCommon;
import com.ruoyi.project.system.domain.ByClass;
import com.ruoyi.project.system.service.IByClassService;
import com.ruoyi.project.system.service.ISysUserService;
import org.springframework.security.access.prepost.PreAuthorize;
@ -106,51 +107,56 @@ public class ByThemeTermplanController extends BaseController {
String classId = schoolCommon.getClassId();
//首先判断当前账户是否为幼儿园账号
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
ByThemeTermplan mybyThemeTermplan = new ByThemeTermplan();
String xnxqNew = null;
List<ByThemeTermplan> list = null;
xnxqNew = byThemeTermplan.getXnxq();
mybyThemeTermplan.setXnxq(xnxqNew);
mybyThemeTermplan.setClassid(classId);
mybyThemeTermplan.setStartmonth(null);
mybyThemeTermplan.setEndmonth(null);
list = byThemeTermplanService.selectByThemeTermplanList(mybyThemeTermplan);
System.out.println(list + "学期列表");
// 判断是否存在当前学期计划
if (list != null && list.size() > 0) {
return AjaxResult.error("当前学年学期计划已经存在,无法创建学期计划");
// 判断当前班级是否为托班
String bjtypeNew = byClassService.selectByClassById(classId).getBjtype();
if (bjtypeNew.equals("1")) {
return AjaxResult.error("当前班级为托班,无法创建计划");
}else {
int iCount = schoolCommon.getDifMonth(byThemeTermplan.getStartmonth(), byThemeTermplan.getEndmonth());
System.out.println("月份差=" + iCount);
String uuid = schoolCommon.getUuid();
byThemeTermplan.setId(uuid);
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeTermplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byThemeTermplan.setClassid(classId);
byThemeTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合学期计划");
ByThemeTermplan mybyThemeTermplan = new ByThemeTermplan();
String xnxqNew = null;
List<ByThemeTermplan> list = null;
xnxqNew = byThemeTermplan.getXnxq();
mybyThemeTermplan.setXnxq(xnxqNew);
mybyThemeTermplan.setClassid(classId);
mybyThemeTermplan.setStartmonth(null);
mybyThemeTermplan.setEndmonth(null);
list = byThemeTermplanService.selectByThemeTermplanList(mybyThemeTermplan);
System.out.println(list + "学期列表");
// 判断是否存在当前学期计划
if (list != null && list.size() > 0) {
return AjaxResult.error("当前学年学期计划已经存在,无法创建学期计划");
}else {
int iCount = schoolCommon.getDifMonth(byThemeTermplan.getStartmonth(), byThemeTermplan.getEndmonth());
System.out.println("月份差=" + iCount);
String uuid = schoolCommon.getUuid();
byThemeTermplan.setId(uuid);
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeTermplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byThemeTermplan.setClassid(classId);
byThemeTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合学期计划");
ByThemeTermplanitem byThemeTermplanitem = null;
for (int i = 0; i <= iCount; i++) {
byThemeTermplanitem = new ByThemeTermplanitem();
byThemeTermplanitem.setTpid(uuid);
byThemeTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
ByThemeTermplanitem byThemeTermplanitem = null;
for (int i = 0; i <= iCount; i++) {
byThemeTermplanitem = new ByThemeTermplanitem();
byThemeTermplanitem.setTpid(uuid);
byThemeTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
// //月份加1
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(byThemeTermplan.getStartmonth());
// calendar.add(Calendar.MONTH, i);
byThemeTermplanitem.setMonth(schoolCommon.DateAddMonths(i, byThemeTermplan.getStartmonth()));
byThemeTermplanitem.setMonth(schoolCommon.DateAddMonths(i, byThemeTermplan.getStartmonth()));
//创建时间
byThemeTermplanitem.setCreateTime(new Date());
//创建时间
byThemeTermplanitem.setCreateTime(new Date());
//新增每月计划
byThemeTermplanitemService.insertByThemeTermplanitem(byThemeTermplanitem);
//新增每月计划
byThemeTermplanitemService.insertByThemeTermplanitem(byThemeTermplanitem);
}
return toAjax(byThemeTermplanService.insertByThemeTermplan(byThemeTermplan));
}
return toAjax(byThemeTermplanService.insertByThemeTermplan(byThemeTermplan));
}
} else {
return AjaxResult.error("当前用户非幼儿园教师,无法创建计划");

View File

@ -115,74 +115,78 @@ public class ByThemeWeekplanController extends BaseController {
String classId = schoolCommon.getClassId();
//首先判断当前账户是否为幼儿园账号
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
// 判断当前班级是否为托班
String bjtypeNew = byClassService.selectByClassById(classId).getBjtype();
if (bjtypeNew.equals("1")) {
return AjaxResult.error("当前班级为托班,无法创建计划");
}else {
//判断当前班级是否创建月计划
ByThemeMonthplan byThemeMonthplan = new ByThemeMonthplan();
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeMonthplan.setClassid(classId);
byThemeMonthplan.setXnxq(byThemeWeekplan.getXnxq());
byThemeMonthplan.setMonth(byThemeWeekplan.getMonth());
byThemeMonthplan.setStatus("2");
List<ByThemeMonthplan> list = byThemeMonthplanService.selectByThemeMonthplanList(byThemeMonthplan);
int iCount = 0;
if (list != null && list.size() > 0) {
//循环月计划查找周详情
for (int i = 0; i < list.size(); i++) {
String mpid = list.get(i).getId();
ByThemeMonthplanitem byThemeMonthplanitem = new ByThemeMonthplanitem();
byThemeMonthplanitem.setMpid(mpid);
byThemeMonthplanitem.setZc(byThemeWeekplan.getZc());
//判断当前班级是否创建月计划
ByThemeMonthplan byThemeMonthplan = new ByThemeMonthplan();
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeMonthplan.setClassid(classId);
byThemeMonthplan.setXnxq(byThemeWeekplan.getXnxq());
byThemeMonthplan.setMonth(byThemeWeekplan.getMonth());
byThemeMonthplan.setStatus("2");
List<ByThemeMonthplan> list = byThemeMonthplanService.selectByThemeMonthplanList(byThemeMonthplan);
int iCount = 0;
if (list != null && list.size() > 0) {
//循环月计划查找周详情
for (int i = 0; i < list.size(); i++) {
String mpid = list.get(i).getId();
ByThemeMonthplanitem byThemeMonthplanitem = new ByThemeMonthplanitem();
byThemeMonthplanitem.setMpid(mpid);
byThemeMonthplanitem.setZc(byThemeWeekplan.getZc());
List<ByThemeMonthplanitem> listItem = byThemeonthplanitemService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
for (int j = 0; j < listItem.size(); j++) {
iCount = iCount + (j + 1);
}
}
} else {
return AjaxResult.error("当前班级未制定月计划或月计划未审批,无法创建周计划");
}
if (iCount <= 0) {
return AjaxResult.error("当前班级未设置月份明细计划,无法创建周计划");
}
String uuid = schoolCommon.getUuid();
byThemeWeekplan.setId(uuid);
byThemeWeekplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合周计划" + "(第" + byThemeWeekplan.getZc() + "周)");
byThemeWeekplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeWeekplan.setClassid(classId);
byThemeWeekplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
if (list != null && list.size() > 0) {
//循环月计划查找周详情
for (int i = 0; i < list.size(); i++) {
String mpid = list.get(i).getId();
ByThemeMonthplanitem byThemeMonthplanitem = new ByThemeMonthplanitem();
byThemeMonthplanitem.setMpid(mpid);
byThemeMonthplanitem.setZc(byThemeWeekplan.getZc());
List<ByThemeMonthplanitem> listItem = byThemeonthplanitemService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
for (int j = 0; j < listItem.size(); j++) {
SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd");
Date dtStart = listItem.get(j).getStarttime();
Date dtEnd = listItem.get(j).getEndtime();
long day = (dtEnd.getTime() - dtStart.getTime()) / (24 * 60 * 60 * 1000) + 1;
System.out.println("day=" + day);
ByThemeWeekplanitem byThemeWeekplanitem = null;
for (int g = 0; g < day; g++) {
byThemeWeekplanitem = new ByThemeWeekplanitem();
byThemeWeekplanitem.setDaytime(schoolCommon.DateAddDays(g, listItem.get(j).getStarttime()));
byThemeWeekplanitem.setZhou(Long.valueOf(schoolCommon.dateToWeek(byThemeWeekplanitem.getDaytime())));
byThemeWeekplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byThemeWeekplanitem.setWpid(uuid);
byThemeWeekplanitemService.insertByThemeWeekplanitem(byThemeWeekplanitem);
List<ByThemeMonthplanitem> listItem = byThemeonthplanitemService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
for (int j = 0; j < listItem.size(); j++) {
iCount = iCount + (j + 1);
}
}
} else {
return AjaxResult.error("当前班级未制定月计划或月计划未审批,无法创建周计划");
}
if (iCount <= 0) {
return AjaxResult.error("当前班级未设置月份明细计划,无法创建周计划");
}
String uuid = schoolCommon.getUuid();
byThemeWeekplan.setId(uuid);
byThemeWeekplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合周计划" + "(第" + byThemeWeekplan.getZc() + "周)");
byThemeWeekplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeWeekplan.setClassid(classId);
byThemeWeekplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
if (list != null && list.size() > 0) {
//循环月计划查找周详情
for (int i = 0; i < list.size(); i++) {
String mpid = list.get(i).getId();
ByThemeMonthplanitem byThemeMonthplanitem = new ByThemeMonthplanitem();
byThemeMonthplanitem.setMpid(mpid);
byThemeMonthplanitem.setZc(byThemeWeekplan.getZc());
List<ByThemeMonthplanitem> listItem = byThemeonthplanitemService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
for (int j = 0; j < listItem.size(); j++) {
SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd");
Date dtStart = listItem.get(j).getStarttime();
Date dtEnd = listItem.get(j).getEndtime();
long day = (dtEnd.getTime() - dtStart.getTime()) / (24 * 60 * 60 * 1000) + 1;
System.out.println("day=" + day);
ByThemeWeekplanitem byThemeWeekplanitem = null;
for (int g = 0; g < day; g++) {
byThemeWeekplanitem = new ByThemeWeekplanitem();
byThemeWeekplanitem.setDaytime(schoolCommon.DateAddDays(g, listItem.get(j).getStarttime()));
byThemeWeekplanitem.setZhou(Long.valueOf(schoolCommon.dateToWeek(byThemeWeekplanitem.getDaytime())));
byThemeWeekplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byThemeWeekplanitem.setWpid(uuid);
byThemeWeekplanitemService.insertByThemeWeekplanitem(byThemeWeekplanitem);
}
}
}
}
return toAjax(byThemeWeekplanService.insertByThemeWeekplan(byThemeWeekplan));
}
return toAjax(byThemeWeekplanService.insertByThemeWeekplan(byThemeWeekplan));
} else {
return AjaxResult.error("当前用户非幼儿园教师,无法创建周计划");
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.project.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
@ -130,6 +131,7 @@ public class BySchool extends BaseEntity
/** 开通截至日期 */
@Excel(name = "开通截至日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date openDeadline;
/** 当前学年 */