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