2020-12-27_八訂対応
[nucalgen] / src / main / java / jp / satomichan / nucalgen / Nucalgen.java
index 8c79e054ccc5b458b4c487fce5982f5ea88b38be..b0295c44ba315ebd648db6e55332d8e09d10300f 100644 (file)
@@ -41,7 +41,7 @@ public class Nucalgen {
                        CommandLineParser parser = new DefaultParser();
                        CommandLine cmd = parser.parse(options, args);
 
-                       final String moeStdFoodCompTableFileName = cmd.getOptionValue("std-food-comp-table");
+                       final String mextStdFoodCompTableFileName = cmd.getOptionValue("std-food-comp-table");
                        final String columnsXmlFileName = cmd.getOptionValue("columns");
                        final String outputXlsxFileName = cmd.getOptionValue("output");
                        final int lines = Integer.parseInt(cmd.getOptionValue("lines"));
@@ -51,17 +51,14 @@ public class Nucalgen {
                        NutritionColumnHolder nc = new NutritionColumnHolder(config);
 
                        //Book生成
-                       Workbook outputWorkbook = WorkbookFactory.create(new FileInputStream(moeStdFoodCompTableFileName));
+                       Workbook outputWorkbook = WorkbookFactory.create(new FileInputStream(mextStdFoodCompTableFileName));
 
                        if(cmd.hasOption("use-processed-table") == false) {
-                               //「本表」変換
+                               //成分表 変換
                                MoeStdFoodCompTable moe = new MoeStdFoodCompTable(cmd.getOptionValue("bright-colored-vegetables-list"));
                                moe.processInto(outputWorkbook);
                        }
 
-                       //「別表」削除
-                       outputWorkbook.removeSheetAt(1);
-
 
                        //「栄養価計算」シート生成
                        Sheet calcSheet = outputWorkbook.createSheet("栄養価計算");
@@ -101,7 +98,7 @@ public class Nucalgen {
                                Row thisRow = calcSheet.createRow(rowIndex);
 
                                thisRow.createCell(1).setCellStyle(csPool.getCellStyle("00000", false));
-                               thisRow.createCell(2).setCellFormula("IFERROR(VLOOKUP(B" + (rowIndex + 1) + ",æ\9c¬è¡¨!$B$9:$BS$2199,3,FALSE),\"\")");
+                               thisRow.createCell(2).setCellFormula("IFERROR(VLOOKUP(B" + (rowIndex + 1) + ",æ\88\90å\88\86表!$B$12:$BL$2500,3,FALSE),\"\")");
                                thisRow.createCell(3).setCellStyle(csPool.getCellStyle("", false));
 
                                colIndex = 4;
@@ -111,7 +108,7 @@ public class Nucalgen {
 
                                        String div100 = aColumn.isUseRawValue() ? "" :  "/ 100 * $D" + (rowIndex + 1);
 
-                                       thisCell.setCellFormula("IFERROR(VLOOKUP($B" + (rowIndex + 1) + ",æ\9c¬è¡¨!$B$9:$BS$2199,MATCH(\"" + aColumn.getName() + "\",æ\9c¬è¡¨!$B$6:$BS$6,0),FALSE) " + div100 + ",\"\")");
+                                       thisCell.setCellFormula("IFERROR(VLOOKUP($B" + (rowIndex + 1) + ",æ\88\90å\88\86表!$B$12:$BL$2500,MATCH(\"" + aColumn.getName() + "\",æ\88\90å\88\86表!$B$11:$BL$11,0),FALSE) " + div100 + ",\"\")");
                                        colIndex++;
                                }