|
@@ -1,5 +1,7 @@
|
|
|
package com.yonge.cooleshow.biz.dal.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -9,10 +11,13 @@ import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
|
|
|
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.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.support.WrapperUtil;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
@@ -31,9 +36,8 @@ import com.yonge.cooleshow.biz.dal.dao.TeacherAuthEntryRecordDao;
|
|
|
import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEntryRecordDao, TeacherAuthEntryRecord> implements TeacherAuthEntryRecordService {
|
|
@@ -44,6 +48,9 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
|
|
|
private SysMessageService sysMessageService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private TeacherStyleVideoService teacherStyleVideoService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private TeacherDao teacherDao;
|
|
|
|
|
|
@Override
|
|
@@ -87,6 +94,10 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
|
|
|
teacher.setGradCertificate(StringUtil.isEmpty(teacher.getGradCertificate()) ? build.getGradCertificate() : teacher.getGradCertificate());
|
|
|
teacher.setDegreeCertificate(StringUtil.isEmpty(teacher.getDegreeCertificate()) ? build.getDegreeCertificate() : teacher.getDegreeCertificate());
|
|
|
teacher.setTeacherCertificate(StringUtil.isEmpty(teacher.getTeacherCertificate()) ? build.getTeacherCertificate() : teacher.getTeacherCertificate());
|
|
|
+
|
|
|
+ //老师风采视频
|
|
|
+ String styleVideoJson = build.getStyleVideoJson();
|
|
|
+ saveStyleVideo(styleVideoJson, build.getUserId(), sysUser.getId());
|
|
|
}
|
|
|
teacher.setEntryFlag(authOperaReq.getPass() ? YesOrNoEnum.YES : YesOrNoEnum.NO);
|
|
|
teacher.setEntryAuthDate(new Date());
|
|
@@ -103,6 +114,33 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
|
|
|
return HttpResponseResult.succeed(true);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存老师风采视频
|
|
|
+ *
|
|
|
+ * @param styleVideoJson
|
|
|
+ * @param userId
|
|
|
+ * @param verifyUserId
|
|
|
+ */
|
|
|
+ private void saveStyleVideo(String styleVideoJson, Long userId, Long verifyUserId) {
|
|
|
+ if (!StringUtil.isEmpty(styleVideoJson)) {
|
|
|
+ JSONArray jsonArray = JSONObject.parseArray(styleVideoJson);
|
|
|
+ List<TeacherStyleVideo> batchVideoList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
+ TeacherStyleVideo video = new TeacherStyleVideo();
|
|
|
+ video.setUserId(userId);
|
|
|
+ video.setCover(jsonObject.getString("cover"));
|
|
|
+ video.setVideoUrl(jsonObject.getString("videoUrl"));
|
|
|
+ video.setAuthStatus(AuthStatusEnum.PASS);
|
|
|
+ video.setVerifyUserId(verifyUserId);
|
|
|
+ video.setEntryFlag(YesOrNoEnum.YES);
|
|
|
+ batchVideoList.add(video);
|
|
|
+ }
|
|
|
+ teacherStyleVideoService.batchAddStyleVideo(batchVideoList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 发送审核通知
|
|
|
private void authSend(Long userId, String phone, Boolean isPass, String reason) {
|
|
|
Map<Long, String> receivers = new HashMap<>();
|