feat(user): 增加用户导入模板字段
- 在 UserImportParam 类中添加了用户编码、公司 ID、地址和积分字段- 在用户导入示例中增加了这些新字段的数据 - 在创建新用户时,增加了这些字段的设置
This commit is contained in:
@@ -473,12 +473,16 @@ public class UserController extends BaseController {
|
|||||||
User u = new User();
|
User u = new User();
|
||||||
u.setStatus(0);
|
u.setStatus(0);
|
||||||
u.setUsername(one.getUsername());
|
u.setUsername(one.getUsername());
|
||||||
|
u.setUserCode(one.getUserCode());
|
||||||
u.setPassword(userService.encodePassword(one.getPassword()));
|
u.setPassword(userService.encodePassword(one.getPassword()));
|
||||||
u.setNickname(one.getNickname());
|
u.setNickname(one.getNickname());
|
||||||
u.setRealName(one.getRealName());
|
u.setRealName(one.getRealName());
|
||||||
u.setPhone(one.getPhone());
|
u.setPhone(one.getPhone());
|
||||||
|
u.setPoints(one.getPoints());
|
||||||
u.setEmail(one.getEmail());
|
u.setEmail(one.getEmail());
|
||||||
|
u.setAddress(one.getAddress());
|
||||||
u.setComments(one.getComments());
|
u.setComments(one.getComments());
|
||||||
|
u.setCompanyId(one.getCompanyId());
|
||||||
|
|
||||||
// 设置角色(如果提供)
|
// 设置角色(如果提供)
|
||||||
if (one.getRoleName() != null && !one.getRoleName().trim().isEmpty()) {
|
if (one.getRoleName() != null && !one.getRoleName().trim().isEmpty()) {
|
||||||
@@ -591,10 +595,12 @@ public class UserController extends BaseController {
|
|||||||
example1.setNickname("管理员");
|
example1.setNickname("管理员");
|
||||||
example1.setRealName("张三");
|
example1.setRealName("张三");
|
||||||
example1.setPhone("13800138001");
|
example1.setPhone("13800138001");
|
||||||
|
example1.setPoints(1000);
|
||||||
example1.setEmail("admin@example.com");
|
example1.setEmail("admin@example.com");
|
||||||
example1.setOrganizationName("总公司");
|
example1.setOrganizationName("总公司");
|
||||||
example1.setSexName("男");
|
example1.setSexName("男");
|
||||||
example1.setRoleName("管理员");
|
example1.setRoleName("管理员");
|
||||||
|
example1.setAddress("地址");
|
||||||
example1.setComments("");
|
example1.setComments("");
|
||||||
templateData.add(example1);
|
templateData.add(example1);
|
||||||
|
|
||||||
@@ -604,10 +610,12 @@ public class UserController extends BaseController {
|
|||||||
example2.setNickname("注册用户");
|
example2.setNickname("注册用户");
|
||||||
example2.setRealName("李四");
|
example2.setRealName("李四");
|
||||||
example2.setPhone("13800138002");
|
example2.setPhone("13800138002");
|
||||||
|
example1.setPoints(2000);
|
||||||
example2.setEmail("user@example.com");
|
example2.setEmail("user@example.com");
|
||||||
example2.setOrganizationName("分公司");
|
example2.setOrganizationName("分公司");
|
||||||
example2.setSexName("女");
|
example2.setSexName("女");
|
||||||
example2.setRoleName("注册用户");
|
example2.setRoleName("注册用户");
|
||||||
|
example2.setAddress("地址");
|
||||||
example2.setComments("");
|
example2.setComments("");
|
||||||
templateData.add(example2);
|
templateData.add(example2);
|
||||||
|
|
||||||
|
|||||||
@@ -45,4 +45,16 @@ public class UserImportParam implements Serializable {
|
|||||||
@Excel(name = "备注")
|
@Excel(name = "备注")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
|
@Excel(name = "用户编码")
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
@Excel(name = "公司ID")
|
||||||
|
private Integer companyId;
|
||||||
|
|
||||||
|
@Excel(name = "地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Excel(name = "积分")
|
||||||
|
private Integer points;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user