修改主题整合学期计划创建学期限制
This commit is contained in:
		| @@ -215,7 +215,7 @@ export default { | ||||
|     //主题活动 | ||||
|     getThemeActivityList(themeid) { | ||||
|       listActivityByThemeId(themeid).then((response) => { | ||||
|         //console.log(response.rows); | ||||
|         console.log(response.rows); | ||||
|         this.themeactivityOptions = response.rows; | ||||
|       }); | ||||
|     }, | ||||
|   | ||||
| @@ -106,35 +106,50 @@ public class ByThemeTermplanController extends BaseController { | ||||
|         String classId = schoolCommon.getClassId(); | ||||
|         //首先判断当前账户是否为幼儿园账号 | ||||
|         if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) { | ||||
|             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()); | ||||
|             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()); | ||||
|                 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()); | ||||
| //                //月份加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("当前用户非幼儿园教师,无法创建计划"); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user