} //CELL
+
+
//食品群(1~18)書き込み
compRow.createCell(62).setCellValue(group);
-
//緑黄色野菜か?
- if(brightColoredVegetablesXmlFileName.length() > 0) {
- boolean isBrightColored = false;
+ boolean isBrightColored = false;
+ if(group == 6 && brightColoredVegetablesXmlFileName.length() > 0) {
String foodName = thisRow.getCell(3).getStringCellValue();
for(String aBright : this.brightColoredVegetableList) {
- if(foodName.matches(aBright + ".*")) {
+ if(foodName.matches(".*" + aBright + ".*")) {
isBrightColored = true;
break;
}
if(cmd.hasOption("use-processed-table") == false) {
//成分表 変換
- MextStdFoodCompTable moe = new MextStdFoodCompTable(cmd.getOptionValue("bright-colored-vegetables-list"));
- moe.processInto(outputWorkbook);
+ MextStdFoodCompTable stdCompTable = new MextStdFoodCompTable(cmd.getOptionValue("bright-colored-vegetables-list"));
+ stdCompTable.processInto(outputWorkbook);
}
String div100 = aColumn.isUseRawValue() ? "" : "/ 100 * $D" + (rowIndex + 1);
- thisCell.setCellFormula("IFERROR(VLOOKUP($B" + (rowIndex + 1) + ",成分表!$B$12:$BL$2500,MATCH(\"" + aColumn.getName() + "\",成分表!$B$11:$BL$11,0),FALSE) " + div100 + ",\"\")");
+ thisCell.setCellFormula("IFERROR(VLOOKUP($B" + (rowIndex + 1) + "," + aColumn.getTable() + "!$B$12:$BL$2500,MATCH(\"" + aColumn.getName() + "\"," + aColumn.getTable() + "!$B$11:$BL$11,0),FALSE) " + div100 + ",\"\")");
colIndex++;
}
public class NutritionColumn {
private String name;
+ private String table;
private String dispName;
private String format;
private String unit;
this.name = name;
}
+ public String getTable() {
+ return table;
+ }
+
+ public void setTable(String table) {
+ this.table = table;
+ }
+
public void setName(Object name) {
this.name = (String) name;
}
this.nutritionColumnList = new ArrayList<NutritionColumn>();
List<Object> names = aConfig.getList("cols.column.name");
+ List<Object> tables = aConfig.getList("cols.column.table");
List<Object> dispNames = aConfig.getList("cols.column.disp_name");
List<Object> aliases = aConfig.getList("cols.column.alias");
List<Object> formats = aConfig.getList("cols.column.format");
for (Object aName : names) {
NutritionColumn nc = new NutritionColumn();
nc.setName((String) aName);
+ nc.setTable((String) tables.get(names.indexOf(aName)));
nc.setDispName((String) dispNames.get(names.indexOf(aName)));
nc.setAlias((String) aliases.get(names.indexOf(aName)));
nc.setFormat((String) formats.get(names.indexOf(aName)));