浏览代码

PC首页,定时任务

LIVE_YE 2 年之前
父节点
当前提交
4c903866b9

+ 4 - 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -3,12 +3,16 @@ package com.ruoyi;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
  * 启动程序
  * 
  * @author ruoyi
  */
+@EnableAsync
+@EnableScheduling
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
 public class RuoYiApplication
 {

+ 15 - 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -29,6 +29,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 
     public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
 
+    public static String HH_MM_SS = "HH:mm:ss";
+
     private static String[] parsePatterns = {
             "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
             "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
@@ -56,6 +58,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
     }
 
+    public static final String getNowTime() {
+        return dateTimeNow(HH_MM_SS);
+    }
+
     public static final String dateTimeNow() {
         return dateTimeNow(YYYYMMDDHHMMSS);
     }
@@ -128,7 +134,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
     /**
      * 计算时间差
      *
-     * @param endTime   最后时间
+     * @param endDate   最后时间
      * @param startTime 开始时间
      * @return 时间差(天/小时/分钟)
      */
@@ -221,6 +227,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return bl;
     }
 
+    public static String timeMonthFirst() {
+        SimpleDateFormat format = new SimpleDateFormat(YYYY_MM_DD);
+        Calendar cale = Calendar.getInstance();
+        cale.add(Calendar.MONTH, 0);
+        cale.set(Calendar.DAY_OF_MONTH, 1);
+        String firstday = format.format(cale.getTime());
+        return firstday;
+    }
 
 
 }

+ 23 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/CourseChange.java

@@ -22,6 +22,13 @@ public class CourseChange extends BaseEntity
     /** ID */
     private Long id;
 
+    /** 学校id */
+    private Long schoolId;
+
+    /** 学校名称 */
+    @Excel(name = "学校名称")
+    private String schoolName;
+
     /** 申请人id */
     @Excel(name = "申请人id")
     private Long applyId;
@@ -212,6 +219,22 @@ public class CourseChange extends BaseEntity
         return opinion;
     }
 
+    public Long getSchoolId() {
+        return schoolId;
+    }
+
+    public String getSchoolName() {
+        return schoolName;
+    }
+
+    public void setSchoolId(Long schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public void setSchoolName(String schoolName) {
+        this.schoolName = schoolName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CourseChangeMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
 
 import java.util.List;
 import com.ruoyi.system.domain.CourseChange;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 调课Mapper接口
@@ -58,4 +59,6 @@ public interface CourseChangeMapper
      * @return 结果
      */
     public int deleteCourseChangeByIds(Long[] ids);
+
+    List<CourseChange> selectCourseChangeListByTime(@Param("monthFirst") String monthFirst, @Param("userId")Long userId, @Param("deptId")Long deptId);
 }

+ 2 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CourseTableMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
 
 import java.util.List;
 import com.ruoyi.system.domain.CourseTable;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 课程Mapper接口
@@ -59,5 +60,5 @@ public interface CourseTableMapper
      */
     public int deleteCourseTableByIds(Long[] ids);
 
-    CourseTable selectCourseTableByClassIdAndWeek(Long classId, int week);
+    CourseTable selectCourseTableByClassIdAndWeek(@Param("classId") Long classId, @Param("week")int week);
 }

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/RegisterParentsStudentMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
 
 import java.util.List;
 import com.ruoyi.system.domain.RegisterParentsStudent;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 注册-家长-学生Mapper接口
@@ -65,4 +66,6 @@ public interface RegisterParentsStudentMapper
      * @return 结果
      */
     void deleteRegisterParentsStudentByParentsId(Long parentsId);
+
+    List<RegisterParentsStudent> selectRegisterParentsStudentListByTime(@Param("monthFirst") String monthFirst, @Param("classIds")List<Long> classIds);
 }

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/RegisterTeacherMapper.java

@@ -1,7 +1,10 @@
 package com.ruoyi.system.mapper;
 
 import java.util.List;
+
+import com.ruoyi.system.domain.RegisterParentsStudent;
 import com.ruoyi.system.domain.RegisterTeacher;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 注册-老师Mapper接口
@@ -60,4 +63,6 @@ public interface RegisterTeacherMapper
     public int deleteRegisterTeacherByIds(Long[] ids);
 
     RegisterTeacher selectRegisterTeacherByOppenId(String oppenId);
