Browse Source

会员关联项目 代码还原

Long 1 day ago
parent
commit
f873e8a8b2

+ 2 - 4
fs-user-app/src/main/java/com/fs/app/controller/WxCompanyUserController.java

@@ -9,7 +9,6 @@ import com.fs.app.utils.JwtUtils;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.IpUtil;
-import com.fs.common.utils.ServletUtils;
 import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.service.ICompanyDeptService;
@@ -21,7 +20,6 @@ import com.fs.store.service.IFsUserCompanyUserService;
 import com.fs.store.service.IFsUserService;
 import com.fs.wx.miniapp.config.WxMaConfiguration;
 import com.fs.wx.miniapp.config.WxMaProperties;
-import io.jsonwebtoken.Claims;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -36,7 +34,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.validation.Valid;
 import java.util.Date;
 import java.util.Objects;
 
@@ -135,7 +132,8 @@ public class WxCompanyUserController extends AppBaseController {
 //                    userMap.setAvatar(param.getAvatar() != null ? param.getAvatar() : null);
                     userMap.setPhone(phoneNoInfo.getPhoneNumber());
                     // 逻辑调整:如果会员已经绑定了销售,直接提示,不让注册-2025年6月16日14点53分
-                    if (user.getCompanyUserId() != null && !param.getCompanyUserId().equals(user.getCompanyUserId())){
+                    FsUserCompanyUser userCompanyUser = userCompanyUserService.selectByUserIdAndProjectId(user.getUserId(), param.getProjectId());
+                    if (Objects.nonNull(userCompanyUser) && !param.getCompanyUserId().equals(userCompanyUser.getCompanyUserId())){
                         return R.error(500, "该用户("+user.getUserId() + ")已成为其他销售会员");
                     }
 //                    if((companyUser.getIsAllowedAllRegister() == null || companyUser.getIsAllowedAllRegister() == 1)