修改主题整合学期计划创建学期限制

This commit is contained in:
sk1551 2020-11-07 18:02:39 +08:00
parent fe79121520
commit 60cf0c6929
2 changed files with 36 additions and 21 deletions

View File

@ -215,7 +215,7 @@ export default {
// //
getThemeActivityList(themeid) { getThemeActivityList(themeid) {
listActivityByThemeId(themeid).then((response) => { listActivityByThemeId(themeid).then((response) => {
//console.log(response.rows); console.log(response.rows);
this.themeactivityOptions = response.rows; this.themeactivityOptions = response.rows;
}); });
}, },

View File

@ -106,6 +106,19 @@ 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 xnxqNew = null;
List<ByThemeTermplan> list = null;
xnxqNew = byThemeTermplan.getXnxq();
mybyThemeTermplan.setXnxq(xnxqNew);
mybyThemeTermplan.setStartmonth(null);
mybyThemeTermplan.setEndmonth(null);
list = byThemeTermplanService.selectByThemeTermplanList(mybyThemeTermplan);
// 判断是否存在当前学期计划
if (list != null && list.size() > 0) {
return AjaxResult.error("当前学年学期计划已经存在,无法创建学期计划");
}else {
int iCount = schoolCommon.getDifMonth(byThemeTermplan.getStartmonth(), byThemeTermplan.getEndmonth()); int iCount = schoolCommon.getDifMonth(byThemeTermplan.getStartmonth(), byThemeTermplan.getEndmonth());
System.out.println("月份差=" + iCount); System.out.println("月份差=" + iCount);
String uuid = schoolCommon.getUuid(); String uuid = schoolCommon.getUuid();
@ -115,6 +128,7 @@ public class ByThemeTermplanController extends BaseController {
byThemeTermplan.setClassid(classId); byThemeTermplan.setClassid(classId);
byThemeTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合学期计划"); 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();
@ -135,6 +149,7 @@ public class ByThemeTermplanController extends BaseController {
} }
return toAjax(byThemeTermplanService.insertByThemeTermplan(byThemeTermplan)); return toAjax(byThemeTermplanService.insertByThemeTermplan(byThemeTermplan));
}
} else { } else {
return AjaxResult.error("当前用户非幼儿园教师,无法创建计划"); return AjaxResult.error("当前用户非幼儿园教师,无法创建计划");
} }