|
@@ -2,6 +2,7 @@ package com.yonge.cooleshow.biz.dal.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.TeacherStyleSearch;
|
|
@@ -9,11 +10,18 @@ import com.yonge.cooleshow.biz.dal.dto.search.TeacherStyleVideoSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.Teacher;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.TeacherAuthMusicianRecord;
|
|
|
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.enums.YesOrNoEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.SysMessageService;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherStyleVideoVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
+import com.yonge.toolset.thirdparty.message.MessageSenderPluginContext;
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.TeacherStyleVideo;
|
|
|
import com.yonge.cooleshow.biz.dal.dao.TeacherStyleVideoDao;
|
|
@@ -21,12 +29,24 @@ import com.yonge.cooleshow.biz.dal.service.TeacherStyleVideoService;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
@Service
|
|
|
public class TeacherStyleVideoServiceImpl extends ServiceImpl<TeacherStyleVideoDao, TeacherStyleVideo> implements TeacherStyleVideoService {
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(TeacherStyleVideoService.class);
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public TeacherStyleVideoVo detail(Long id) {
|
|
|
return baseMapper.detail(id);
|
|
@@ -49,7 +69,40 @@ public class TeacherStyleVideoServiceImpl extends ServiceImpl<TeacherStyleVideoD
|
|
|
build.setReason(authOperaReq.getReason());
|
|
|
build.setVerifyUserId(sysUser.getId());
|
|
|
build.setUpdateTime(new Date());
|
|
|
- return HttpResponseResult.succeed(baseMapper.updateById(build) > 0);
|
|
|
+ HttpResponseResult<Boolean> result = HttpResponseResult.succeed(baseMapper.updateById(build) > 0);
|
|
|
+ if (result.getStatus()) {
|
|
|
+ sendAuthMessage(authOperaReq.getPass(),build.getUserId(),authOperaReq.getReason());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发送个人风采审核
|
|
|
+ *
|
|
|
+ * @param pass 通过/失败
|
|
|
+ */
|
|
|
+ private void sendAuthMessage(Boolean pass, Long teacherId,String remark) {
|
|
|
+ if (Boolean.TRUE.equals(pass)) {
|
|
|
+ try {
|
|
|
+ SysUser user = sysUserFeignService.queryUserById(teacherId);
|
|
|
+ Map<Long, String> teacherReceivers = new HashMap<>();
|
|
|
+ teacherReceivers.put(user.getId(), user.getPhone());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.TEACHER_STYLE_VIDEO_SUCCESS,
|
|
|
+ teacherReceivers, null, 0, null, ClientEnum.TEACHER.getCode());
|
|
|
+ }catch (Exception e) {
|
|
|
+ log.warn("老师个人风采审核成功消息发送失败,{}",e.getMessage());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ try {
|
|
|
+ SysUser user = sysUserFeignService.queryUserById(teacherId);
|
|
|
+ Map<Long, String> teacherReceivers = new HashMap<>();
|
|
|
+ teacherReceivers.put(user.getId(), user.getPhone());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.TEACHER_STYLE_VIDEO_FAIL,
|
|
|
+ teacherReceivers, null, 0, null, ClientEnum.TEACHER.getCode(),remark);
|
|
|
+ }catch (Exception e) {
|
|
|
+ log.warn("老师个人风采审核失败消息发送失败,{}",e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|