|
@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
+import com.ym.mec.biz.dal.page.TeacherAttendanceComplaintsQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.TeacherCloseQueryInfo;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
@@ -604,4 +605,70 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
|
|
|
String url = new StringBuffer("8?").append(sysConfigDao.findConfigValue(SysConfigService.TEACHER_BASE_URL)).append("/#/appealResult?date=").append(format).toString();
|
|
|
sysMessageService.batchSendMessage(MessageSender.JIGUANG,MessageTypeEnum.PUSH_TEACHER_EXCEPTION_ATTENDANCE,receivers,null,0,url,"TEACHER",format);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void addComplaints(Long courseScheduleId, String content) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if(Objects.isNull(user)){
|
|
|
+ throw new BizException("请登录");
|
|
|
+ }
|
|
|
+ TeacherAttendance teacherAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(user.getId().longValue(), courseScheduleId);
|
|
|
+ if(teacherAttendance == null){
|
|
|
+ throw new BizException("考勤信息不存在");
|
|
|
+ }
|
|
|
+ CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId);
|
|
|
+ if(courseSchedule == null){
|
|
|
+ throw new BizException("课程不存在");
|
|
|
+ }
|
|
|
+ //如果课程时间在两天前
|
|
|
+ Date date = new Date();
|
|
|
+ if(DateUtil.daysBetween(courseSchedule.getClassDate(),date) > 1){
|
|
|
+ throw new BizException("超出可申述时间");
|
|
|
+ }
|
|
|
+ teacherAttendance.setIsComplaints(1);
|
|
|
+ teacherAttendance.setComplaintsStatus(2);
|
|
|
+ teacherAttendance.setComplaintsContent(content);
|
|
|
+ teacherAttendance.setComplaintsTime(date);
|
|
|
+ teacherAttendanceDao.update(teacherAttendance);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void repealComplaints(Long courseScheduleId) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if(Objects.isNull(user)){
|
|
|
+ throw new BizException("请登录");
|
|
|
+ }
|
|
|
+ TeacherAttendance teacherAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(user.getId().longValue(), courseScheduleId);
|
|
|
+ if(teacherAttendance == null){
|
|
|
+ throw new BizException("考勤信息不存在");
|
|
|
+ }
|
|
|
+ if(teacherAttendance.getComplaintsStatus() == 2){
|
|
|
+ teacherAttendance.setComplaintsStatus(3);
|
|
|
+ teacherAttendanceDao.update(teacherAttendance);
|
|
|
+ }else {
|
|
|
+ throw new BizException("操作失败: 当前申述状态不允许撤销");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void queryTeacherAttendanceComplaints(TeacherAttendanceComplaintsQueryInfo queryInfo) {
|
|
|
+ /*PageInfo<TeacherAttendancesDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<TeacherAttendancesDto> dataList = null;
|
|
|
+ int count = teacherAttendanceDao.countTeacherAttendanceComplaints(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = teacherAttendanceDao.queryTeacherAttendanceComplaints(params);
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;*/
|
|
|
+ }
|
|
|
}
|