diff --git a/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/exception/EmployeeJclRunTimeException.java b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/exception/EmployeeJclRunTimeException.java new file mode 100644 index 0000000..ed88a95 --- /dev/null +++ b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/exception/EmployeeJclRunTimeException.java @@ -0,0 +1,29 @@ +package com.weaver.seconddev.jcl.organization.exception; + +public class EmployeeJclRunTimeException extends RuntimeException { + private int errorCode; + + public EmployeeJclRunTimeException(String message) { + super(message); + } + public EmployeeJclRunTimeException(String message,int errorCode) { + super(message); + this.errorCode=errorCode; + } + + public EmployeeJclRunTimeException(Throwable cause) { + super(cause); + } + + public EmployeeJclRunTimeException(String message, Throwable cause) { + super(message, cause); + } + + public int getErrorCode() { + return errorCode; + } + + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + } +} diff --git a/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/importAdvice/ImportEmployeeAdvice.java b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/importAdvice/ImportEmployeeAdvice.java index a87ab0d..3ab43d5 100644 --- a/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/importAdvice/ImportEmployeeAdvice.java +++ b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/importAdvice/ImportEmployeeAdvice.java @@ -1,5 +1,6 @@ package com.weaver.seconddev.jcl.organization.importAdvice; +import com.google.common.collect.Lists; import com.google.gson.Gson; import com.weaver.ebuilder.form.client.service.batch.advice.ImportDataAdvice; import com.weaver.ebuilder.form.client.service.batch.dto.BaseImportDataAdviceDto; @@ -15,21 +16,29 @@ import java.util.List; * 员工信息导入校验 */ @Slf4j -@Service("importEmployeeAdvice_jcl") +@Service("importjclEmployeeAdvice") public class ImportEmployeeAdvice implements ImportDataAdvice { @Override public void dataAdvice(BaseImportDataAdviceDto req) { List> dataList = req.getDataList(); - Gson gson = new Gson(); + List> newDataList = Lists.newArrayList(); for (List data:dataList){ + boolean mark = true; for (DataForImportEntity entity:data){ if (entity.getDataKey().equals("手机号") && entity.getValue().equals("18816254117")){ entity.setErrorMsg("手机号重复"); + mark = false; + }else { + } } + if (mark){ + newDataList.add(data); + } } + req.setDataList(newDataList); - log.error("ImportEmployeeAdvice info :[{}] ",req.toString()); + log.error("importjclEmployeeAdvice info :[{}] ",req.toString()); } }