人员username为空的话,默认手机号
parent
6ad31a5c3f
commit
e34ed803d7
|
|
@ -25,7 +25,6 @@ public class UserAddCmd extends Command {
|
|||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "登录账号", name = "username", required = true)
|
||||
@NotEmpty(message = "登录账号不能为空")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "姓名", name = "name", required = true)
|
||||
|
|
@ -60,11 +59,9 @@ public class UserAddCmd extends Command {
|
|||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true)
|
||||
@NotEmpty(message = "人员类型不能为空")
|
||||
private String personnelType;
|
||||
|
||||
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true)
|
||||
@NotEmpty(message = "人员类型不能为空")
|
||||
private String personnelTypeName;
|
||||
|
||||
@ApiModelProperty(value = "民族编码", name = "nation")
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ public class UserXgfAddCmd extends Command {
|
|||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "登录账号", name = "username", required = true)
|
||||
@NotEmpty(message = "登录账号不能为空")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "姓名", name = "name", required = true)
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
|||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -195,6 +196,9 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
|
||||
@Override
|
||||
public void saveUser(UserDO userDO) {
|
||||
if(StringUtils.isEmpty(userDO.getUsername())){
|
||||
userDO.setUsername(userDO.getPhone());
|
||||
}
|
||||
UserAddCmd userAddCmd = new UserAddCmd();
|
||||
userAddCmd.setAccount(userDO.getUsername());
|
||||
userAddCmd.setName(userDO.getName());
|
||||
|
|
|
|||
Loading…
Reference in New Issue