Przeglądaj źródła

重粉 添加按公司重粉

xgb 1 tydzień temu
rodzic
commit
47ae228f95

+ 3 - 0
fs-service/src/main/java/com/fs/course/config/CourseConfig.java

@@ -79,6 +79,9 @@ public class CourseConfig implements Serializable {
      */
     private boolean oneCompanyCourse;
 
+    //
+    private boolean moreCompanyCourse;
+
     /**
      * 是否开启IM
      */

+ 14 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -15,6 +15,7 @@ import com.fs.common.core.domain.entity.SysDictData;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.enums.BizResponseEnum;
 import com.fs.common.exception.CustomException;
+import com.fs.common.exception.ServiceException;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.CloudHostUtils;
 import com.fs.common.utils.DateUtils;
@@ -544,6 +545,19 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
                 return R.error(500, "该用户("+fsUser.getUserId() + ")已成为其他销售会员");
             }
         }
+
+        // 重粉问题,关闭单销售重粉检测 打开公司销售重粉检测 允许不同公司销售重粉
+        if(!oneCompanyCourse && config.isMoreCompanyCourse()){
+            QwExternalContact query=new QwExternalContact();
+            query.setFsUserId(param.getUserId());
+            query.setCompanyId(param.getCompanyId());
+            List<QwExternalContact> qwExternalContacts = qwExternalContactMapper.selectQwExternalContactList(query);
+            if(qwExternalContacts != null && !qwExternalContacts.isEmpty() && !Objects.equals(qwExternalContacts.get(0).getCompanyUserId(), param.getCompanyUserId())){
+                String msgInfo= "该用户("+fsUser.getUserId() + ")已在公司"+param.getCompanyId()+"成为其他销售会员";
+                return R.error(500, msgInfo);
+            }
+        }
+
         Integer isRoom = param.getIsRoom();
 
         // 处理逻辑