main
黄海 2 years ago
parent c6be1095c4
commit bcfc173be4

@ -26,8 +26,8 @@ public class ImportExcelData {
//模拟上传文件的文件名称
public static String upload_excel_filename = "b61a2af2-223f-4058-a675-b212e4dd9487" + ".xlsx";
public static String bureau_id = UUID.randomUUID().toString().toLowerCase();
public static String person_id = UUID.randomUUID().toString().toLowerCase();
public static String bureau_id = "1fb8611d-2bf3-4a82-a7e8-b03206338deb";
public static String person_id = "c8ef14f2-5dcc-4b62-8964-2282b68ba21d";
public static void main(String[] args) throws IOException, ParseException {
//加载License

@ -357,10 +357,10 @@ public class ImportUtil {
/**
*
*
* @throws IOException
* @throws ParseException
*/
public static void importData(String upload_excel_filename, XSSFWorkbook wb, int sheetIdx, String bureau_id, String person_id) throws IOException, ParseException {
public static void importData(String upload_excel_filename, XSSFWorkbook wb,
int sheetIdx, String bureau_id, String person_id) throws ParseException {
//读取sheet页
XSSFSheet sheet = wb.getSheetAt(sheetIdx);
//通过表名获取到它的读取起始行,终止列
@ -368,6 +368,10 @@ public class ImportUtil {
Record record = Db.findFirst(sql, upload_excel_filename, sheetIdx);
String table_name = record.getStr("table_name");
//先删除
sql = "delete from " + table_name + " where bureau_id=?";
Db.update(sql, bureau_id);
int data_start_row = record.getInt("data_start_row");
int column_num = record.getInt("column_num");

Loading…
Cancel
Save