日历增加幼儿园与班级园历显示
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;
|
||||||
@ -26,7 +34,7 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 园历管理(本一)Controller
|
* 园历管理(本一)Controller
|
||||||
*
|
*
|
||||||
* @author tsbz
|
* @author tsbz
|
||||||
* @date 2020-05-10
|
* @date 2020-05-10
|
||||||
*/
|
*/
|
||||||
@ -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);
|
||||||
for (ByCalendar calendar:list) {
|
if(list.size()>0){
|
||||||
ByCalendarShow by = new ByCalendarShow();
|
for (ByCalendar calendar:list) {
|
||||||
by.setId(calendar.getId());
|
ByCalendarShow by = new ByCalendarShow();
|
||||||
by.setTitle(calendar.getName());
|
by.setId(calendar.getId());
|
||||||
by.setStart(formatter.format(calendar.getActivitytime()));
|
by.setTitle(calendar.getName());
|
||||||
by.setEnd(formatter.format(calendar.getActivityendtime()));
|
by.setStart(formatter.format(calendar.getActivitytime()));
|
||||||
by.setColor(calendar.getStylecolor());
|
by.setEnd(formatter.format(calendar.getActivityendtime()));
|
||||||
listvi.add(by);
|
by.setColor(hashMap.get(calendar.getType()));
|
||||||
|
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();
|
||||||
|
@ -9,7 +9,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 园历管理(班级)对象 by_schoolcalendar_class
|
* 园历管理(班级)对象 by_schoolcalendar_class
|
||||||
*
|
*
|
||||||
* @author tsbz
|
* @author tsbz
|
||||||
* @date 2020-05-06
|
* @date 2020-05-06
|
||||||
*/
|
*/
|
||||||
@ -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;
|
||||||
@ -55,75 +67,89 @@ public class BySchoolcalendarClass extends BaseEntity
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId()
|
public Long getId()
|
||||||
{
|
{
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
public void setName(String name)
|
public void setName(String name)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
public void setType(String type)
|
public void setType(String type)
|
||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getType()
|
public String getType()
|
||||||
{
|
{
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
public void setClassid(String classid)
|
public void setClassid(String classid)
|
||||||
{
|
{
|
||||||
this.classid = classid;
|
this.classid = classid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClassid()
|
public String getClassid()
|
||||||
{
|
{
|
||||||
return classid;
|
return classid;
|
||||||
}
|
}
|
||||||
public void setXnxq(String xnxq)
|
public void setXnxq(String xnxq)
|
||||||
{
|
{
|
||||||
this.xnxq = xnxq;
|
this.xnxq = xnxq;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getXnxq()
|
public String getXnxq()
|
||||||
{
|
{
|
||||||
return xnxq;
|
return xnxq;
|
||||||
}
|
}
|
||||||
public void setDeptid(Long deptid)
|
public void setDeptid(Long deptid)
|
||||||
{
|
{
|
||||||
this.deptid = deptid;
|
this.deptid = deptid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDeptid()
|
public Long getDeptid()
|
||||||
{
|
{
|
||||||
return deptid;
|
return deptid;
|
||||||
}
|
}
|
||||||
public void setActivitytime(Date activitytime)
|
public void setActivitytime(Date activitytime)
|
||||||
{
|
{
|
||||||
this.activitytime = activitytime;
|
this.activitytime = activitytime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getActivitytime()
|
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()
|
||||||
{
|
{
|
||||||
return activitytime;
|
return activitytime;
|
||||||
}
|
}
|
||||||
public void setCreateuserid(Long createuserid)
|
public void setCreateuserid(Long createuserid)
|
||||||
{
|
{
|
||||||
this.createuserid = createuserid;
|
this.createuserid = createuserid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getCreateuserid()
|
public Long getCreateuserid()
|
||||||
{
|
{
|
||||||
return createuserid;
|
return createuserid;
|
||||||
}
|
}
|
||||||
@ -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();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ruoyi.project.benyi.mapper.BySchoolcalendarClassMapper">
|
<mapper namespace="com.ruoyi.project.benyi.mapper.BySchoolcalendarClassMapper">
|
||||||
|
|
||||||
<resultMap type="BySchoolcalendarClass" id="BySchoolcalendarClassResult">
|
<resultMap type="BySchoolcalendarClass" id="BySchoolcalendarClassResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="name" column="name" />
|
<result property="name" column="name" />
|
||||||
@ -12,33 +12,37 @@ 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">
|
||||||
<include refid="selectBySchoolcalendarClassVo"/>
|
<include refid="selectBySchoolcalendarClassVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
<if test="classid != null and classid != ''"> and classid = #{classid}</if>
|
<if test="classid != null and classid != ''"> and classid = #{classid}</if>
|
||||||
<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>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBySchoolcalendarClassById" parameterType="Long" resultMap="BySchoolcalendarClassResult">
|
<select id="selectBySchoolcalendarClassById" parameterType="Long" resultMap="BySchoolcalendarClassResult">
|
||||||
<include refid="selectBySchoolcalendarClassVo"/>
|
<include refid="selectBySchoolcalendarClassVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertBySchoolcalendarClass" parameterType="BySchoolcalendarClass">
|
<insert id="insertBySchoolcalendarClass" parameterType="BySchoolcalendarClass">
|
||||||
insert into by_schoolcalendar_class
|
insert into by_schoolcalendar_class
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
@ -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>
|
||||||
@ -85,10 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteBySchoolcalendarClassByIds" parameterType="String">
|
<delete id="deleteBySchoolcalendarClassByIds" parameterType="String">
|
||||||
delete from by_schoolcalendar_class where id in
|
delete from by_schoolcalendar_class where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user