|
|
@ -38,6 +38,8 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm |
|
|
|
|
|
|
|
private String currentOrgId; |
|
|
|
|
|
|
|
private CustomerStaffImportExcelData dataB; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 数据 |
|
|
@ -67,6 +69,8 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm |
|
|
|
public void invoke(CustomerStaffImportExcelData data, AnalysisContext context) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
dataB = data; |
|
|
|
// 先校验数据
|
|
|
|
ValidatorUtils.validateEntity(data); |
|
|
|
|
|
|
@ -144,6 +148,8 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm |
|
|
|
|
|
|
|
CustomerStaffImportExcelData.RowRemarkMessage errorRow = new CustomerStaffImportExcelData.RowRemarkMessage(); |
|
|
|
errorRow.setErrorInfo(errorMsg); |
|
|
|
errorRow.setName(data.getName()); |
|
|
|
errorRow.setMobile(data.getMobile()); |
|
|
|
errorRows.add(errorRow); |
|
|
|
} |
|
|
|
} |
|
|
@ -151,7 +157,25 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm |
|
|
|
@Override |
|
|
|
public void doAfterAllAnalysed(AnalysisContext context) { |
|
|
|
// 最后几条达不到阈值,这里必须再调用一次
|
|
|
|
execPersist(); |
|
|
|
try { |
|
|
|
execPersist(); |
|
|
|
}catch (Exception e) { |
|
|
|
String errorMsg = null; |
|
|
|
if (e instanceof ValidateException) { |
|
|
|
errorMsg = ((ValidateException) e).getMsg(); |
|
|
|
} else { |
|
|
|
log.error("【客户信息导入】出错:{}", e.getStackTrace()); |
|
|
|
errorMsg = ((EpmetException)e).getInternalMsg(); |
|
|
|
log.error("【客户信息导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); |
|
|
|
} |
|
|
|
|
|
|
|
CustomerStaffImportExcelData.RowRemarkMessage errorRow = new CustomerStaffImportExcelData.RowRemarkMessage(); |
|
|
|
errorRow.setErrorInfo(errorMsg); |
|
|
|
errorRow.setName(dataB.getName()); |
|
|
|
errorRow.setMobile(dataB.getMobile()); |
|
|
|
errorRows.add(errorRow); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -163,7 +187,7 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm |
|
|
|
// icNatService.batchPersist(datas, this);
|
|
|
|
staffService.exportAdd(datas,this); |
|
|
|
} |
|
|
|
} finally { |
|
|
|
}finally { |
|
|
|
datas.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|