mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-15 04:52:09 +08:00
1.添加用户导入controller
This commit is contained in:
@@ -28,4 +28,7 @@ public final class ConstantsOperateMessage {
|
||||
public static final String DELETE_SUCCESS = "message.action.delete.success";
|
||||
public static final String DELETE_ERROR = "message.action.delete.error";
|
||||
|
||||
public static final String import_success = "message.action.import.success";
|
||||
public static final String IMPORT_ERROR = "message.action.import.error";
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.maxkey.domain;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* @author yapeng.li
|
||||
* @date 2019.3.6
|
||||
*/
|
||||
public class ImportResultBaseVO {
|
||||
/**
|
||||
* 资源名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
if(status==0){
|
||||
this.status = "SUCCESS";
|
||||
}else if(status==1){
|
||||
this.status = "FAILURE";
|
||||
}else{
|
||||
this.status = "IGNORE";
|
||||
}
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
if(StringUtils.isEmpty(desc)){
|
||||
return "";
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImportResultBaseVO{" +
|
||||
"name='" + name + '\'' +
|
||||
", status='" + status + '\'' +
|
||||
", desc='" + desc + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
105
maxkey-core/src/main/java/org/maxkey/domain/ImportResultVO.java
Normal file
105
maxkey-core/src/main/java/org/maxkey/domain/ImportResultVO.java
Normal file
@@ -0,0 +1,105 @@
|
||||
package org.maxkey.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yapeng.li
|
||||
* @since 2020/9/21 21:12
|
||||
*/
|
||||
public class ImportResultVO {
|
||||
|
||||
/**
|
||||
* 成功结果
|
||||
*/
|
||||
List<ImportResultBaseVO> success;
|
||||
/**
|
||||
* 失败结果
|
||||
*/
|
||||
List<ImportResultBaseVO> error;
|
||||
/**
|
||||
* 忽略结果
|
||||
*/
|
||||
List<ImportResultBaseVO> ignore;
|
||||
/**
|
||||
* 成功次数
|
||||
*/
|
||||
Integer successCount;
|
||||
/**
|
||||
* 失败次数
|
||||
*/
|
||||
Integer errorCount;
|
||||
/**
|
||||
* 忽略次数
|
||||
*/
|
||||
Integer ignoreCount;
|
||||
|
||||
public List<ImportResultBaseVO> getSuccess() {
|
||||
if(success==null){
|
||||
success = new ArrayList<>();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(List<ImportResultBaseVO> success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<ImportResultBaseVO> getError() {
|
||||
if(error==null){
|
||||
error = new ArrayList<>();
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
public void setError(List<ImportResultBaseVO> error) {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public List<ImportResultBaseVO> getIgnore() {
|
||||
if(ignore==null){
|
||||
ignore = new ArrayList<>();
|
||||
}
|
||||
return ignore;
|
||||
}
|
||||
|
||||
public void setIgnore(List<ImportResultBaseVO> ignore) {
|
||||
this.ignore = ignore;
|
||||
}
|
||||
|
||||
public Integer getSuccessCount() {
|
||||
return successCount;
|
||||
}
|
||||
|
||||
public void setSuccessCount(Integer successCount) {
|
||||
this.successCount = successCount;
|
||||
}
|
||||
|
||||
public Integer getErrorCount() {
|
||||
return errorCount;
|
||||
}
|
||||
|
||||
public void setErrorCount(Integer errorCount) {
|
||||
this.errorCount = errorCount;
|
||||
}
|
||||
|
||||
public Integer getIgnoreCount() {
|
||||
return ignoreCount;
|
||||
}
|
||||
|
||||
public void setIgnoreCount(Integer ignoreCount) {
|
||||
this.ignoreCount = ignoreCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImportResultVO{" +
|
||||
"success=" + success +
|
||||
", error=" + error +
|
||||
", ignore=" + ignore +
|
||||
", successCount=" + successCount +
|
||||
", errorCount=" + errorCount +
|
||||
", ignoreCount=" + ignoreCount +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
20
maxkey-core/src/main/java/org/maxkey/util/ExcelUtils.java
Normal file
20
maxkey-core/src/main/java/org/maxkey/util/ExcelUtils.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package org.maxkey.util;
|
||||
|
||||
import org.maxkey.domain.UserInfo;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yapeng.li
|
||||
* @since 2020/9/21 21:06
|
||||
*/
|
||||
public class ExcelUtils {
|
||||
|
||||
|
||||
public static List<UserInfo> readExcel(InputStream in) throws Exception {
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user