发布网友 发布时间:2022-04-11 22:08
共4个回答
懂视网 时间:2022-04-12 02:29
Workbook wb = Workbook.getWorkbook(new File(E:\lt.xls)); SimpleDateFormat df = new SimpleDateFormat(yyyyMMdd); Sheet sheet = wb.getSheet(0);// Cell cell = sheet.getCell(2,4); int hang = sheet.getRows(); int lie = sheet.getColumns(); ListH
Workbook wb = Workbook.getWorkbook(new File("E:\lt.xls")); SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); Sheet sheet = wb.getSheet(0); // Cell cell = sheet.getCell(2,4); int hang = sheet.getRows(); int lie = sheet.getColumns(); List
list = new ArrayList (); for(int x=1;x<500;x++){ String id = UUID.randomUUID().toString(); Huadan huadan = new Huadan(); huadan.setHdid(id); huadan.setThqsrq(df.parse(sheet.getCell(1, x).getContents())); System.out.println(df.parse(sheet.getCell(1, x).getContents())); huadan.setThqssj(sheet.getCell(2, x).getContents()); System.out.println(sheet.getCell(2, x).getContents()); huadan.setThsc(Integer.parseInt(sheet.getCell(3, x).getContents())); System.out.println(Integer.parseInt(sheet.getCell(3, x).getContents())); huadan.setHjlx(sheet.getCell(4, x).getContents()); System.out.println(sheet.getCell(4, x).getContents()); huadan.setMylx(sheet.getCell(5, x).getContents()); System.out.println(sheet.getCell(5, x).getContents()); huadan.setDfdqh(sheet.getCell(6, x).getContents()); System.out.println(sheet.getCell(6, x).getContents()); huadan.setDfhmq(sheet.getCell(7, x).getContents()); System.out.println(sheet.getCell(7, x).getContents()); huadan.setBjh(sheet.getCell(8, x).getContents()); System.out.println(sheet.getCell(8, x).getContents()); huadan.setThlx(sheet.getCell(9, x).getContents()); System.out.println(sheet.getCell(9, x).getContents()+"dddddddd"); huadan.setYsjbthf(Double.parseDouble(sheet.getCell(10, x).getContents())); System.out.println(Double.parseDouble(sheet.getCell(10, x).getContents())); huadan.setYhhjbthf(Double.parseDouble(sheet.getCell(11, x).getContents())); System.out.println(Double.parseDouble(sheet.getCell(11, x).getContents())); huadan.setYsctthf(Double.parseDouble(sheet.getCell(12, x).getContents())); System.out.println(Double.parseDouble(sheet.getCell(12, x).getContents())); huadan.setYhhctthf(Double.parseDouble(sheet.getCell(13, x).getContents())); System.out.println(Double.parseDouble(sheet.getCell(13, x).getContents())); huadan.setYsqtf(Double.parseDouble(sheet.getCell(14, x).getContents())); System.out.println(Double.parseDouble(sheet.getCell(14, x).getContents())); huadan.setYhh(Double.parseDouble(sheet.getCell(15, x).getContents())); System.out.println(Double.parseDouble(sheet.getCell(15, x).getContents())); huadan.setJzh(sheet.getCell(16, x).getContents()); System.out.println(sheet.getCell(16, x).getContents()); huadan.setXqh(sheet.getCell(17, x).getContents()); System.out.println(sheet.getCell(17, x).getContents()); huadan.setImei(sheet.getCell(18, x).getContents()); System.out.println(sheet.getCell(18, x).getContents()); System.out.println("----------------------------------------"); list.add(huadan); } //System.out.println(hang+" "+lie); wb.close(); for(int x=0;x
热心网友 时间:2022-04-11 23:37
把取到的String strc = c.getContents();按照你想传到后台数据库的变量进行赋值,然后把这些变量传到service去热心网友 时间:2022-04-12 00:55
将取到的数据可以先组装成List类型数据,然后再写,或者直接写入数据库,数据库应该有对应的字段热心网友 时间:2022-04-12 02:30
你可以把数据封装成一个对象,用集合处理下