Commit f2c1b719 by Daichi Sato

#59888 typoによるcategory_idが保存できない問題の修正とジャンル別に分ける処理をcategoryId基準で分けるように変更

parent 40a29f11
...@@ -220,7 +220,7 @@ public class ContentDao extends AbstractDao { ...@@ -220,7 +220,7 @@ public class ContentDao extends AbstractDao {
} }
// ABookCheck用 // ABookCheck用
column = cursor.getColumnIndex("categeory_id"); column = cursor.getColumnIndex("category_id");
if (column != -1) { if (column != -1) {
dto.categoryId = cursor.getInt(column); dto.categoryId = cursor.getInt(column);
} }
......
...@@ -3,6 +3,8 @@ package jp.agentec.abook.abv.bl.dto; ...@@ -3,6 +3,8 @@ package jp.agentec.abook.abv.bl.dto;
import java.util.List; import java.util.List;
public class CategoryContentDto { public class CategoryContentDto {
public int categoryId;
public String categoryName; public String categoryName;
public List<ContentDto> contentDtoArray; public List<ContentDto> contentDtoArray;
} }
...@@ -1323,7 +1323,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1323,7 +1323,7 @@ public class OperationLogic extends AbstractLogic {
CategoryContentDto categoryContentDto = new CategoryContentDto(); CategoryContentDto categoryContentDto = new CategoryContentDto();
for (ContentDto contentDto : contentDtoList) { for (ContentDto contentDto : contentDtoList) {
if (contentDto.categoryNames.equals(categoryContentDto.categoryName)) { if (contentDto.categoryId == categoryContentDto.categoryId) {
saveContentDtoArray.add(contentDto); saveContentDtoArray.add(contentDto);
} else { } else {
if (saveContentDtoArray.size() != 0) { if (saveContentDtoArray.size() != 0) {
...@@ -1332,6 +1332,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1332,6 +1332,7 @@ public class OperationLogic extends AbstractLogic {
} }
categoryContentDto = new CategoryContentDto(); categoryContentDto = new CategoryContentDto();
saveContentDtoArray = new ArrayList<ContentDto>(); saveContentDtoArray = new ArrayList<ContentDto>();
categoryContentDto.categoryId = contentDto.categoryId;
categoryContentDto.categoryName = contentDto.categoryNames; categoryContentDto.categoryName = contentDto.categoryNames;
saveContentDtoArray.add(contentDto); saveContentDtoArray.add(contentDto);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment