浏览代码

Merge branch 'feature/0726-kf' into test

yuanliang 1 年之前
父节点
当前提交
7fe361d8b1

+ 10 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java

@@ -338,6 +338,11 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
     @Override
     @Transactional(rollbackFor = Exception.class)
     public HttpResponseResult<Boolean> submit(TeacherSubmitReq teacherSubmitReq) throws BizException {
+        Long tenantId = teacherSubmitReq.getTenantId();
+        Boolean customerService = teacherSubmitReq.getCustomerService();
+        if (tenantId != null && tenantId > 0 && Boolean.TRUE.equals(customerService)) {
+            throw new BizException("客服不能有机构老师身份");
+        }
         // todo 暂时不上客服相关
 //        teacherSubmitReq.setCustomerService(null);
         if (null == teacherSubmitReq.getUserId()) {
@@ -1676,9 +1681,13 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
         if (teacher == null) {
             throw new BizException("无效的老师账号");
         }
+        Long tenantId = teacher.getTenantId();
+        Boolean customerService = teacher.getCustomerService();
+        if (tenantId != null && tenantId > 0 && Boolean.TRUE.equals(customerService)) {
+            throw new BizException("客服不能有机构老师身份");
+        }
 
         // 冻结客服,移交好友给其他客服
-        Boolean customerService = teacher.getCustomerService();
         if (UserLockFlag.NORMAL.equals(teacher.getLockFlag()) && Boolean.TRUE.equals(customerService)) {
             List<TeacherWrapper.CustomerServiceSendMsg2User> customerServiceSendMsg2User = transferFriendV2(teacherId, false);
             clearUserCustomerRelation(teacherId);