employeePosts 参数数组转换为字符串,逗号分隔。
This commit is contained in:
@@ -380,7 +380,7 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
entity.setUserRoleString(val);
|
||||
return true;
|
||||
}else if ("employee.employeePosts".equals(header)){
|
||||
entity.getEmployee().setEmployeePosts(new String[]{val});
|
||||
entity.getEmployee().setEmployeePosts(val);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,13 +145,14 @@ public class Employee extends DataEntity<Employee> {
|
||||
this.employeePostList = employeePostList;
|
||||
}
|
||||
|
||||
public String[] getEmployeePosts() {
|
||||
public String getEmployeePosts() {
|
||||
List<String> list = ListUtils.extractToList(employeePostList, "postCode");
|
||||
return list.toArray(new String[list.size()]);
|
||||
return StringUtils.join(list, ",");
|
||||
}
|
||||
|
||||
public void setEmployeePosts(String[] employeePosts) {
|
||||
for (String val : employeePosts){
|
||||
public void setEmployeePosts(String employeePosts) {
|
||||
String[] list = StringUtils.split(employeePosts, ",");
|
||||
for (String val : list){
|
||||
if (StringUtils.isNotBlank(val)){
|
||||
EmployeePost e = new EmployeePost();
|
||||
e.setPostCode(val);
|
||||
|
||||
Reference in New Issue
Block a user