1
This commit is contained in:
parent
8adf0e01f3
commit
29939dc277
@ -41,9 +41,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.common.BaseConstants.*;
|
||||
import static cn.iocoder.yudao.common.DictBaseConstants.DICT_CUS_TYPE;
|
||||
@ -120,7 +118,7 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
|
||||
AdminUserRespDTO userDTO = adminUserApi.getUserByUsername(saveReqVO.getPhoneNumber());
|
||||
user = BeanUtils.toBean(userDTO, UserDTO.class);
|
||||
//存在两种情况,一是该用户已经注册,二是该用户未注册
|
||||
if (null == user){
|
||||
if (null == userDTO){
|
||||
user = new UserDTO();
|
||||
//如果不存在创建用户;
|
||||
user.setUsername(saveReqVO.getPhoneNumber());
|
||||
@ -164,10 +162,10 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
|
||||
}
|
||||
//客户表绑定用户id
|
||||
main.setUserId(userId);
|
||||
//绑定角色
|
||||
Set<String> roleCodes = new HashSet<>();
|
||||
roleCodes.add(dict.getRemark());
|
||||
permissionApi.assignUserRole(userId, roleCodes);
|
||||
//绑定角色----客户不设置角色
|
||||
// Set<String> roleCodes = new HashSet<>();
|
||||
// roleCodes.add(dict.getRemark());
|
||||
// permissionApi.assignUserRole(userId, roleCodes);
|
||||
}
|
||||
/*3、保存客户主表信息*/
|
||||
//暂时写死会员id TODO
|
||||
|
Loading…
Reference in New Issue
Block a user