fix(deduction): 修复扣分项编辑时赛事ID未携带的问题
- 实体类添加competitionId字段 - Controller查询时从关联项目获取competitionId - 修复project为null时的空指针异常
This commit is contained in:
@@ -52,7 +52,10 @@ public class MartialDeductionItemController extends BladeController {
|
|||||||
List<MartialDeductionItem> deductionItems = pages.getRecords();
|
List<MartialDeductionItem> deductionItems = pages.getRecords();
|
||||||
for (MartialDeductionItem item : deductionItems) {
|
for (MartialDeductionItem item : deductionItems) {
|
||||||
MartialProject project = martialProjectService.getById(item.getProjectId());
|
MartialProject project = martialProjectService.getById(item.getProjectId());
|
||||||
|
if (project != null) {
|
||||||
item.setProjectName(project.getProjectName());
|
item.setProjectName(project.getProjectName());
|
||||||
|
item.setCompetitionId(project.getCompetitionId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return R.data(pages);
|
return R.data(pages);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,4 +93,11 @@ public class MartialDeductionItem extends TenantEntity {
|
|||||||
@Schema(description = "项目名称")
|
@Schema(description = "项目名称")
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 赛事ID
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "赛事ID")
|
||||||
|
private Long competitionId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user