班级园历教师生日和幼儿生日提醒
This commit is contained in:
		| @@ -59,6 +59,8 @@ public class ByCalendarController extends BaseController { | ||||
|     private IByThemeWeekplanitemService byThemeWeekplanitemService; | ||||
|     @Autowired | ||||
|     private IByThemeActivityService byThemeActivityService; | ||||
|     @Autowired | ||||
|     private IByChildService byChildService; | ||||
|  | ||||
|     /** | ||||
|      * 查询园历管理(本一)列表 | ||||
| @@ -169,12 +171,14 @@ public class ByCalendarController extends BaseController { | ||||
| //        listvi.addAll(getbyteacherBiths((long)207,formatter,hashMap)); | ||||
|  | ||||
|         //根据不同的班级记载班级园历 | ||||
|         if (!schoolCommon.isStringEmpty(schoolCommon.getClassId())) { | ||||
|         String classId = schoolCommon.getClassId(); | ||||
|         if (!schoolCommon.isStringEmpty(classId)) { | ||||
|             //根据不同的班级加载班级园历 | ||||
|             listvi.addAll(getbyclasses(schoolCommon.getClassId(), formatter, hashMap)); | ||||
|             listvi.addAll(getbyclasses(classId, formatter, hashMap)); | ||||
|             //加载主题整合活动 | ||||
|             listvi.addAll(getbyclassthemes(schoolCommon.getClassId(), formatter, hashMap)); | ||||
|             listvi.addAll(getbyclassthemes(classId, formatter, hashMap)); | ||||
|             //根据班级加载幼儿生日 | ||||
|             listvi.addAll(getbychilds(classId, formatter)); | ||||
|         } | ||||
|  | ||||
|         AjaxResult ajax = AjaxResult.success(); | ||||
| @@ -248,7 +252,7 @@ public class ByCalendarController extends BaseController { | ||||
|                 } | ||||
|                 //生日 | ||||
|                 if (byTeacherJbxx.getCsrq() != null) { | ||||
|                     String timefor = formatter.format(byTeacherJbxx.getCjgzrq()); | ||||
|                     String timefor = formatter.format(byTeacherJbxx.getCsrq()); | ||||
|                     timefor = timefor.replaceAll(timefor.split("-")[0], strCurrentYear); | ||||
|  | ||||
|                     ByCalendarShow by = new ByCalendarShow(); | ||||
| @@ -344,4 +348,37 @@ public class ByCalendarController extends BaseController { | ||||
|         return listvi; | ||||
|     } | ||||
|  | ||||
|     //获取班级幼儿生日列表 | ||||
|     private List<ByCalendarShow> getbychilds(String classId, SimpleDateFormat formatter) { | ||||
|         List<ByCalendarShow> listvi = new ArrayList<>(); | ||||
|  | ||||
|         Long deptId = SecurityUtils.getLoginUser().getUser().getDept().getDeptId(); | ||||
|         ByChild byChild = new ByChild(); | ||||
|         byChild.setSchoolid(deptId); | ||||
|         byChild.setClassid(classId); | ||||
|         byChild.setStatus("0"); | ||||
|         List<ByChild> list = byChildService.selectByChildList(byChild); | ||||
|         if (list != null && list.size() > 0) { | ||||
|             String strCurrentYear = schoolCommon.getCurrentYear(); | ||||
|             ByCalendarShow by = null; | ||||
|             for (int i = 0; i < list.size(); i++) { | ||||
|                 by = new ByCalendarShow(); | ||||
|                 ByChild byNewChild = list.get(i); | ||||
|                 if (byNewChild.getCsrq() != null) { | ||||
|                     by.setId(byNewChild.getId()); | ||||
|                     by.setTitle(byNewChild.getName() + "-生日"); | ||||
|  | ||||
|                     String timefor = formatter.format(byNewChild.getCsrq()); | ||||
|                     timefor = timefor.replaceAll(timefor.split("-")[0], strCurrentYear); | ||||
|  | ||||
|                     by.setStart(timefor); | ||||
|                     by.setEnd(timefor); | ||||
|                     by.setColor("#b37feb"); | ||||
|                     listvi.add(by); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         return listvi; | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -56,8 +56,9 @@ public class ByChildCheckinDetailController extends BaseController { | ||||
|  | ||||
|         byChildCheckinDetail.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); | ||||
|         //判断是否为班主任 | ||||
|         if (!schoolCommon.isStringEmpty(schoolCommon.getClassId())) { | ||||
|             byChildCheckinDetail.setClassid(schoolCommon.getClassId()); | ||||
|         String classId = schoolCommon.getClassId(); | ||||
|         if (!schoolCommon.isStringEmpty(classId)) { | ||||
|             byChildCheckinDetail.setClassid(classId); | ||||
|         } | ||||
|  | ||||
|         List<ByChildCheckinDetail> list = byChildCheckinDetailService.selectByChildCheckinDetailList(byChildCheckinDetail); | ||||
|   | ||||
| @@ -46,8 +46,9 @@ public class ByChildContactpeopleController extends BaseController { | ||||
|         startPage(); | ||||
|         byChildContactpeople.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); | ||||
|         //判断是否为班主任 | ||||
|         if (!schoolCommon.isStringEmpty(schoolCommon.getClassId())) { | ||||
|             byChildContactpeople.setClassid(schoolCommon.getClassId()); | ||||
|         String classId = schoolCommon.getClassId(); | ||||
|         if (!schoolCommon.isStringEmpty(classId)) { | ||||
|             byChildContactpeople.setClassid(classId); | ||||
|         } | ||||
|         List<ByChildContactpeople> list = byChildContactpeopleService.selectByChildContactpeopleList(byChildContactpeople); | ||||
|         return getDataTable(list); | ||||
|   | ||||
| @@ -46,8 +46,9 @@ public class ByChildController extends BaseController { | ||||
|         startPage(); | ||||
|         byChild.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); | ||||
|         //判断是否为班主任 | ||||
|         if (!schoolCommon.isStringEmpty(schoolCommon.getClassId())) { | ||||
|             byChild.setClassid(schoolCommon.getClassId()); | ||||
|         String classId = schoolCommon.getClassId(); | ||||
|         if (!schoolCommon.isStringEmpty(classId) && classId != "-1") { | ||||
|             byChild.setClassid(classId); | ||||
|         } | ||||
|         List<ByChild> list = byChildService.selectByChildList(byChild); | ||||
|         return getDataTable(list); | ||||
| @@ -61,9 +62,10 @@ public class ByChildController extends BaseController { | ||||
|     public TableDataInfo listByCheck(ByChild byChild) { | ||||
|         byChild.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); | ||||
|         //判断是否为班主任 | ||||
|         System.out.println(schoolCommon.getClassId()); | ||||
|         if (!schoolCommon.isStringEmpty(schoolCommon.getClassId())) { | ||||
|             byChild.setClassid(schoolCommon.getClassId()); | ||||
|         //System.out.println(schoolCommon.getClassId()); | ||||
|         String classId = schoolCommon.getClassId(); | ||||
|         if (!schoolCommon.isStringEmpty(classId) && classId != "-1") { | ||||
|             byChild.setClassid(classId); | ||||
|         } | ||||
|         List<ByChild> list = byChildService.selectByCheckList(byChild); | ||||
|         return getDataTable(list); | ||||
|   | ||||
| @@ -27,14 +27,13 @@ import com.ruoyi.framework.web.page.TableDataInfo; | ||||
|  | ||||
| /** | ||||
|  * 园历管理(班级)Controller | ||||
|  *  | ||||
|  * | ||||
|  * @author tsbz | ||||
|  * @date 2020-05-06 | ||||
|  */ | ||||
| @RestController | ||||
| @RequestMapping("/benyi/schoolcalendarclass") | ||||
| public class BySchoolcalendarClassController extends BaseController | ||||
| { | ||||
| public class BySchoolcalendarClassController extends BaseController { | ||||
|     @Autowired | ||||
|     private IBySchoolcalendarClassService bySchoolcalendarClassService; | ||||
|  | ||||
| @@ -47,17 +46,16 @@ public class BySchoolcalendarClassController extends BaseController | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:list')") | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo list(BySchoolcalendarClass bySchoolcalendarClass) | ||||
|     { | ||||
|     public TableDataInfo list(BySchoolcalendarClass bySchoolcalendarClass) { | ||||
|         String strClassId = schoolCommon.getClassId(); | ||||
|         if(!schoolCommon.isStringEmpty(strClassId)){ | ||||
|         if (!schoolCommon.isStringEmpty(strClassId)) { | ||||
|             startPage(); | ||||
|             bySchoolcalendarClass.setClassid(strClassId); | ||||
|             List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass); | ||||
|             //System.out.println("---------------------分页"+list); | ||||
|             return getDataTable(list); | ||||
|         }else{ | ||||
|             List<BySchoolcalendarClass> list =new ArrayList<>(); | ||||
|         } else { | ||||
|             List<BySchoolcalendarClass> list = new ArrayList<>(); | ||||
|             return getDataTable(list); | ||||
|         } | ||||
|  | ||||
| @@ -68,8 +66,7 @@ public class BySchoolcalendarClassController extends BaseController | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:list')") | ||||
|     @GetMapping("/listAll") | ||||
|     public TableDataInfo listAll(BySchoolcalendarClass bySchoolcalendarClass) | ||||
|     { | ||||
|     public TableDataInfo listAll(BySchoolcalendarClass bySchoolcalendarClass) { | ||||
|         List<BySchoolcalendarClass> listAll = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass); | ||||
|         //System.out.println("---------------------没有分页"+listAll); | ||||
|         return getDataTable(listAll); | ||||
| @@ -81,8 +78,7 @@ public class BySchoolcalendarClassController extends BaseController | ||||
|     @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:export')") | ||||
|     @Log(title = "园历管理(班级)", businessType = BusinessType.EXPORT) | ||||
|     @GetMapping("/export") | ||||
|     public AjaxResult export(BySchoolcalendarClass bySchoolcalendarClass) | ||||
|     { | ||||
|     public AjaxResult export(BySchoolcalendarClass bySchoolcalendarClass) { | ||||
|         List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass); | ||||
|         ExcelUtil<BySchoolcalendarClass> util = new ExcelUtil<BySchoolcalendarClass>(BySchoolcalendarClass.class); | ||||
|         return util.exportExcel(list, "schoolcalendarclass"); | ||||
| @@ -93,8 +89,7 @@ public class BySchoolcalendarClassController extends BaseController | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:query')") | ||||
|     @GetMapping(value = "/{id}") | ||||
|     public AjaxResult getInfo(@PathVariable("id") Long id) | ||||
|     { | ||||
|     public AjaxResult getInfo(@PathVariable("id") Long id) { | ||||
|         return AjaxResult.success(bySchoolcalendarClassService.selectBySchoolcalendarClassById(id)); | ||||
|     } | ||||
|  | ||||
| @@ -104,11 +99,10 @@ public class BySchoolcalendarClassController extends BaseController | ||||
|     @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:add')") | ||||
|     @Log(title = "园历管理(班级)", businessType = BusinessType.INSERT) | ||||
|     @PostMapping | ||||
|     public AjaxResult add(@RequestBody BySchoolcalendarClass bySchoolcalendarClass) | ||||
|     { | ||||
|     public AjaxResult add(@RequestBody BySchoolcalendarClass bySchoolcalendarClass) { | ||||
|         String strClassId = schoolCommon.getClassId(); | ||||
|         //判断当前用户是否有班级 | ||||
|         if(!schoolCommon.isStringEmpty(strClassId)) { | ||||
|         if (!schoolCommon.isStringEmpty(strClassId)) { | ||||
|             //设置创建时间为当前时间 | ||||
|             bySchoolcalendarClass.setCreatetime(new Date()); | ||||
|             //设置学年信息  从学校公共类调取方法 传入活动时间进行判断 | ||||
| @@ -119,7 +113,7 @@ public class BySchoolcalendarClassController extends BaseController | ||||
|             bySchoolcalendarClass.setDeptid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); | ||||
|             bySchoolcalendarClass.setClassid(strClassId); | ||||
|             return toAjax(bySchoolcalendarClassService.insertBySchoolcalendarClass(bySchoolcalendarClass)); | ||||
|         }else { | ||||
|         } else { | ||||
|             return AjaxResult.error("当前用户下没有班级,无法创建园历"); | ||||
|         } | ||||
|  | ||||
| @@ -131,11 +125,10 @@ public class BySchoolcalendarClassController extends BaseController | ||||
|     @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:edit')") | ||||
|     @Log(title = "园历管理(班级)", businessType = BusinessType.UPDATE) | ||||
|     @PutMapping | ||||
|     public AjaxResult edit(@RequestBody BySchoolcalendarClass bySchoolcalendarClass) | ||||
|     { | ||||
|         if(!schoolCommon.isStringEmpty(schoolCommon.getClassId())){ | ||||
|     public AjaxResult edit(@RequestBody BySchoolcalendarClass bySchoolcalendarClass) { | ||||
|         if (!schoolCommon.isStringEmpty(schoolCommon.getClassId())) { | ||||
|             return toAjax(bySchoolcalendarClassService.updateBySchoolcalendarClass(bySchoolcalendarClass)); | ||||
|         }else{ | ||||
|         } else { | ||||
|             return AjaxResult.error("当前用户下没有班级,无法修改园历"); | ||||
|         } | ||||
|     } | ||||
| @@ -145,13 +138,12 @@ public class BySchoolcalendarClassController extends BaseController | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:remove')") | ||||
|     @Log(title = "园历管理(班级)", businessType = BusinessType.DELETE) | ||||
| 	@DeleteMapping("/{ids}") | ||||
|     public AjaxResult remove(@PathVariable Long[] ids) | ||||
|     { | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public AjaxResult remove(@PathVariable Long[] ids) { | ||||
|         //判断当前用户下是否有班级 | ||||
|         if(!schoolCommon.isStringEmpty(schoolCommon.getClassId())) { | ||||
|         if (!schoolCommon.isStringEmpty(schoolCommon.getClassId())) { | ||||
|             return toAjax(bySchoolcalendarClassService.deleteBySchoolcalendarClassByIds(ids)); | ||||
|         }else { | ||||
|         } else { | ||||
|             return AjaxResult.error("当前用户下没有班级,无法删除园历"); | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -3,10 +3,7 @@ package com.ruoyi.project.common; | ||||
| import com.ruoyi.common.utils.SecurityUtils; | ||||
| import com.ruoyi.framework.security.LoginUser; | ||||
| import com.ruoyi.framework.web.domain.server.Sys; | ||||
| import com.ruoyi.project.system.domain.ByClass; | ||||
| import com.ruoyi.project.system.domain.BySchool; | ||||
| import com.ruoyi.project.system.domain.SysDept; | ||||
| import com.ruoyi.project.system.domain.SysUser; | ||||
| import com.ruoyi.project.system.domain.*; | ||||
| import com.ruoyi.project.system.service.IByClassService; | ||||
| import com.ruoyi.project.system.service.IBySchoolService; | ||||
| import com.ruoyi.project.system.service.ISysDeptService; | ||||
| @@ -101,6 +98,7 @@ public class SchoolCommon { | ||||
|      * 判断当前用户是否拥有班级 | ||||
|      **/ | ||||
|     public String getClassId() { | ||||
|         String strClassId = "-1"; | ||||
|         SysUser sysUser = getUser(); | ||||
|         ByClass byClass = new ByClass(); | ||||
|         //根据用户id来设置主班教师,配班教师,助理教师的教师id | ||||
| @@ -114,8 +112,26 @@ public class SchoolCommon { | ||||
|             //如果实体byclassnew不为空,那么取出它的班级编号 | ||||
|             return byClassNew.getBjbh(); | ||||
|         } else { | ||||
|             return ""; | ||||
| //            //如果为空 确认当前用户的角色是否为班长、配班、助理、实习教师 | ||||
| //            List<SysRole> listRole = SecurityUtils.getLoginUser().getUser().getRoles(); | ||||
| //            if (listRole != null && listRole.size() > 0) { | ||||
| //                for (int i = 0; i < listRole.size(); i++) { | ||||
| //                    System.out.println(listRole.get(i).getRoleId() == (102)); | ||||
| //                    //为班长、配班、助理、实习教师 | ||||
| //                    if (listRole.get(i).getRoleId() == 102 || listRole.get(i).getRoleId() == 104 || listRole.get(i).getRoleId() == 105 || listRole.get(i).getRoleId() == 105) { | ||||
| //                        System.out.println("未设置当前账户所在班级"); | ||||
| //                        strClassId = "-1"; | ||||
| //                    } else { | ||||
| //                        strClassId = ""; | ||||
| //                        break; | ||||
| //                    } | ||||
| //                } | ||||
| //            } else { | ||||
| //                //没设置角色 | ||||
| //                strClassId = "-1"; | ||||
| //            } | ||||
|         } | ||||
|         return ""; | ||||
|     } | ||||
|  | ||||
|     public String getCurrentXnXq() { | ||||
|   | ||||
| @@ -5,6 +5,8 @@ import java.util.List; | ||||
| import java.util.UUID; | ||||
|  | ||||
| import com.ruoyi.common.utils.SecurityUtils; | ||||
| import com.ruoyi.project.benyi.domain.ByChild; | ||||
| import com.ruoyi.project.benyi.service.IByChildService; | ||||
| import com.ruoyi.project.common.SchoolCommon; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -38,6 +40,9 @@ public class ByClassController extends BaseController { | ||||
|     private IByClassService byClassService; | ||||
|     @Autowired | ||||
|     private SchoolCommon schoolCommon; | ||||
|     @Autowired | ||||
|     private IByChildService byChildService; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 查询班级信息列表 | ||||
| @@ -52,7 +57,7 @@ public class ByClassController extends BaseController { | ||||
|         if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) { | ||||
|             byClass.setBjbh(classId); | ||||
|             list = byClassService.selectByClassList(byClass); | ||||
|         }else{ | ||||
|         } else { | ||||
|             list = byClassService.selectByClassList(byClass); | ||||
|         } | ||||
|  | ||||
| @@ -199,7 +204,7 @@ public class ByClassController extends BaseController { | ||||
|     public AjaxResult deljs(@PathVariable String bjbhs) { | ||||
|         //首先判断 当前用户是否为学校 | ||||
|         if (schoolCommon.isSchool()) { | ||||
|             ByClass byClass=byClassService.selectByClassById(bjbhs); | ||||
|             ByClass byClass = byClassService.selectByClassById(bjbhs); | ||||
|             byClass.setZbjs(null); | ||||
|             byClass.setPbjs(null); | ||||
|             byClass.setZljs(null); | ||||
| @@ -218,6 +223,19 @@ public class ByClassController extends BaseController { | ||||
|     public AjaxResult remove(@PathVariable String[] bjbhs) { | ||||
|         //首先判断 当前用户是否为学校 | ||||
|         if (schoolCommon.isSchool()) { | ||||
|  | ||||
|             //判断班级下 是否存在幼儿信息 | ||||
|             if (bjbhs.length > 0) { | ||||
|                 for (int i = 0; i < bjbhs.length; i++) { | ||||
|                     ByChild byChild = new ByChild(); | ||||
|                     byChild.setClassid(bjbhs[i]); | ||||
|                     List<ByChild> list = byChildService.selectByChildList(byChild); | ||||
|                     if (list != null && list.size() > 0) { | ||||
|                         return AjaxResult.error("当前班级存在幼儿信息,无法删除班级"); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             return toAjax(byClassService.deleteByClassByIds(bjbhs)); | ||||
|         } | ||||
|         return AjaxResult.error("当前用户非幼儿园,无法删除班级"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user