|
@@ -12,13 +12,8 @@ import com.yonge.cooleshow.biz.dal.dto.req.TeacherApplyDetailReq;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.Teacher;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.TeacherStyleVideo;
|
|
|
-import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
|
|
|
-import com.yonge.cooleshow.biz.dal.enums.AuthTypeEnum;
|
|
|
-import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
-import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.SysMessageService;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.TeacherStyleVideoService;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.UserFirstTimeService;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.*;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.*;
|
|
|
import com.yonge.cooleshow.biz.dal.support.WrapperUtil;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
|
|
@@ -36,12 +31,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
|
|
|
import com.yonge.cooleshow.biz.dal.dao.TeacherAuthEntryRecordDao;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEntryRecordDao, TeacherAuthEntryRecord> implements TeacherAuthEntryRecordService {
|
|
@@ -57,6 +52,9 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
|
|
|
@Resource
|
|
|
private TeacherDao teacherDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TeacherService teacherService;
|
|
|
+
|
|
|
@Override
|
|
|
public TeacherAuthEntryRecordVo detail(Long id) {
|
|
|
return baseMapper.detail(id);
|
|
@@ -105,6 +103,8 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
|
|
|
|
|
|
//记录达人认证时间
|
|
|
userFirstTimeService.recordTime(build.getUserId(),ClientEnum.TEACHER, UserFirstTimeTypeEnum.ENTRY);
|
|
|
+
|
|
|
+ setTag(authOperaReq, build, teacher);
|
|
|
}
|
|
|
teacher.setEntryFlag(authOperaReq.getPass() ? YesOrNoEnum.YES : YesOrNoEnum.NO);
|
|
|
teacher.setEntryAuthDate(new Date());
|
|
@@ -121,6 +121,27 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
|
|
|
return HttpResponseResult.succeed(true);
|
|
|
}
|
|
|
|
|
|
+ private void setTag(AuthOperaReq authOperaReq, TeacherAuthEntryRecord build, TeacherVo teacher) {
|
|
|
+ if (authOperaReq.getPass()) {
|
|
|
+ if (!StringUtil.isEmpty(teacher.getTeacherCertificate())) {
|
|
|
+ teacherService.setTeacherTag(build.getUserId(), TeacherTagEnum.TEACHER);
|
|
|
+ } else if (!StringUtil.isEmpty(teacher.getTag())) {
|
|
|
+ teacher.setTag(Arrays.stream(teacher.getTag().split(","))
|
|
|
+ .filter(s -> !s.equals("TEACHER"))
|
|
|
+ .collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (authOperaReq.getPass()) {
|
|
|
+ if (!StringUtil.isEmpty(teacher.getDegreeCertificate()) && !StringUtil.isEmpty(teacher.getGradCertificate())) {
|
|
|
+ teacherService.setTeacherTag(build.getUserId(), TeacherTagEnum.DEGREE);
|
|
|
+ } else if (!StringUtil.isEmpty(teacher.getTag())) {
|
|
|
+ teacher.setTag(Arrays.stream(teacher.getTag().split(","))
|
|
|
+ .filter(s -> !s.equals("DEGREE"))
|
|
|
+ .collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存老师风采视频
|
|
|
*
|