日历增加幼儿园与班级园历显示
This commit is contained in:
		| @@ -2,9 +2,17 @@ package com.ruoyi.project.benyi.controller; | ||||
|  | ||||
| import java.text.SimpleDateFormat; | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
|  | ||||
| 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.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| @@ -26,7 +34,7 @@ import com.ruoyi.framework.web.page.TableDataInfo; | ||||
|  | ||||
| /** | ||||
|  * 园历管理(本一)Controller | ||||
|  *  | ||||
|  * | ||||
|  * @author tsbz | ||||
|  * @date 2020-05-10 | ||||
|  */ | ||||
| @@ -36,6 +44,12 @@ public class ByCalendarController extends BaseController | ||||
| { | ||||
|     @Autowired | ||||
|     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')") | ||||
|     @GetMapping("/getAllSchoolCalendars") | ||||
|     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<>(); | ||||
|         SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||||
|         //加载本一园历 | ||||
|         List<ByCalendar> list = byCalendarService.selectByCalendarList(byCalendar); | ||||
|         for (ByCalendar calendar:list) { | ||||
|             ByCalendarShow by = new ByCalendarShow(); | ||||
|             by.setId(calendar.getId()); | ||||
|             by.setTitle(calendar.getName()); | ||||
|             by.setStart(formatter.format(calendar.getActivitytime())); | ||||
|             by.setEnd(formatter.format(calendar.getActivityendtime())); | ||||
|             by.setColor(calendar.getStylecolor()); | ||||
|             listvi.add(by); | ||||
|         if(list.size()>0){ | ||||
|             for (ByCalendar calendar:list) { | ||||
|                 ByCalendarShow by = new ByCalendarShow(); | ||||
|                 by.setId(calendar.getId()); | ||||
|                 by.setTitle(calendar.getName()); | ||||
|                 by.setStart(formatter.format(calendar.getActivitytime())); | ||||
|                 by.setEnd(formatter.format(calendar.getActivityendtime())); | ||||
|                 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(); | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import java.util.Date; | ||||
|  | ||||
| /** | ||||
|  * 园历管理(班级)对象 by_schoolcalendar_class | ||||
|  *  | ||||
|  * | ||||
|  * @author tsbz | ||||
|  * @date 2020-05-06 | ||||
|  */ | ||||
| @@ -44,6 +44,18 @@ public class BySchoolcalendarClass extends BaseEntity | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd") | ||||
|     private Date activitytime; | ||||
|  | ||||
|     /** | ||||
|      * 活动结束时间 | ||||
|      */ | ||||
|     @Excel(name = "活动结束时间", width = 30, dateFormat = "yyyy-MM-dd") | ||||
|     private Date activityendtime; | ||||
|  | ||||
|     /** | ||||
|      * 活动样式颜色 | ||||
|      */ | ||||
|     @Excel(name = "活动样式颜色") | ||||
|     private String stylecolor; | ||||
|  | ||||
|     /** 创建人 */ | ||||
|     @Excel(name = "创建人") | ||||
|     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; | ||||
|     } | ||||
|  | ||||
|     public Long getId()  | ||||
|     public Long getId() | ||||
|     { | ||||
|         return id; | ||||
|     } | ||||
|     public void setName(String name)  | ||||
|     public void setName(String name) | ||||
|     { | ||||
|         this.name = name; | ||||
|     } | ||||
|  | ||||
|     public String getName()  | ||||
|     public String getName() | ||||
|     { | ||||
|         return name; | ||||
|     } | ||||
|     public void setType(String type)  | ||||
|     public void setType(String type) | ||||
|     { | ||||
|         this.type = type; | ||||
|     } | ||||
|  | ||||
|     public String getType()  | ||||
|     public String getType() | ||||
|     { | ||||
|         return type; | ||||
|     } | ||||
|     public void setClassid(String classid)  | ||||
|     public void setClassid(String classid) | ||||
|     { | ||||
|         this.classid = classid; | ||||
|     } | ||||
|  | ||||
|     public String getClassid()  | ||||
|     public String getClassid() | ||||
|     { | ||||
|         return classid; | ||||
|     } | ||||
|     public void setXnxq(String xnxq)  | ||||
|     public void setXnxq(String xnxq) | ||||
|     { | ||||
|         this.xnxq = xnxq; | ||||
|     } | ||||
|  | ||||
|     public String getXnxq()  | ||||
|     public String getXnxq() | ||||
|     { | ||||
|         return xnxq; | ||||
|     } | ||||
|     public void setDeptid(Long deptid)  | ||||
|     public void setDeptid(Long deptid) | ||||
|     { | ||||
|         this.deptid = deptid; | ||||
|     } | ||||
|  | ||||
|     public Long getDeptid()  | ||||
|     public Long getDeptid() | ||||
|     { | ||||
|         return deptid; | ||||
|     } | ||||
|     public void setActivitytime(Date activitytime)  | ||||
|     public void setActivitytime(Date 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; | ||||
|     } | ||||
|     public void setCreateuserid(Long createuserid)  | ||||
|     public void setCreateuserid(Long createuserid) | ||||
|     { | ||||
|         this.createuserid = createuserid; | ||||
|     } | ||||
|  | ||||
|     public Long getCreateuserid()  | ||||
|     public Long getCreateuserid() | ||||
|     { | ||||
|         return createuserid; | ||||
|     } | ||||
| @@ -140,6 +166,8 @@ public class BySchoolcalendarClass extends BaseEntity | ||||
|             .append("xnxq", getXnxq()) | ||||
|             .append("deptid", getDeptid()) | ||||
|             .append("activitytime", getActivitytime()) | ||||
|             .append("activityendtime", getActivityendtime()) | ||||
|             .append("stylecolor", getStylecolor()) | ||||
|             .append("createuserid", getCreateuserid()) | ||||
|             .append("createtime", getCreatetime()) | ||||
|             .toString(); | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
| PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
| "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.ruoyi.project.benyi.mapper.BySchoolcalendarClassMapper"> | ||||
|      | ||||
|  | ||||
|     <resultMap type="BySchoolcalendarClass" id="BySchoolcalendarClassResult"> | ||||
|         <result property="id"    column="id"    /> | ||||
|         <result property="name"    column="name"    /> | ||||
| @@ -12,33 +12,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         <result property="xnxq"    column="xnxq"    /> | ||||
|         <result property="deptid"    column="deptId"    /> | ||||
|         <result property="activitytime"    column="activitytime"    /> | ||||
|         <result property="activityendtime"    column="activityendtime"    /> | ||||
|         <result property="stylecolor"    column="stylecolor"    /> | ||||
|         <result property="createuserid"    column="createuserid"    /> | ||||
|         <result property="createtime"    column="createtime"    /> | ||||
|     </resultMap> | ||||
|  | ||||
|     <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> | ||||
|  | ||||
|     <select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult"> | ||||
|         <include refid="selectBySchoolcalendarClassVo"/> | ||||
|         <where>   | ||||
|         <where> | ||||
|             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if> | ||||
|             <if test="type != null  and type != ''"> and type = #{type}</if> | ||||
|             <if test="classid != null  and classid != ''"> and classid = #{classid}</if> | ||||
|             <if test="xnxq != null  and xnxq != ''"> and xnxq = #{xnxq}</if> | ||||
|             <if test="deptid != null "> and deptId = #{deptid}</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="createtime != null "> and createtime = #{createtime}</if> | ||||
|         </where> | ||||
|     </select> | ||||
|      | ||||
|  | ||||
|     <select id="selectBySchoolcalendarClassById" parameterType="Long" resultMap="BySchoolcalendarClassResult"> | ||||
|         <include refid="selectBySchoolcalendarClassVo"/> | ||||
|         where id = #{id} | ||||
|     </select> | ||||
|          | ||||
|  | ||||
|     <insert id="insertBySchoolcalendarClass" parameterType="BySchoolcalendarClass"> | ||||
|         insert into by_schoolcalendar_class | ||||
|         <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="deptid != null ">deptId,</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="createtime != null ">createtime,</if> | ||||
|          </trim> | ||||
| @@ -60,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="xnxq != null  and xnxq != ''">#{xnxq},</if> | ||||
|             <if test="deptid != null ">#{deptid},</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="createtime != null ">#{createtime},</if> | ||||
|          </trim> | ||||
| @@ -74,6 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="xnxq != null  and xnxq != ''">xnxq = #{xnxq},</if> | ||||
|             <if test="deptid != null ">deptId = #{deptid},</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="createtime != null ">createtime = #{createtime},</if> | ||||
|         </trim> | ||||
| @@ -85,10 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|     </delete> | ||||
|  | ||||
|     <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=")"> | ||||
|             #{id} | ||||
|         </foreach> | ||||
|     </delete> | ||||
|      | ||||
| </mapper> | ||||
|  | ||||
| </mapper> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user