Skip to content

Commit

Permalink
Merge pull request #62 from Korea-Certified-Store/refactor/lighten-ex…
Browse files Browse the repository at this point in the history
…cel-dataset(#61)

Excel dataset 파일 크기 줄이기 (#61)
  • Loading branch information
sungjindev authored Jan 18, 2024
2 parents 8c335c9 + f9766a2 commit 163b2aa
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ public static List<StoreDataByParser> getAllGoodPriceStores(String fileName) {

StoreDataByParser storeDataByParser = new StoreDataByParser();

Cell nameCell = row.getCell(3); //가게 이름이 저장되어있는 3번 컬럼 조회
Cell nameCell = row.getCell(0); //가게 이름이 저장되어있는 0번 컬럼 조회
if(isCellEmpty(nameCell)) //Empty cell, Blank cell Empty string 여부를 검사
continue;

if (nameCell.getCellType() == CellType.STRING) {
storeDataByParser.setName(nameCell.getStringCellValue());
}

Cell addressCell = row.getCell(5); //주소가 적힌 컬럼을 조회!
Cell addressCell = row.getCell(1); //주소가 적힌 1번 컬럼을 조회!
if (!isCellEmpty(addressCell)) {
if(addressCell.getCellType() == CellType.STRING) {
storeDataByParser.setAddress(addressCell.getStringCellValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public List<StoreRegularOpeningHours> parseWeekdayDescriptions(List<String> week
storeOpenDay.setHour(0);
storeOpenDay.setMinute(0);
storeCloseDay.setDay(storeDay);
storeCloseDay.setHour(24);
storeCloseDay.setHour(0);
storeCloseDay.setMinute(0);
storeRegularOpeningHours.setOpen(storeOpenDay);
storeRegularOpeningHours.setClose(storeCloseDay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,37 @@ public static List<StoreDataByParser> getAllMobeomStores(String fileName) {
for (int i = 1; i <= sheet.getLastRowNum(); i++) { //0번째 Row는 column title이라 제외하고 1번부터 마지막 Row까지 조회
Row row = sheet.getRow(i);

Cell statusCell = row.getCell(9); //영업중인지 폐업중인지를 나타내는 9번 컬럼에 대해 검사
if (isCellEmpty(statusCell)) { //이렇게 isCellEmpty() Method처럼 다중으로 검증해주지 않으면 POI에서 제대로 Blank cell이나 Empty cell에 대해서 처리를 잘 못한다.
continue;
}
// Cell statusCell = row.getCell(9); //영업중인지 폐업중인지를 나타내는 9번 컬럼에 대해 검사
// if (isCellEmpty(statusCell)) { //이렇게 isCellEmpty() Method처럼 다중으로 검증해주지 않으면 POI에서 제대로 Blank cell이나 Empty cell에 대해서 처리를 잘 못한다.
// continue;
// }

if (statusCell.getCellType() == CellType.STRING) { //빡빡하게 타입 검사! String 일때만 비교하기
if(statusCell.getStringCellValue().equals("폐업")) //영업 상태가 폐업이면 skip
continue;
}
// if (statusCell.getCellType() == CellType.STRING) { //빡빡하게 타입 검사! String 일때만 비교하기
// if(statusCell.getStringCellValue().equals("폐업")) //영업 상태가 폐업이면 skip
// continue;
// }

Cell unregisteredCell = row.getCell(13); //모범 음식점 지정 취소가되면 해당 컬럼에 날짜가 기입된다. 따라서, 해당 Cell 값이 비어있어야 현재도 모범 음식점으로 지정된 곳이다.
if(!isCellEmpty(unregisteredCell))
continue;
// Cell unregisteredCell = row.getCell(13); //모범 음식점 지정 취소가되면 해당 컬럼에 날짜가 기입된다. 따라서, 해당 Cell 값이 비어있어야 현재도 모범 음식점으로 지정된 곳이다.
// if(!isCellEmpty(unregisteredCell))
// continue;

StoreDataByParser storeDataByParser = new StoreDataByParser();

Cell nameCell = row.getCell(4); //가개 이름이 저장되어있는 4번 컬럼 조회
Cell nameCell = row.getCell(0); //가게 이름이 저장되어있는 0번 컬럼 조회
if(isCellEmpty(nameCell)) //Empty cell, Blank cell Empty string 여부를 검사
continue;

if (nameCell.getCellType() == CellType.STRING) {
storeDataByParser.setName(nameCell.getStringCellValue());
}

Cell streetNumberAddressCell = row.getCell(7); //지번 주소가 적힌 컬럼을 먼저 조회!
Cell streetNumberAddressCell = row.getCell(2); //지번 주소가 적힌 컬럼을 먼저 조회!
if (!isCellEmpty(streetNumberAddressCell)) {
if(streetNumberAddressCell.getCellType() == CellType.STRING) {
storeDataByParser.setAddress(streetNumberAddressCell.getStringCellValue());
}
} else {
Cell streetNameAddressCell = row.getCell(6);
Cell streetNameAddressCell = row.getCell(1);
if (!isCellEmpty(streetNameAddressCell)) { //만약에 지번 주소가 없는 가게면 도로명 주소를 조회
if(streetNameAddressCell.getCellType() == CellType.STRING) {
storeDataByParser.setAddress(streetNameAddressCell.getStringCellValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public List<StoreRegularOpeningHours> parseWeekdayDescriptions(List<String> week
storeOpenDay.setHour(0);
storeOpenDay.setMinute(0);
storeCloseDay.setDay(storeDay);
storeCloseDay.setHour(24);
storeCloseDay.setHour(0);
storeCloseDay.setMinute(0);
storeRegularOpeningHours.setOpen(storeOpenDay);
storeRegularOpeningHours.setClose(storeCloseDay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,31 @@ public static List<StoreDataByParser> getAllSafeStores(String fileName) {
for (int i = 1; i <= sheet.getLastRowNum(); i++) { //0번째 Row는 column title이라 제외하고 1번부터 마지막 Row까지 조회
Row row = sheet.getRow(i);

Cell statusCell = row.getCell(12); //현재 안심 식당을 유지하고 있는지를 알려주는 12번 컬럼에 대해 검사.
if (isCellEmpty(statusCell)) { //이렇게 isCellEmpty() Method처럼 다중으로 검증해주지 않으면 POI에서 제대로 Blank cell이나 Empty cell에 대해서 처리를 잘 못한다.
continue;
}
// Cell statusCell = row.getCell(12); //현재 안심 식당을 유지하고 있는지를 알려주는 12번 컬럼에 대해 검사.
// if (isCellEmpty(statusCell)) { //이렇게 isCellEmpty() Method처럼 다중으로 검증해주지 않으면 POI에서 제대로 Blank cell이나 Empty cell에 대해서 처리를 잘 못한다.
// continue;
// }

if (statusCell.getCellType() == CellType.STRING) { //빡빡하게 타입 검사! String 일때만 비교하기
if(statusCell.getStringCellValue().equals("N")) //만약에 선정 여부가 "N"이면 인증 취소된 것이므로 skip!
continue;
}
// if (statusCell.getCellType() == CellType.STRING) { //빡빡하게 타입 검사! String 일때만 비교하기
// if(statusCell.getStringCellValue().equals("N")) //만약에 선정 여부가 "N"이면 인증 취소된 것이므로 skip!
// continue;
// }

Cell unregisteredCell = row.getCell(13); //안심 식당 지정 취소가되면 해당 컬럼에 날짜가 기입된다. 따라서, 해당 Cell 값이 비어있어야 현재도 안심 식당으로 지정된 곳이다.
if(!isCellEmpty(unregisteredCell))
continue;
// Cell unregisteredCell = row.getCell(13); //안심 식당 지정 취소가되면 해당 컬럼에 날짜가 기입된다. 따라서, 해당 Cell 값이 비어있어야 현재도 안심 식당으로 지정된 곳이다.
// if(!isCellEmpty(unregisteredCell))
// continue;

StoreDataByParser storeDataByParser = new StoreDataByParser();

Cell nameCell = row.getCell(4); //가개 이름이 저장되어있는 4번 컬럼 조회
Cell nameCell = row.getCell(0); //가개 이름이 저장되어있는 0번 컬럼 조회
if(isCellEmpty(nameCell)) //Empty cell, Blank cell Empty string 여부를 검사
continue;

if (nameCell.getCellType() == CellType.STRING) {
storeDataByParser.setName(nameCell.getStringCellValue());
}

Cell addressCell = row.getCell(7); //주소가 적힌 컬럼을 조회!
Cell addressCell = row.getCell(1); //주소가 적힌 1번 컬럼을 조회!
if (!isCellEmpty(addressCell)) {
if(addressCell.getCellType() == CellType.STRING) {
storeDataByParser.setAddress(addressCell.getStringCellValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public List<StoreRegularOpeningHours> parseWeekdayDescriptions(List<String> week
storeOpenDay.setHour(0);
storeOpenDay.setMinute(0);
storeCloseDay.setDay(storeDay);
storeCloseDay.setHour(24);
storeCloseDay.setHour(0);
storeCloseDay.setMinute(0);
storeRegularOpeningHours.setOpen(storeOpenDay);
storeRegularOpeningHours.setClose(storeCloseDay);
Expand Down
Binary file modified src/main/resources/data/goodPrice/goodPrice_20230428.xlsx
Binary file not shown.
Binary file not shown.
Binary file modified src/main/resources/data/goodPrice/goodPrice_test.xlsx
Binary file not shown.
Binary file modified src/main/resources/data/mobeom/mobeom_20240104.xlsx
Binary file not shown.
Binary file not shown.
Binary file modified src/main/resources/data/mobeom/mobeom_test.xlsx
Binary file not shown.
Binary file not shown.
Binary file removed src/main/resources/data/mobeom/mobeom_test500.xlsx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified src/main/resources/data/safe/safe_test.xlsx
Binary file not shown.

0 comments on commit 163b2aa

Please sign in to comment.