+
+    List<RegisterTeacher> selectRegisterTeacherListByTime(@Param("monthFirst") String monthFirst, @Param("deptId")Long deptId);
 }

+ 67 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/Task.java

@@ -0,0 +1,67 @@
+package com.ruoyi.system.service;
+
+
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.system.mapper.SysDeptMapper;
+import com.ruoyi.system.mapper.SysUserMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Component
+public class Task {
+
+    @Autowired
+    private SysUserMapper userMapper;
+
+    @Autowired
+    private SysDeptMapper sysDeptMapper;
+
+    @Autowired
+    private ISysUserService sysUserService;
+
+    @Autowired
+    private RedisCache redisCache;
+
+
+    /***
+     * 生成班级下课初始信息
+     * */
+    @Async
+    //@Scheduled(cron = "0 0/2 * * * ? ")
+    @Scheduled(cron = "0 1 0 * * ? ")
+    public void afterClass() throws Exception {
+
+        //获取所有部门
+        List<SysDept> sysDeptList = sysDeptMapper.selectDeptList(new SysDept());
+
+        //学校部门
+        List<SysDept> fSysDeptList = new ArrayList<>();
+        //班级部门
+        List<SysDept> pSysDeptList = new ArrayList<>();
+
+        for (SysDept sysDept : sysDeptList) {
+            if (sysDept.getParentId() == 0) {
+                fSysDeptList.add(sysDept);
+            } else {
+                pSysDeptList.add(sysDept);
+            }
+        }
+
+        for (SysDept sysDept : fSysDeptList) {
+            for (SysDept dept : pSysDeptList) {
+                if (sysDept.getDeptId().equals(dept.getParentId())) {
+                    String key = sysDept.getDeptId() + ":" + dept.getDeptId();
+                    String value = dept.getDeptName() + ":time";
+                    redisCache.setCacheObject(key, value);
+                }
+            }
+        }
+    }
+
+}

+ 133 - 4
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AppletServiceImpl.java

