//提示消息显示效果:
第【2】行,【13】列导入错误:Index: 0, Size: 0
第【3】行,【13】列导入错误:Index: 0, Size: 0
第【4】行,【13】列导入错误:Index: 0, Size: 0
第【5】行,【13】列导入错误:Index: 0, Size: 0
第【6】行,【13】列导入错误:Index: 0, Size: 0
第【7】行,【13】列导入错误:Index: 0, Size: 0
第【8】行,【13】列导入错误:Index: 0, Size: 0
//实现代码:
//错误日志
List<String> errorList=new ArrayList<String>();
try{
List<WmsItemToCustomer> w2c = commonDao.findByQuery(getDock,
new String[]{"cId","itemId"},
new Object[]{customer.getId(),item.getId()});
if(w2c.size()<=0){
throw new BusinessException(
"客户物料关系对照表无数据:"+item.getCode()+"/"+item.getName());
}
}catch(Exception ex){
int row=i+1;
int col=j+1;
String errorLog=
"第【"+row+"】行,【"+col+"】列导入错误:"+ex.getMessage();
errorList.add(errorLog);
}
//写入错误日志
if(errorList.size()>0){
ExceptionLog l=EntityFactory.getEntity(ExceptionLog.class);
l.setOperUserName(UserHolder.getUser().getName());
l.setOperUserId(UserHolder.getUser().getId());
l.setOperDate(new Date());
l.setOperPageName("客户订单导入");
l.setOperComponentId("import");
l.setOperComponentName("导入");
l.setType("错误");
l.setOperExceptionMess(customerOrder.getSoCode());
StringBuffer s=new StringBuffer();
for(String log : errorList){
s.append(log+"\r\n");
}
l.setOperException(s.toString());
commonDao.store(l);
try{
throw new BusinessException("导入出现错误,详情请看操作日志!");
}catch(Exception ex){
}
}