|
@@ -1,5 +1,27 @@
|
|
|
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;
|
|
@@ -15,31 +37,22 @@ 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.page.CourseScheduleQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
|
|
|
import com.ym.mec.biz.service.CourseScheduleService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
+import com.ym.mec.biz.service.SysMessageService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
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 {
|
|
|
|
|
@@ -53,6 +66,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
@Autowired
|
|
|
private StudentAttendanceDao studentAttendanceDao;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, CourseSchedule> getDAO() {
|
|
@@ -514,18 +532,34 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
@Override
|
|
|
public boolean updateCourseScheduleToOverStatus() {
|
|
|
List<CourseSchedule> list = courseScheduleDao.queryFinishedWithNoUpdateStatus();
|
|
|
-
|
|
|
+
|
|
|
List<CourseSchedule> updateList = new ArrayList<CourseSchedule>();
|
|
|
Date date = new Date();
|
|
|
- for(CourseSchedule courseSchedule : list){
|
|
|
+ for (CourseSchedule courseSchedule : list) {
|
|
|
courseSchedule.setStatus(CourseStatusEnum.OVER);
|
|
|
courseSchedule.setUpdateTime(date);
|
|
|
updateList.add(courseSchedule);
|
|
|
}
|
|
|
-
|
|
|
- if(updateList.size()>0){
|
|
|
-
|
|
|
+
|
|
|
+ if (updateList.size() > 0) {
|
|
|
+ courseScheduleDao.batchUpdate(updateList);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean pushNoSignInMessage() {
|
|
|
+ Integer minutes = 30;
|
|
|
+ SysConfig sysConfig = sysConfigService.findByParamName(SysConfigService.SIGN_OUT_MESSAGE_PUSH_MINUTE);
|
|
|
+ if (sysConfig != null && StringUtils.isNotBlank(sysConfig.getParanValue())) {
|
|
|
+ minutes = Integer.parseInt(sysConfig.getParanValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<CourseSchedule> list = courseScheduleDao.queryNoSignInListByBeforeMinutes(minutes);
|
|
|
+
|
|
|
+ String teacherList = list.stream().map(cs -> cs.getActualTeacherId().toString()).collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageSendMode.PUSH, "", "", teacherList, null, 0, "");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|