|
楼主 |
发表于 2017-4-21 10:43:40
|
显示全部楼层
ProcessBeforeImportExcelBeforeAction 导入之前的代码
System.out.println("====================================================================");
List<String> list=new ArrayList<String>();//存放excel鉴别列的数据
for(int i=1;i<=sheet.getLastRowNum();i++){
Row row1=sheet.getRow(i);
Cell cell1=row1.getCell(0);//根据excel表中第一列数据进行校验
if(list.contains(cell1.getStringCellValue())){
row.removeCell(cell1);//如果list存在和鉴别列相同的数据就删除
}else{
list.add(cell1.getStringCellValue());//如果不存在就添加到list
}
}
Map<String, Object> parms=new HashMap<String, Object>();
String sql="select b.* from BAS_CUSTOMER b where b.fCUSTOMERCODE=:fCUSTOMERCODE";
for (int i = 0; i < list.size(); i++) {
System.out.println(list.get(i));
parms.put("fCUSTOMERCODE", list.get(i));
Table tab=KSQL.select(sql, parms, "/bms/customer/data", null);
for(Iterator it =tab.iterator(); it.hasNext();){
Row r = (Row) it.next();
System.out.println(r);
}
|
|