You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
Java
48 lines
1.3 KiB
Java
3 years ago
|
package com.engine.organization.enums;
|
||
3 years ago
|
|
||
|
import com.engine.organization.exception.OrganizationRunTimeException;
|
||
3 years ago
|
import com.engine.organization.util.saveimport.StaffInfoImportUtil;
|
||
3 years ago
|
import weaver.hrm.User;
|
||
|
|
||
|
import java.util.HashMap;
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
|
||
|
/**
|
||
|
* @author:dxfeng
|
||
|
* @createTime: 2022/09/15
|
||
|
* @version: 1.0
|
||
|
*/
|
||
|
public enum OrgImportEnum implements OrgImportAdapter {
|
||
3 years ago
|
STAFF("staff") {
|
||
3 years ago
|
@Override
|
||
|
public Map<String, Object> orgImport(Map<String, Object> params, User user) {
|
||
|
Map<String, Object> resultMap = new HashMap<>();
|
||
|
String excelFile = (String) params.get("excelfile");
|
||
|
resultMap.put("pId", StaffInfoImportUtil.saveImport("add", excelFile, user));
|
||
|
return resultMap;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public List<Map<String, Object>> orgForm(User user) {
|
||
|
return StaffInfoImportUtil.importForm(user);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
private String tableName;
|
||
|
|
||
|
OrgImportEnum(String tableName) {
|
||
|
this.tableName = tableName;
|
||
|
}
|
||
|
|
||
|
public static OrgImportEnum getOrgImportUtil(String tableName) {
|
||
|
for (OrgImportEnum item : OrgImportEnum.values()) {
|
||
|
if (item.tableName.equalsIgnoreCase(tableName)) {
|
||
|
return item;
|
||
|
}
|
||
|
}
|
||
|
throw new OrganizationRunTimeException("不支持的导入类型");
|
||
|
}
|
||
|
}
|