@@ -1,19 +1,22 @@
 package com.ruoyi.system.service.impl;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.FormalParentsStudent;
 import com.ruoyi.common.core.domain.entity.FormalTeacherClass;
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.system.domain.SysConfig;
-import com.ruoyi.system.mapper.SysConfigMapper;
+import com.ruoyi.system.domain.*;
+import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.service.IAppletService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @Author: tjf
@@ -28,6 +31,21 @@ public class AppletServiceImpl implements IAppletService {
     @Autowired
     private SysConfigMapper configMapper;
 
+    @Autowired
+    private RegisterParentsStudentMapper registerParentsStudentMapper;
+
+    @Autowired
+    private CourseChangeMapper courseChangeMapper;
+
+    @Autowired
+    private FormalTeacherClassMapper formalTeacherClassMapper;
+
+    @Autowired
+    private RegisterTeacherMapper registerTeacherMapper;
+
+    @Autowired
+    private XiaoyuanNoticeMapper xiaoyuanNoticeMapper;
+
     /**
      * 老师准备下课按钮
      *
@@ -110,6 +128,8 @@ public class AppletServiceImpl implements IAppletService {
     @Override
     public AjaxResult pcStatistics() {
         Map<String,Object> map = new HashMap<>();
+        //获取当前月第一天
+        String monthFirst = DateUtils.timeMonthFirst();
         SysUser user = SecurityUtils.getLoginUser().getUser();
         List<SysRole> roles = user.getRoles();
         boolean blt = false;
@@ -122,20 +142,129 @@ public class AppletServiceImpl implements IAppletService {
                 bls = true;
             }
         }
+        //账号
+        int tzhysh = 0;
+        int tzhwsh = 0;
+        //调课
+        int ttkysh = 0;
+        int ttkwsh = 0;
+        Map<String,Object> map1 = new HashMap<>();
+        Map<String,Object> map2 = new HashMap<>();
+        Map<String,Object> map3 = new HashMap<>();
+
+        //计算本人
+        XiaoyuanNotice xiaoyuanNotice = new XiaoyuanNotice();
+        xiaoyuanNotice.setSenderId(String.valueOf(user.getUserId()));
+        List<XiaoyuanNotice> xiaoyuanNoticeList = xiaoyuanNoticeMapper.selectXiaoyuanNoticeMyList(xiaoyuanNotice);
+        int xwsl = 0;
+        if(xiaoyuanNoticeList!=null && xiaoyuanNoticeList.size()>0){
+            xwsl = xiaoyuanNoticeList.size();
+        }
+        map.put("xwsl",xwsl);
+
+        map1.put("zhysh",tzhysh);
+        map1.put("zhwsh",tzhwsh);
+        map.put("byzhsh",map1);
+        map2.put("tkysh",ttkysh);
+        map2.put("tkwsh",ttkwsh);
+        map.put("bytksh",map2);
+
         //老师
         if(blt){
+            //获取老师所属班级
+            FormalTeacherClass formalTeacherClass = new FormalTeacherClass();
+            formalTeacherClass.setTeacherId(user.getUserId());
+            List<FormalTeacherClass> formalTeacherClasses = formalTeacherClassMapper.selectFormalTeacherClassList(formalTeacherClass);
+            List<Long> classIds = formalTeacherClasses.stream().map(FormalTeacherClass::getClassId).collect(Collectors.toList());
             //查询本月家长的审核数据
-
+            List<RegisterParentsStudent> registerParentsStudentList = registerParentsStudentMapper.selectRegisterParentsStudentListByTime(monthFirst,classIds);
+            if(registerParentsStudentList!=null && registerParentsStudentList.size()>0){
+                for (RegisterParentsStudent registerParentsStudent : registerParentsStudentList) {
+                    if("1".equals(registerParentsStudent.getIsPass())){
+                        tzhwsh++;
+                    }else{
+                        tzhysh++;
+                    }
+                }
+            }
+            //查询本月调课审核
+            List<CourseChange> courseChangeList = courseChangeMapper.selectCourseChangeListByTime(monthFirst,user.getUserId(),0L);
+            if(courseChangeList!=null && courseChangeList.size()>0){
+                for (CourseChange courseChange : courseChangeList) {
+                    if("1".equals(courseChange.getIsPass())){
+                        ttkwsh++;
+                    }else{
+                        ttkysh++;
+                    }
+                }
+            }
+            map1.put("zhysh",tzhysh);
+            map1.put("zhwsh",tzhwsh);
+            map.put("byzhsh",map1);
+            map2.put("tkysh",ttkysh);
+            map2.put("tkwsh",ttkwsh);
+            map.put("bytksh",map2);
 
         }
+
+
         //学校
+        //账号
+        int szhysh = 0;
+        int szhwsh = 0;
+        //调课
+        int stkysh = 0;
+        int stkwsh = 0;
         if(bls){
+            //查询本月老师的审核数据
+            List<RegisterTeacher> registerTeacherList = registerTeacherMapper.selectRegisterTeacherListByTime(monthFirst,user.getDeptId());
+            if(registerTeacherList!=null && registerTeacherList.size()>0){
+                for (RegisterTeacher registerTeacher : registerTeacherList) {
+                    if("1".equals(registerTeacher.getIsPass())){
+                        szhysh++;
+                    }else{
+                        szhwsh++;
+                    }
+                }
+            }
+            //查询本月学校的调课审核
+            List<CourseChange> courseChangeList = courseChangeMapper.selectCourseChangeListByTime(monthFirst,0L,user.getDeptId());
+            if(courseChangeList!=null && courseChangeList.size()>0){
+                for (CourseChange courseChange : courseChangeList) {
+                    if("1".equals(courseChange.getIsPass())){
+                        stkysh++;
+                    }else{
+                        stkwsh++;
+                    }
+                }
+            }
 
+            map1.put("zhysh",szhysh);
+            map1.put("zhwsh",szhwsh);
+            map.put("byzhsh",map1);
+            map2.put("tkysh",stkysh);
+            map2.put("tkwsh",stkwsh);
+            map.put("bytksh",map2);
         }
         //两个都有
+
         if(blt && bls){
 
+            //账号
+            int zzhysh = tzhysh + szhysh;
+            int zzhwsh = tzhwsh + szhwsh;
+            //调课
+            int ztkysh =  stkysh;
+            int ztkwsh =  stkwsh;
+
+            map1.put("zhysh",zzhysh);
+            map1.put("zhwsh",zzhwsh);
+            map.put("byzhsh",map1);
+            map2.put("tkysh",ztkysh);
+            map2.put("tkwsh",ztkwsh);
+            map.put("bytksh",map2);
+
         }
-        return null;
+        return AjaxResult.success(map);
     }
 }

+ 22 - 24
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CourseChangeServiceImpl.java

@@ -18,13 +18,12 @@ import com.ruoyi.system.service.ICourseChangeService;
 
 /**
  * 调课Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2023-06-02
  */
 @Service
-public class CourseChangeServiceImpl implements ICourseChangeService 
-{
+public class CourseChangeServiceImpl implements ICourseChangeService {
     @Autowired
     private CourseChangeMapper courseChangeMapper;
     @Autowired
@@ -32,37 +31,35 @@ public class CourseChangeServiceImpl implements ICourseChangeService
 
     /**
      * 查询调课
-     * 
+     *
      * @param id 调课主键
      * @return 调课
      */
     @Override
-    public CourseChange selectCourseChangeById(Long id)
-    {
+    public CourseChange selectCourseChangeById(Long id) {
         return courseChangeMapper.selectCourseChangeById(id);
     }
 
     /**
      * 查询调课列表
-     * 
+     *
      * @param courseChange 调课
      * @return 调课
      */
     @Override
-    public List<CourseChange> selectCourseChangeList(CourseChange courseChange)
-    {
+    public List<CourseChange> selectCourseChangeList(CourseChange courseChange) {
 
         SysUser user = SecurityUtils.getLoginUser().getUser();
         List<SysRole> roles = user.getRoles();
         boolean bl = false;
         for (SysRole role : roles) {
-            if("teacher".equals(role.getRoleKey())){
+            if ("teacher".equals(role.getRoleKey())) {
                 bl = true;
                 break;
             }
         }
         //角色是老师
-        if(bl){
+        if (bl) {
             //查询老师班级
             FormalTeacherClass formalTeacherClass = new FormalTeacherClass();
             formalTeacherClass.setTeacherId(user.getUserId());
@@ -76,14 +73,18 @@ public class CourseChangeServiceImpl implements ICourseChangeService
 
     /**
      * 新增调课
-     * 
+     *
      * @param courseChange 调课
      * @return 结果
      */
     @Override
-    public int insertCourseChange(CourseChange courseChange)
-    {
+    public int insertCourseChange(CourseChange courseChange) {
         SysUser user = SecurityUtils.getLoginUser().getUser();
+        FormalTeacherClass formalTeacherClass = new FormalTeacherClass();
+        formalTeacherClass.setTeacherId(user.getUserId());
+        List<FormalTeacherClass> formalTeacherClassList = formalTeacherClassMapper.selectFormalTeacherClassList(formalTeacherClass);
+        courseChange.setSchoolId(formalTeacherClassList.get(0).getSchoolId());
+        courseChange.setSchoolName(formalTeacherClassList.get(0).getSchoolName());
         courseChange.setApplyId(user.getUserId());
         courseChange.setApplyName(user.getNickName());
         courseChange.setCreateTime(DateUtils.getNowDate());
@@ -92,38 +93,35 @@ public class CourseChangeServiceImpl implements ICourseChangeService
 
     /**
      * 修改调课
-     * 
+     *
      * @param courseChange 调课
      * @return 结果
      */
     @Override
-    public int updateCourseChange(CourseChange courseChange)
-    {
+    public int updateCourseChange(CourseChange courseChange) {
         courseChange.setUpdateTime(DateUtils.getNowDate());
         return courseChangeMapper.updateCourseChange(courseChange);
     }
 
     /**
      * 批量删除调课
-     * 
+     *
      * @param ids 需要删除的调课主键
      * @return 结果
      */
     @Override
-    public int deleteCourseChangeByIds(Long[] ids)
-    {
+    public int deleteCourseChangeByIds(Long[] ids) {
         return courseChangeMapper.deleteCourseChangeByIds(ids);
     }
 
     /**
      * 删除调课信息
-     * 
+     *
      * @param id 调课主键
      * @return 结果
      */
     @Override
-    public int deleteCourseChangeById(Long id)
-    {
+    public int deleteCourseChangeById(Long id) {
         return courseChangeMapper.deleteCourseChangeById(id);
     }
 
@@ -136,7 +134,7 @@ public class CourseChangeServiceImpl implements ICourseChangeService
         formalTeacherClass.setClassId(courseChange.getSubjectClassId());
         formalTeacherClass.setDiscipline(courseChange.getBeSubject());
         List<FormalTeacherClass> formalTeacherClassList = formalTeacherClassMapper.selectFormalTeacherClassList(formalTeacherClass);
-        if(formalTeacherClassList == null || formalTeacherClassList.size()<=0){
+        if (formalTeacherClassList == null || formalTeacherClassList.size() <= 0) {
             return AjaxResult.error("请回复自己授课的班级与课程");
         }
         courseChange.setAuditId(user.getUserId());

+ 12 - 9
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CourseTableServiceImpl.java

@@ -128,6 +128,9 @@ public class CourseTableServiceImpl implements ICourseTableService
         }
         //获取当前班级课程
         CourseTable courseTable = courseTableMapper.selectCourseTableByClassIdAndWeek(classId,dayForWeek);
+        if(courseTable == null){
+            return AjaxResult.success(map);
+        }
         if(index == 1){
             map.put("teacher",courseTable.getOneTeacher());
             map.put("subject",courseTable.getOneClass());
@@ -160,23 +163,23 @@ public class CourseTableServiceImpl implements ICourseTableService
     @SneakyThrows
     private int isClass(CourseTableTime courseTableTime) {
         //获取当前时间
-        String nowTime = DateUtils.getTime();
+        String nowTime = DateUtils.getNowTime();
         int index = 0;
-        if(DateUtils.isClass(courseTableTime.getOneStartTime(),courseTableTime.getOneEndTime(),nowTime,"HH:mm:ss")){
+        if(DateUtils.isClass(courseTableTime.getOneStartTime(),courseTableTime.getOneEndTime(),nowTime,"HH:mm")){
             index = 1;
-        }else if(DateUtils.isClass(courseTableTime.getTwoStartTime(),courseTableTime.getTwoEndTime(),nowTime,"HH:mm:ss")){
+        }else if(DateUtils.isClass(courseTableTime.getTwoStartTime(),courseTableTime.getTwoEndTime(),nowTime,"HH:mm")){
             index = 2;
-        }else if(DateUtils.isClass(courseTableTime.getThreeStartTime(),courseTableTime.getThreeEndTime(),nowTime,"HH:mm:ss")){
+        }else if(DateUtils.isClass(courseTableTime.getThreeStartTime(),courseTableTime.getThreeEndTime(),nowTime,"HH:mm")){
             index = 3;
-        }else if(DateUtils.isClass(courseTableTime.getFourStartTime(),courseTableTime.getFourEndTime(),nowTime,"HH:mm:ss")){
+        }else if(DateUtils.isClass(courseTableTime.getFourStartTime(),courseTableTime.getFourEndTime(),nowTime,"HH:mm")){
             index = 4;
-        }else if(DateUtils.isClass(courseTableTime.getFiveStartTime(),courseTableTime.getFiveEndTime(),nowTime,"HH:mm:ss")){
+        }else if(DateUtils.isClass(courseTableTime.getFiveStartTime(),courseTableTime.getFiveEndTime(),nowTime,"HH:mm")){
             index = 5;
-        }else if(DateUtils.isClass(courseTableTime.getSixStartTime(),courseTableTime.getSixEndTime(),nowTime,"HH:mm:ss")){
+        }else if(DateUtils.isClass(courseTableTime.getSixStartTime(),courseTableTime.getSixEndTime(),nowTime,"HH:mm")){
             index = 6;
-        }else if(DateUtils.isClass(courseTableTime.getSevenStartTime(),courseTableTime.getSevenEndTime(),nowTime,"HH:mm:ss")){
+        }else if(DateUtils.isClass(courseTableTime.getSevenStartTime(),courseTableTime.getSevenEndTime(),nowTime,"HH:mm")){
             index = 7;
-        }else if(DateUtils.isClass(courseTableTime.getEightStartTime(),courseTableTime.getEightEndTime(),nowTime,"HH:mm:ss")){
+        }else if(DateUtils.isClass(courseTableTime.getEightStartTime(),courseTableTime.getEightEndTime(),nowTime,"HH:mm")){
             index = 8;
         }
         return index;

+ 20 - 1
ruoyi-system/src/main/resources/mapper/system/CourseChangeMapper.xml

@@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="CourseChange" id="CourseChangeResult">
         <result property="id"    column="id"    />
+        <result property="schoolId"    column="school_id"    />
+        <result property="schoolName"    column="school_name"    />
         <result property="applyId"    column="apply_id"    />
         <result property="applyName"    column="apply_name"    />
         <result property="applyTime"    column="apply_time"    />
@@ -34,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectCourseChangeVo"/>
         <where>  
             <if test="applyId != null "> and apply_id = #{applyId}</if>
+            <if test="schoolName != null  and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
             <if test="applyName != null  and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
             <if test="applyTime != null "> and apply_time = #{applyTime}</if>
             <if test="subjectClassId != null  "> and subject_class_id = #{subjectClassId}</if>
@@ -59,10 +62,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectCourseChangeVo"/>
         where id = #{id}
     </select>
-        
+    <select id="selectCourseChangeListByTime" resultMap="CourseChangeResult">
+        <include refid="selectCourseChangeVo"/>
+        where date_format(create_time,'%Y%m') = date_format(#{monthFirst},'%Y%m')
+        <if test="userId != null and userId != 0">
+            and apply_id = #{userId}
+        </if>
+        <if test="deptId != null and deptId != 0">
+            and school_id = #{deptId}
+        </if>
+    </select>
+
     <insert id="insertCourseChange" parameterType="CourseChange" useGeneratedKeys="true" keyProperty="id">
         insert into course_change
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="schoolId != null">school_id,</if>
+            <if test="schoolName != null">school_name,</if>
             <if test="applyId != null">apply_id,</if>
             <if test="applyName != null">apply_name,</if>
             <if test="applyTime != null">apply_time,</if>
@@ -83,6 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="opinion != null">opinion,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="schoolId != null">#{schoolId},</if>
+            <if test="schoolName != null">#{schoolName},</if>
             <if test="applyId != null">#{applyId},</if>
             <if test="applyName != null">#{applyName},</if>
             <if test="applyTime != null">#{applyTime},</if>
@@ -107,6 +124,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateCourseChange" parameterType="CourseChange">
         update course_change
         <trim prefix="SET" suffixOverrides=",">
+            <if test="schoolId != null">school_id = #{schoolId},</if>
+            <if test="schoolName != null">school_name = #{schoolName},</if>
             <if test="applyId != null">apply_id = #{applyId},</if>
             <if test="applyName != null">apply_name = #{applyName},</if>
             <if test="applyTime != null">apply_time = #{applyTime},</if>

+ 9 - 1
ruoyi-system/src/main/resources/mapper/system/RegisterParentsStudentMapper.xml

@@ -61,7 +61,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectRegisterParentsStudentVo"/>
         where id = #{id}
     </select>
-        
+    <select id="selectRegisterParentsStudentListByTime" resultMap="RegisterParentsStudentResult">
+        <include refid="selectRegisterParentsStudentVo"/>
+        where date_format(create_time,'%Y%m') = date_format(#{monthFirst},'%Y%m')
+        and class_id in
+        <foreach collection="classIds" index="index" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </select>
+
     <insert id="insertRegisterParentsStudent" parameterType="RegisterParentsStudent" useGeneratedKeys="true" keyProperty="id">
         insert into register_parents_student
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 5 - 0
ruoyi-system/src/main/resources/mapper/system/RegisterTeacherMapper.xml

@@ -48,6 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectRegisterTeacherVo"/>
         where  open_id = #{openId} limit 1
     </select>
+    <select id="selectRegisterTeacherListByTime" resultMap="RegisterTeacherResult">
+        <include refid="selectRegisterTeacherVo"/>
+        where date_format(create_time,'%Y%m') = date_format(#{monthFirst},'%Y%m')
+        and school_id = #{deptId}
+    </select>
 
     <insert id="insertRegisterTeacher" parameterType="RegisterTeacher" useGeneratedKeys="true" keyProperty="id">
         insert into register_teacher