| 
					
				 | 
			
			
				@@ -12,8 +12,10 @@ 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; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.fs.company.service.ICompanyService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.company.service.ICompanyUserService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.store.domain.FsUser; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.store.service.IFsUserService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -57,6 +59,9 @@ public class WxCompanyUserController extends AppBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private IFsUserService userService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ICompanyService companyService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @ApiOperation("小程序-授权登录") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @PostMapping("/loginByMa") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public R login(@RequestBody LoginMaWxParam param) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -126,6 +131,16 @@ public class WxCompanyUserController extends AppBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //                companyUserMp.setLoginIp(ip); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //                companyUserService.updateUserProfile(companyUser); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 特殊(需求设计:需要根据公司是否开启黑名单来设置会员初始化的状态) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Company company = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(param.getCompanyId() != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                company = companyService.selectCompanyById(param.getCompanyId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 根据销售后台设置的  是否需要单独注册会员 来判断是否需要设置销售的值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            CompanyUser companyUser = companyUserService.selectCompanyUserById(param.getCompanyUserId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String ip = IpUtil.getRequestIp(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (user == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 user = userService.selectFsUserByMaOpenId(session.getOpenid()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -146,11 +161,15 @@ public class WxCompanyUserController extends AppBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     user = new FsUser(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     user.setNickname(userInfo.getNickName() != null ? userInfo.getNickName() : "微信用户"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     user.setAvatar(userInfo.getAvatarUrl() != null ? userInfo.getAvatarUrl() : null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    user.setStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    user.setStatus((company != null ? company.getFsUserIsDefaultBlack() : 0) == 1 ? 0 : 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     user.setMaOpenId(session.getOpenid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     user.setUnionId(session.getUnionid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     user.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     user.setPhone(phoneNoInfo.getPhoneNumber()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if(companyUser.getIsNeedRegisterMember() != 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        user.setCompanyId(param.getCompanyId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        user.setCompanyUserId(param.getCompanyUserId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     userService.insertFsUser(user); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 |