|
@@ -1,27 +1,5 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.Comparator;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
-import java.util.TreeSet;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-import java.util.stream.Stream;
|
|
|
-
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
-import org.apache.commons.lang.time.DateUtils;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.CourseScheduleComplaintsDao;
|
|
@@ -35,11 +13,7 @@ import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
|
|
|
import com.ym.mec.biz.dal.entity.SysConfig;
|
|
|
-import com.ym.mec.biz.dal.enums.AuditStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.MessageSendMode;
|
|
|
-import com.ym.mec.biz.dal.enums.ParamEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
|
|
|
import com.ym.mec.biz.service.CourseScheduleService;
|
|
@@ -52,6 +26,18 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.commons.lang.time.DateUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
@Service
|
|
|
public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSchedule> implements CourseScheduleService {
|
|
@@ -562,4 +548,48 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageSendMode.PUSH, "", "", teacherList, null, 0, "");
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo queryTeacherClassCourseSchedule(CourseScheduleQueryInfo queryInfo) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if(null==user){
|
|
|
+ throw new BizException("请登录");
|
|
|
+ }
|
|
|
+ queryInfo.setUserId(user.getId().longValue());
|
|
|
+ PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+
|
|
|
+ if(Objects.isNull(queryInfo.getDate())){
|
|
|
+ queryInfo.setDate(new Date());
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List dataList = null;
|
|
|
+ int count = courseScheduleDao.countTeacherClassCourseSchedule(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = courseScheduleDao.queryTeacherClassCourseSchedule(params);
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void checkMusicGroupClassCourse(Long musicGroupId) {
|
|
|
+ if(Objects.isNull(musicGroupId)){
|
|
|
+ throw new BizException("请指定乐团");
|
|
|
+ }
|
|
|
+ List<Map<Long, Integer>> maps = courseScheduleDao.countClassCourseNumByMusicGroup(musicGroupId);
|
|
|
+ Map<Long,Integer> classCourseNumMap = MapUtil.convertMybatisMap(maps);
|
|
|
+ for (Long key:classCourseNumMap.keySet()){
|
|
|
+ if(classCourseNumMap.get(key)<=0){
|
|
|
+ throw new BizException("存在未排课的班级");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|