日历增加幼儿园与班级园历显示
This commit is contained in:
parent
19adac723d
commit
b07db97087
@ -77,11 +77,11 @@ export default {
|
|||||||
],
|
],
|
||||||
calendarWeekends: true,
|
calendarWeekends: true,
|
||||||
calendarEvents: [ // initial event data
|
calendarEvents: [ // initial event data
|
||||||
{
|
// {
|
||||||
title: 'Event Now',
|
// title: 'Event Now',
|
||||||
start: new Date(),
|
// start: new Date(),
|
||||||
color: '#A61000'
|
// color: '#A61000'
|
||||||
}
|
// }
|
||||||
],
|
],
|
||||||
calendarApi: null,
|
calendarApi: null,
|
||||||
calendarData: [],
|
calendarData: [],
|
||||||
|
@ -2,9 +2,17 @@ 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.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ruoyi.project.benyi.domain.ByCalendarShow;
|
import com.ruoyi.project.benyi.domain.ByCalendarShow;
|
||||||
|
import com.ruoyi.project.benyi.domain.BySchoolcalendar;
|
||||||
|
import com.ruoyi.project.benyi.domain.BySchoolcalendarClass;
|
||||||
|
import com.ruoyi.project.benyi.service.IBySchoolcalendarClassService;
|
||||||
|
import com.ruoyi.project.benyi.service.IBySchoolcalendarService;
|
||||||
|
import com.ruoyi.project.common.SchoolCommon;
|
||||||
|
import com.ruoyi.project.system.domain.SysDictData;
|
||||||
|
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;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -36,6 +44,12 @@ public class ByCalendarController extends BaseController
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private IByCalendarService byCalendarService;
|
private IByCalendarService byCalendarService;
|
||||||
|
@Autowired
|
||||||
|
private IBySchoolcalendarService bySchoolcalendarService;
|
||||||
|
@Autowired
|
||||||
|
private IBySchoolcalendarClassService bySchoolcalendarClassService;
|
||||||
|
@Autowired
|
||||||
|
private ISysDictDataService dictDataService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询园历管理(本一)列表
|
* 查询园历管理(本一)列表
|
||||||
@ -108,25 +122,62 @@ public class ByCalendarController extends BaseController
|
|||||||
@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) {
|
||||||
|
//将类型颜色样式加载到字典
|
||||||
|
HashMap<String, String> hashMap = new HashMap<>();
|
||||||
|
for (SysDictData calendartype : dictDataService.selectDictDataByType("sys_schoolcalendartype")) {
|
||||||
|
System.out.println("====sys_yebjlx.getDictValue()"+calendartype.getDictValue());
|
||||||
|
System.out.println("=====calendartype.getCssClass()"+calendartype.getCssClass());
|
||||||
|
hashMap.put(calendartype.getDictValue(),calendartype.getCssClass());
|
||||||
|
}
|
||||||
|
//定义返回列表
|
||||||
List<ByCalendarShow> listvi= new ArrayList<>();
|
List<ByCalendarShow> listvi= new ArrayList<>();
|
||||||
SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
//加载本一园历
|
//加载本一园历
|
||||||
List<ByCalendar> list = byCalendarService.selectByCalendarList(byCalendar);
|
List<ByCalendar> list = byCalendarService.selectByCalendarList(byCalendar);
|
||||||
|
if(list.size()>0){
|
||||||
for (ByCalendar calendar:list) {
|
for (ByCalendar calendar:list) {
|
||||||
ByCalendarShow by = new ByCalendarShow();
|
ByCalendarShow by = new ByCalendarShow();
|
||||||
by.setId(calendar.getId());
|
by.setId(calendar.getId());
|
||||||
by.setTitle(calendar.getName());
|
by.setTitle(calendar.getName());
|
||||||
by.setStart(formatter.format(calendar.getActivitytime()));
|
by.setStart(formatter.format(calendar.getActivitytime()));
|
||||||
by.setEnd(formatter.format(calendar.getActivityendtime()));
|
by.setEnd(formatter.format(calendar.getActivityendtime()));
|
||||||
by.setColor(calendar.getStylecolor());
|
by.setColor(hashMap.get(calendar.getType()));
|
||||||
listvi.add(by);
|
listvi.add(by);
|
||||||
}
|
}
|
||||||
//加载幼儿园园历
|
}
|
||||||
|
|
||||||
//接在班级园历
|
|
||||||
|
|
||||||
|
//根据不同的幼儿园加载幼儿园园历
|
||||||
|
BySchoolcalendar bySchoolcalendar = new BySchoolcalendar();
|
||||||
|
//设置幼儿园
|
||||||
|
//bySchoolcalendar.setDeptid();
|
||||||
|
List<BySchoolcalendar> bySchoolcalendarList = bySchoolcalendarService.selectBySchoolcalendarList(bySchoolcalendar);
|
||||||
|
if(bySchoolcalendarList.size()>0){
|
||||||
|
for (BySchoolcalendar bsc:bySchoolcalendarList) {
|
||||||
|
ByCalendarShow by = new ByCalendarShow();
|
||||||
|
by.setId(bsc.getId());
|
||||||
|
by.setTitle(bsc.getName());
|
||||||
|
by.setStart(formatter.format(bsc.getActivitytime()));
|
||||||
|
by.setEnd(formatter.format(bsc.getActivityendtime()));
|
||||||
|
by.setColor(hashMap.get(bsc.getType()));
|
||||||
|
listvi.add(by);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//根据不同的班级记载班级园历
|
||||||
|
BySchoolcalendarClass bySchoolcalendarClass = new BySchoolcalendarClass();
|
||||||
|
//设置班级
|
||||||
|
//bySchoolcalendarClass.setClassid();
|
||||||
|
List<BySchoolcalendarClass> bySchoolcalendarClassList = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
|
||||||
|
if(bySchoolcalendarClassList.size()>0){
|
||||||
|
for (BySchoolcalendarClass bscc:bySchoolcalendarClassList) {
|
||||||
|
ByCalendarShow by = new ByCalendarShow();
|
||||||
|
by.setId(bscc.getId());
|
||||||
|
by.setTitle(bscc.getName());
|
||||||
|
by.setStart(formatter.format(bscc.getActivitytime()));
|
||||||
|
by.setEnd(formatter.format(bscc.getActivityendtime()));
|
||||||
|
by.setColor(hashMap.get(bscc.getType()));
|
||||||
|
listvi.add(by);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
@ -44,6 +44,18 @@ public class BySchoolcalendarClass extends BaseEntity
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date activitytime;
|
private Date activitytime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "活动结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date activityendtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动样式颜色
|
||||||
|
*/
|
||||||
|
@Excel(name = "活动样式颜色")
|
||||||
|
private String stylecolor;
|
||||||
|
|
||||||
/** 创建人 */
|
/** 创建人 */
|
||||||
@Excel(name = "创建人")
|
@Excel(name = "创建人")
|
||||||
private Long createuserid;
|
private Long createuserid;
|
||||||
@ -114,6 +126,20 @@ public class BySchoolcalendarClass extends BaseEntity
|
|||||||
this.activitytime = activitytime;
|
this.activitytime = activitytime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setActivityendtime(Date activityendtime) {
|
||||||
|
this.activityendtime = activityendtime;
|
||||||
|
}
|
||||||
|
public Date getActivityendtime() {
|
||||||
|
return activityendtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStylecolor(String stylecolor) {
|
||||||
|
this.stylecolor = stylecolor;
|
||||||
|
}
|
||||||
|
public String getStylecolor() {
|
||||||
|
return stylecolor;
|
||||||
|
}
|
||||||
|
|
||||||
public Date getActivitytime()
|
public Date getActivitytime()
|
||||||
{
|
{
|
||||||
return activitytime;
|
return activitytime;
|
||||||
@ -140,6 +166,8 @@ public class BySchoolcalendarClass extends BaseEntity
|
|||||||
.append("xnxq", getXnxq())
|
.append("xnxq", getXnxq())
|
||||||
.append("deptid", getDeptid())
|
.append("deptid", getDeptid())
|
||||||
.append("activitytime", getActivitytime())
|
.append("activitytime", getActivitytime())
|
||||||
|
.append("activityendtime", getActivityendtime())
|
||||||
|
.append("stylecolor", getStylecolor())
|
||||||
.append("createuserid", getCreateuserid())
|
.append("createuserid", getCreateuserid())
|
||||||
.append("createtime", getCreatetime())
|
.append("createtime", getCreatetime())
|
||||||
.toString();
|
.toString();
|
||||||
|
@ -12,12 +12,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="xnxq" column="xnxq" />
|
<result property="xnxq" column="xnxq" />
|
||||||
<result property="deptid" column="deptId" />
|
<result property="deptid" column="deptId" />
|
||||||
<result property="activitytime" column="activitytime" />
|
<result property="activitytime" column="activitytime" />
|
||||||
|
<result property="activityendtime" column="activityendtime" />
|
||||||
|
<result property="stylecolor" column="stylecolor" />
|
||||||
<result property="createuserid" column="createuserid" />
|
<result property="createuserid" column="createuserid" />
|
||||||
<result property="createtime" column="createtime" />
|
<result property="createtime" column="createtime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectBySchoolcalendarClassVo">
|
<sql id="selectBySchoolcalendarClassVo">
|
||||||
select id, name, type, classid, xnxq, deptId, activitytime, createuserid, createtime from by_schoolcalendar_class
|
select id, name, type, classid, xnxq, deptId, activitytime, activityendtime, stylecolor, createuserid, createtime from by_schoolcalendar_class
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult">
|
<select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult">
|
||||||
@ -29,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="xnxq != null and xnxq != ''"> and xnxq = #{xnxq}</if>
|
<if test="xnxq != null and xnxq != ''"> and xnxq = #{xnxq}</if>
|
||||||
<if test="deptid != null "> and deptId = #{deptid}</if>
|
<if test="deptid != null "> and deptId = #{deptid}</if>
|
||||||
<if test="activitytime != null "> and activitytime = #{activitytime}</if>
|
<if test="activitytime != null "> and activitytime = #{activitytime}</if>
|
||||||
|
<if test="activityendtime != null "> and activityendtime = #{activityendtime}</if>
|
||||||
|
<if test="stylecolor != null and stylecolor != ''"> and stylecolor = #{stylecolor}</if>
|
||||||
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
|
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
|
||||||
<if test="createtime != null "> and createtime = #{createtime}</if>
|
<if test="createtime != null "> and createtime = #{createtime}</if>
|
||||||
</where>
|
</where>
|
||||||
@ -49,6 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="xnxq != null and xnxq != ''">xnxq,</if>
|
<if test="xnxq != null and xnxq != ''">xnxq,</if>
|
||||||
<if test="deptid != null ">deptId,</if>
|
<if test="deptid != null ">deptId,</if>
|
||||||
<if test="activitytime != null ">activitytime,</if>
|
<if test="activitytime != null ">activitytime,</if>
|
||||||
|
<if test="activityendtime != null ">activityendtime,</if>
|
||||||
|
<if test="stylecolor != null and stylecolor != ''">stylecolor,</if>
|
||||||
<if test="createuserid != null ">createuserid,</if>
|
<if test="createuserid != null ">createuserid,</if>
|
||||||
<if test="createtime != null ">createtime,</if>
|
<if test="createtime != null ">createtime,</if>
|
||||||
</trim>
|
</trim>
|
||||||
@ -60,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="xnxq != null and xnxq != ''">#{xnxq},</if>
|
<if test="xnxq != null and xnxq != ''">#{xnxq},</if>
|
||||||
<if test="deptid != null ">#{deptid},</if>
|
<if test="deptid != null ">#{deptid},</if>
|
||||||
<if test="activitytime != null ">#{activitytime},</if>
|
<if test="activitytime != null ">#{activitytime},</if>
|
||||||
|
<if test="activityendtime != null ">#{activityendtime},</if>
|
||||||
|
<if test="stylecolor != null and stylecolor != ''">#{stylecolor},</if>
|
||||||
<if test="createuserid != null ">#{createuserid},</if>
|
<if test="createuserid != null ">#{createuserid},</if>
|
||||||
<if test="createtime != null ">#{createtime},</if>
|
<if test="createtime != null ">#{createtime},</if>
|
||||||
</trim>
|
</trim>
|
||||||
@ -74,6 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="xnxq != null and xnxq != ''">xnxq = #{xnxq},</if>
|
<if test="xnxq != null and xnxq != ''">xnxq = #{xnxq},</if>
|
||||||
<if test="deptid != null ">deptId = #{deptid},</if>
|
<if test="deptid != null ">deptId = #{deptid},</if>
|
||||||
<if test="activitytime != null ">activitytime = #{activitytime},</if>
|
<if test="activitytime != null ">activitytime = #{activitytime},</if>
|
||||||
|
<if test="activityendtime != null ">activityendtime = #{activityendtime},</if>
|
||||||
|
<if test="stylecolor != null and stylecolor != ''">stylecolor = #{stylecolor},</if>
|
||||||
<if test="createuserid != null ">createuserid = #{createuserid},</if>
|
<if test="createuserid != null ">createuserid = #{createuserid},</if>
|
||||||
<if test="createtime != null ">createtime = #{createtime},</if>
|
<if test="createtime != null ">createtime = #{createtime},</if>
|
||||||
</trim>
|
</trim>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user