园历优化了方法,增加教师生日以及合同等
This commit is contained in:
parent
b07db97087
commit
0446532dbb
@ -71,7 +71,7 @@ export default {
|
|||||||
},
|
},
|
||||||
calendarPlugins: [ // plugins must be defined in the JS
|
calendarPlugins: [ // plugins must be defined in the JS
|
||||||
dayGridPlugin,
|
dayGridPlugin,
|
||||||
// timeGridPlugin,
|
timeGridPlugin,
|
||||||
interactionPlugin,// needed for dateClick
|
interactionPlugin,// needed for dateClick
|
||||||
listPlugin
|
listPlugin
|
||||||
],
|
],
|
||||||
|
@ -2,16 +2,22 @@ package com.ruoyi.project.benyi.controller;
|
|||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ruoyi.project.benyi.domain.ByCalendarShow;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.project.benyi.domain.BySchoolcalendar;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.project.benyi.domain.BySchoolcalendarClass;
|
import com.ruoyi.framework.security.LoginUser;
|
||||||
|
import com.ruoyi.framework.security.service.TokenService;
|
||||||
|
import com.ruoyi.project.benyi.domain.*;
|
||||||
import com.ruoyi.project.benyi.service.IBySchoolcalendarClassService;
|
import com.ruoyi.project.benyi.service.IBySchoolcalendarClassService;
|
||||||
import com.ruoyi.project.benyi.service.IBySchoolcalendarService;
|
import com.ruoyi.project.benyi.service.IBySchoolcalendarService;
|
||||||
import com.ruoyi.project.common.SchoolCommon;
|
import com.ruoyi.project.common.SchoolCommon;
|
||||||
|
import com.ruoyi.project.system.domain.ByTeacherJbxx;
|
||||||
import com.ruoyi.project.system.domain.SysDictData;
|
import com.ruoyi.project.system.domain.SysDictData;
|
||||||
|
import com.ruoyi.project.system.domain.SysUser;
|
||||||
|
import com.ruoyi.project.system.service.IByTeacherJbxxService;
|
||||||
import com.ruoyi.project.system.service.ISysDictDataService;
|
import com.ruoyi.project.system.service.ISysDictDataService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -25,7 +31,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||||
import com.ruoyi.project.benyi.domain.ByCalendar;
|
|
||||||
import com.ruoyi.project.benyi.service.IByCalendarService;
|
import com.ruoyi.project.benyi.service.IByCalendarService;
|
||||||
import com.ruoyi.framework.web.controller.BaseController;
|
import com.ruoyi.framework.web.controller.BaseController;
|
||||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||||
@ -50,6 +55,10 @@ public class ByCalendarController extends BaseController
|
|||||||
private IBySchoolcalendarClassService bySchoolcalendarClassService;
|
private IBySchoolcalendarClassService bySchoolcalendarClassService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictDataService dictDataService;
|
private ISysDictDataService dictDataService;
|
||||||
|
@Autowired
|
||||||
|
private SchoolCommon schoolCommon;
|
||||||
|
@Autowired
|
||||||
|
private IByTeacherJbxxService byTeacherJbxxService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询园历管理(本一)列表
|
* 查询园历管理(本一)列表
|
||||||
@ -119,6 +128,9 @@ public class ByCalendarController extends BaseController
|
|||||||
return toAjax(byCalendarService.deleteByCalendarByIds(ids));
|
return toAjax(byCalendarService.deleteByCalendarByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园历展示(本一)
|
||||||
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendar:list')")
|
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendar:list')")
|
||||||
@GetMapping("/getAllSchoolCalendars")
|
@GetMapping("/getAllSchoolCalendars")
|
||||||
public AjaxResult getAllSchoolCalendars(ByCalendar byCalendar) {
|
public AjaxResult getAllSchoolCalendars(ByCalendar byCalendar) {
|
||||||
@ -146,10 +158,41 @@ public class ByCalendarController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//幼儿园登陆展示
|
||||||
|
if (schoolCommon.isSchool() == true){
|
||||||
|
Long schoolId = SecurityUtils.getLoginUser().getUser().getDeptId();
|
||||||
//根据不同的幼儿园加载幼儿园园历
|
//根据不同的幼儿园加载幼儿园园历
|
||||||
|
//(long)207
|
||||||
|
listvi.addAll(getbySchoolcalendars(schoolId,formatter,hashMap));
|
||||||
|
//根据不同的幼儿园加载幼儿园园历
|
||||||
|
listvi.addAll(getbyteacherBiths(schoolId,formatter,hashMap));
|
||||||
|
}
|
||||||
|
// listvi.addAll(getbySchoolcalendars((long)207,formatter,hashMap));
|
||||||
|
// listvi.addAll(getbyteacherBiths((long)207,formatter,hashMap));
|
||||||
|
|
||||||
|
//根据不同的班级记载班级园历
|
||||||
|
if (schoolCommon.getClassId()!=""){
|
||||||
|
//根据不同的班级加载班级园历
|
||||||
|
listvi.addAll(getbyclasses(schoolCommon.getClassId(),formatter,hashMap));
|
||||||
|
//根据班级加载幼儿生日
|
||||||
|
}
|
||||||
|
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("calendarData", listvi);
|
||||||
|
return ajax;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据不同的幼儿园加载幼儿园园历
|
||||||
|
*/
|
||||||
|
private List<ByCalendarShow> getbySchoolcalendars(Long schoolId,SimpleDateFormat formatter,HashMap<String, String> hashMap){
|
||||||
|
List<ByCalendarShow> listvi= new ArrayList<>();
|
||||||
|
|
||||||
BySchoolcalendar bySchoolcalendar = new BySchoolcalendar();
|
BySchoolcalendar bySchoolcalendar = new BySchoolcalendar();
|
||||||
//设置幼儿园
|
//设置幼儿园
|
||||||
//bySchoolcalendar.setDeptid();
|
bySchoolcalendar.setDeptid(schoolId);
|
||||||
|
|
||||||
List<BySchoolcalendar> bySchoolcalendarList = bySchoolcalendarService.selectBySchoolcalendarList(bySchoolcalendar);
|
List<BySchoolcalendar> bySchoolcalendarList = bySchoolcalendarService.selectBySchoolcalendarList(bySchoolcalendar);
|
||||||
if(bySchoolcalendarList.size()>0){
|
if(bySchoolcalendarList.size()>0){
|
||||||
for (BySchoolcalendar bsc:bySchoolcalendarList) {
|
for (BySchoolcalendar bsc:bySchoolcalendarList) {
|
||||||
@ -162,10 +205,75 @@ public class ByCalendarController extends BaseController
|
|||||||
listvi.add(by);
|
listvi.add(by);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//根据不同的班级记载班级园历
|
return listvi;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据不同的幼儿园加载教师生日
|
||||||
|
*/
|
||||||
|
private List<ByCalendarShow> getbyteacherBiths(Long schoolId,SimpleDateFormat formatter,HashMap<String, String> hashMap){
|
||||||
|
SysUser sysUser=new SysUser();
|
||||||
|
sysUser.setDeptId(schoolId);
|
||||||
|
ByTeacherJbxx byTeacherJbxx = new ByTeacherJbxx();
|
||||||
|
byTeacherJbxx.setUser(sysUser);
|
||||||
|
List<ByTeacherJbxx> listTeacherBirth = byTeacherJbxxService.selectByTeacherJbxxList(byTeacherJbxx);
|
||||||
|
|
||||||
|
List<ByCalendarShow> listvi= new ArrayList<>();
|
||||||
|
//系统内员工的生日、入职日期信息
|
||||||
|
System.out.println("listTeacherBirth.size()===" + listTeacherBirth.size());
|
||||||
|
if (listTeacherBirth != null && listTeacherBirth.size() > 0) {
|
||||||
|
for (int i = 0; i < listTeacherBirth.size(); i++) {
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
|
//创建一个教师实体类,并赋值
|
||||||
|
byTeacherJbxx=listTeacherBirth.get(i);
|
||||||
|
String strCurrentYear=schoolCommon.getCurrentYear();
|
||||||
|
System.out.println("当前年===" + strCurrentYear);
|
||||||
|
|
||||||
|
//参加工作日期
|
||||||
|
if(byTeacherJbxx.getCjgzrq()!=null){
|
||||||
|
String timefor = formatter.format(byTeacherJbxx.getCjgzrq());
|
||||||
|
timefor = timefor.replaceAll(timefor.split("-")[0],strCurrentYear);
|
||||||
|
|
||||||
|
ByCalendarShow by = new ByCalendarShow();
|
||||||
|
//by.setId((long)000);
|
||||||
|
by.setTitle(listTeacherBirth.get(i).getUser().getNickName()+"-合同满年期限");
|
||||||
|
by.setStart(timefor);
|
||||||
|
by.setEnd(timefor);
|
||||||
|
//教师生日颜色
|
||||||
|
by.setColor("aqua");
|
||||||
|
listvi.add(by);
|
||||||
|
System.out.println("当前年工作日期timefor===" + timefor+"====="+listTeacherBirth.get(i).getUser().getNickName()+"-合同满年期限");
|
||||||
|
}
|
||||||
|
//生日
|
||||||
|
if(byTeacherJbxx.getCsrq()!=null){
|
||||||
|
String timefor = formatter.format(byTeacherJbxx.getCjgzrq());
|
||||||
|
timefor = timefor.replaceAll(timefor.split("-")[0],strCurrentYear);
|
||||||
|
|
||||||
|
ByCalendarShow by = new ByCalendarShow();
|
||||||
|
//by.setId((long)000);
|
||||||
|
by.setTitle(listTeacherBirth.get(i).getUser().getNickName()+"-生日");
|
||||||
|
by.setStart(timefor);
|
||||||
|
by.setEnd(timefor);
|
||||||
|
//教师生日颜色
|
||||||
|
by.setColor("aqua");
|
||||||
|
listvi.add(by);
|
||||||
|
System.out.println("当前年生日timefor===" + timefor+"====="+listTeacherBirth.get(i).getUser().getNickName()+"-生日");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return listvi;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据不同的班级加载班级园历
|
||||||
|
*/
|
||||||
|
private List<ByCalendarShow> getbyclasses(String classlId,SimpleDateFormat formatter,HashMap<String, String> hashMap){
|
||||||
|
List<ByCalendarShow> listvi= new ArrayList<>();
|
||||||
|
|
||||||
BySchoolcalendarClass bySchoolcalendarClass = new BySchoolcalendarClass();
|
BySchoolcalendarClass bySchoolcalendarClass = new BySchoolcalendarClass();
|
||||||
//设置班级
|
//设置班级
|
||||||
//bySchoolcalendarClass.setClassid();
|
bySchoolcalendarClass.setClassid(classlId);
|
||||||
List<BySchoolcalendarClass> bySchoolcalendarClassList = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
|
List<BySchoolcalendarClass> bySchoolcalendarClassList = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
|
||||||
if(bySchoolcalendarClassList.size()>0){
|
if(bySchoolcalendarClassList.size()>0){
|
||||||
for (BySchoolcalendarClass bscc:bySchoolcalendarClassList) {
|
for (BySchoolcalendarClass bscc:bySchoolcalendarClassList) {
|
||||||
@ -178,11 +286,7 @@ public class ByCalendarController extends BaseController
|
|||||||
listvi.add(by);
|
listvi.add(by);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return listvi;
|
||||||
|
}
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("calendarData", listvi);
|
|
||||||
return ajax;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user