小班禁止添加备课&学校显示截至日期
This commit is contained in:
parent
128fb0dd4f
commit
e83d4754cb
@ -116,6 +116,7 @@
|
|||||||
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
|
<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="createUser" />-->
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
<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">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -102,28 +102,34 @@ public class ByMathTermplanController extends BaseController {
|
|||||||
String classId = schoolCommon.getClassId();
|
String classId = schoolCommon.getClassId();
|
||||||
|
|
||||||
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
|
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
|
||||||
int iCount = schoolCommon.getDifMonth(byMathTermplan.getStartmonth(), byMathTermplan.getEndmonth());
|
// 判断当前班级是否为托班
|
||||||
System.out.println("月份差=" + iCount);
|
String bjtypeNew = byClassService.selectByClassById(classId).getBjtype();
|
||||||
String uuid = schoolCommon.getUuid();
|
if (bjtypeNew.equals("1")) {
|
||||||
byMathTermplan.setId(uuid);
|
return AjaxResult.error("当前班级为托班,无法创建计划");
|
||||||
byMathTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
}else {
|
||||||
byMathTermplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
int iCount = schoolCommon.getDifMonth(byMathTermplan.getStartmonth(), byMathTermplan.getEndmonth());
|
||||||
byMathTermplan.setClassid(classId);
|
System.out.println("月份差=" + iCount);
|
||||||
byMathTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-游戏数学学期计划");
|
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;
|
ByMathTermplanitem byMathTermplanitem = null;
|
||||||
for (int i = 0; i <= iCount; i++) {
|
for (int i = 0; i <= iCount; i++) {
|
||||||
byMathTermplanitem = new ByMathTermplanitem();
|
byMathTermplanitem = new ByMathTermplanitem();
|
||||||
byMathTermplanitem.setTpid(uuid);
|
byMathTermplanitem.setTpid(uuid);
|
||||||
byMathTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
byMathTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||||
byMathTermplanitem.setMonth(schoolCommon.DateAddMonths(i, byMathTermplan.getStartmonth()));
|
byMathTermplanitem.setMonth(schoolCommon.DateAddMonths(i, byMathTermplan.getStartmonth()));
|
||||||
//创建时间
|
//创建时间
|
||||||
byMathTermplanitem.setCreateTime(new Date());
|
byMathTermplanitem.setCreateTime(new Date());
|
||||||
//新增每月计划
|
//新增每月计划
|
||||||
byMathTermplanitemService.insertByMathTermplanitem(byMathTermplanitem);
|
byMathTermplanitemService.insertByMathTermplanitem(byMathTermplanitem);
|
||||||
|
}
|
||||||
|
return toAjax(byMathTermplanService.insertByMathTermplan(byMathTermplan));
|
||||||
}
|
}
|
||||||
return toAjax(byMathTermplanService.insertByMathTermplan(byMathTermplan));
|
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("当前用户非幼儿园教师,无法创建计划");
|
return AjaxResult.error("当前用户非幼儿园教师,无法创建计划");
|
||||||
}
|
}
|
||||||
|
@ -110,48 +110,53 @@ public class ByThemeMonthplanController extends BaseController {
|
|||||||
String classId = schoolCommon.getClassId();
|
String classId = schoolCommon.getClassId();
|
||||||
//首先判断当前账户是否为幼儿园账号
|
//首先判断当前账户是否为幼儿园账号
|
||||||
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
|
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
|
||||||
|
// 判断当前班级是否为托班
|
||||||
//根据当前月份 查找学期计划的主题
|
String bjtypeNew = byClassService.selectByClassById(classId).getBjtype();
|
||||||
ByThemeTermplan byThemeTermplan = new ByThemeTermplan();
|
if (bjtypeNew.equals("1")) {
|
||||||
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
return AjaxResult.error("当前班级为托班,无法创建计划");
|
||||||
byThemeTermplan.setClassid(classId);
|
}else {
|
||||||
byThemeTermplan.setStatus("2");
|
//根据当前月份 查找学期计划的主题
|
||||||
byThemeTermplan.setXnxq(byThemeMonthplan.getXnxq());
|
ByThemeTermplan byThemeTermplan = new ByThemeTermplan();
|
||||||
List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan);
|
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
||||||
String strThemeIds = "";
|
byThemeTermplan.setClassid(classId);
|
||||||
if (list != null && list.size() > 0) {
|
byThemeTermplan.setStatus("2");
|
||||||
for (int i = 0; i < list.size(); i++) {
|
byThemeTermplan.setXnxq(byThemeMonthplan.getXnxq());
|
||||||
String themeId = list.get(i).getId();
|
List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan);
|
||||||
ByThemeTermplanitem byThemeTermplanitem = new ByThemeTermplanitem();
|
String strThemeIds = "";
|
||||||
byThemeTermplanitem.setTpid(themeId);
|
if (list != null && list.size() > 0) {
|
||||||
byThemeTermplanitem.setMonth(byThemeMonthplan.getMonth());
|
for (int i = 0; i < list.size(); i++) {
|
||||||
List<ByThemeTermplanitem> listItem = byThemeTermplanitemService.selectByThemeTermplanitemList(byThemeTermplanitem);
|
String themeId = list.get(i).getId();
|
||||||
if (listItem != null && listItem.size() > 0) {
|
ByThemeTermplanitem byThemeTermplanitem = new ByThemeTermplanitem();
|
||||||
for (int j = 0; j < listItem.size(); j++) {
|
byThemeTermplanitem.setTpid(themeId);
|
||||||
String themeIds = listItem.get(j).getThemeconent();
|
byThemeTermplanitem.setMonth(byThemeMonthplan.getMonth());
|
||||||
if (!schoolCommon.isStringEmpty(themeIds)) {
|
List<ByThemeTermplanitem> listItem = byThemeTermplanitemService.selectByThemeTermplanitemList(byThemeTermplanitem);
|
||||||
strThemeIds = strThemeIds + themeIds;
|
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)) {
|
if (schoolCommon.isStringEmpty(strThemeIds)) {
|
||||||
return AjaxResult.error("当前班级制定的学期计划未设置月份主题,无法创建月计划");
|
return AjaxResult.error("当前班级制定的学期计划未设置月份主题,无法创建月计划");
|
||||||
}
|
}
|
||||||
|
|
||||||
String uuid = schoolCommon.getUuid();
|
String uuid = schoolCommon.getUuid();
|
||||||
byThemeMonthplan.setId(uuid);
|
byThemeMonthplan.setId(uuid);
|
||||||
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
||||||
byThemeMonthplan.setClassid(classId);
|
byThemeMonthplan.setClassid(classId);
|
||||||
byThemeMonthplan.setThemes(strThemeIds);//主题id
|
byThemeMonthplan.setThemes(strThemeIds);//主题id
|
||||||
byThemeMonthplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
byThemeMonthplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||||
byThemeMonthplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合月计划" + "(" + sdf.format(byThemeMonthplan.getMonth()) + ")");
|
byThemeMonthplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合月计划" + "(" + sdf.format(byThemeMonthplan.getMonth()) + ")");
|
||||||
return toAjax(byThemeMonthplanService.insertByThemeMonthplan(byThemeMonthplan));
|
return toAjax(byThemeMonthplanService.insertByThemeMonthplan(byThemeMonthplan));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("当前用户非幼儿园教师,无法创建月计划");
|
return AjaxResult.error("当前用户非幼儿园教师,无法创建月计划");
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import com.ruoyi.common.utils.SecurityUtils;
|
|||||||
import com.ruoyi.project.benyi.domain.ByThemeTermplanitem;
|
import com.ruoyi.project.benyi.domain.ByThemeTermplanitem;
|
||||||
import com.ruoyi.project.benyi.service.IByThemeTermplanitemService;
|
import com.ruoyi.project.benyi.service.IByThemeTermplanitemService;
|
||||||
import com.ruoyi.project.common.SchoolCommon;
|
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.IByClassService;
|
||||||
import com.ruoyi.project.system.service.ISysUserService;
|
import com.ruoyi.project.system.service.ISysUserService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@ -106,51 +107,56 @@ public class ByThemeTermplanController extends BaseController {
|
|||||||
String classId = schoolCommon.getClassId();
|
String classId = schoolCommon.getClassId();
|
||||||
//首先判断当前账户是否为幼儿园账号
|
//首先判断当前账户是否为幼儿园账号
|
||||||
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
|
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
|
||||||
|
// 判断当前班级是否为托班
|
||||||
ByThemeTermplan mybyThemeTermplan = new ByThemeTermplan();
|
String bjtypeNew = byClassService.selectByClassById(classId).getBjtype();
|
||||||
String xnxqNew = null;
|
if (bjtypeNew.equals("1")) {
|
||||||
List<ByThemeTermplan> list = null;
|
return AjaxResult.error("当前班级为托班,无法创建计划");
|
||||||
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 {
|
}else {
|
||||||
int iCount = schoolCommon.getDifMonth(byThemeTermplan.getStartmonth(), byThemeTermplan.getEndmonth());
|
ByThemeTermplan mybyThemeTermplan = new ByThemeTermplan();
|
||||||
System.out.println("月份差=" + iCount);
|
String xnxqNew = null;
|
||||||
String uuid = schoolCommon.getUuid();
|
List<ByThemeTermplan> list = null;
|
||||||
byThemeTermplan.setId(uuid);
|
xnxqNew = byThemeTermplan.getXnxq();
|
||||||
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
mybyThemeTermplan.setXnxq(xnxqNew);
|
||||||
byThemeTermplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
mybyThemeTermplan.setClassid(classId);
|
||||||
byThemeTermplan.setClassid(classId);
|
mybyThemeTermplan.setStartmonth(null);
|
||||||
byThemeTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合学期计划");
|
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;
|
ByThemeTermplanitem byThemeTermplanitem = null;
|
||||||
for (int i = 0; i <= iCount; i++) {
|
for (int i = 0; i <= iCount; i++) {
|
||||||
byThemeTermplanitem = new ByThemeTermplanitem();
|
byThemeTermplanitem = new ByThemeTermplanitem();
|
||||||
byThemeTermplanitem.setTpid(uuid);
|
byThemeTermplanitem.setTpid(uuid);
|
||||||
byThemeTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
byThemeTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||||
// //月份加1
|
// //月份加1
|
||||||
// Calendar calendar = Calendar.getInstance();
|
// Calendar calendar = Calendar.getInstance();
|
||||||
// calendar.setTime(byThemeTermplan.getStartmonth());
|
// calendar.setTime(byThemeTermplan.getStartmonth());
|
||||||
// calendar.add(Calendar.MONTH, i);
|
// 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 {
|
} else {
|
||||||
return AjaxResult.error("当前用户非幼儿园教师,无法创建计划");
|
return AjaxResult.error("当前用户非幼儿园教师,无法创建计划");
|
||||||
|
@ -115,74 +115,78 @@ public class ByThemeWeekplanController extends BaseController {
|
|||||||
String classId = schoolCommon.getClassId();
|
String classId = schoolCommon.getClassId();
|
||||||
//首先判断当前账户是否为幼儿园账号
|
//首先判断当前账户是否为幼儿园账号
|
||||||
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
|
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());
|
||||||
|
|
||||||
//判断当前班级是否创建月计划
|
List<ByThemeMonthplanitem> listItem = byThemeonthplanitemService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
|
||||||
ByThemeMonthplan byThemeMonthplan = new ByThemeMonthplan();
|
for (int j = 0; j < listItem.size(); j++) {
|
||||||
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
iCount = iCount + (j + 1);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} 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 {
|
} else {
|
||||||
return AjaxResult.error("当前用户非幼儿园教师,无法创建周计划");
|
return AjaxResult.error("当前用户非幼儿园教师,无法创建周计划");
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.project.system.domain;
|
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.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;
|
||||||
@ -130,6 +131,7 @@ public class BySchool extends BaseEntity
|
|||||||
|
|
||||||
/** 开通截至日期 */
|
/** 开通截至日期 */
|
||||||
@Excel(name = "开通截至日期", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "开通截至日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date openDeadline;
|
private Date openDeadline;
|
||||||
|
|
||||||
/** 当前学年 */
|
/** 当前学年 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user