fix(schedule): 修复集体项目类型显示为双人的问题
- 修改MartialScheduleServiceImpl中type=2的显示文本从双人改为集体 - 保持与前端项目管理页面的类型定义一致(1=单人,2=集体)
This commit is contained in:
+7
-10
@@ -15,6 +15,7 @@ import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.martial.pojo.entity.MartialAthlete;
|
||||
import org.springblade.modules.martial.pojo.entity.MartialCompetition;
|
||||
import org.springblade.modules.martial.service.IMartialAthleteService;
|
||||
import org.springblade.modules.martial.mapper.MartialAthleteMapper;
|
||||
import org.springblade.modules.martial.service.IMartialCompetitionService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -43,11 +44,9 @@ public class MartialCompetitionController extends BladeController {
|
||||
public R<MartialCompetition> detail(@RequestParam Long id) {
|
||||
MartialCompetition detail = competitionService.getById(id);
|
||||
if (detail != null) {
|
||||
Long cnt = martialAthleteService.count(Wrappers.<MartialAthlete>query().lambda()
|
||||
.eq(MartialAthlete::getCompetitionId, detail.getId())
|
||||
.eq(MartialAthlete::getIsDeleted, 0)
|
||||
);
|
||||
detail.setTotalParticipants(cnt.intValue());
|
||||
// Count distinct participants by id_card
|
||||
Long cnt = ((MartialAthleteMapper) martialAthleteService.getBaseMapper()).countDistinctParticipants(detail.getId());
|
||||
detail.setTotalParticipants(cnt != null ? cnt.intValue() : 0);
|
||||
}
|
||||
return R.data(detail);
|
||||
}
|
||||
@@ -61,11 +60,9 @@ public class MartialCompetitionController extends BladeController {
|
||||
IPage<MartialCompetition> pages = competitionService.page(Condition.getPage(query), Condition.getQueryWrapper(competition));
|
||||
List<MartialCompetition> pagelist = pages.getRecords();
|
||||
for (MartialCompetition martialCompetition : pagelist) {
|
||||
Long cnt = martialAthleteService.count(Wrappers.<MartialAthlete>query().lambda()
|
||||
.eq(MartialAthlete::getCompetitionId, martialCompetition.getId())
|
||||
.eq(MartialAthlete::getIsDeleted, 0)
|
||||
);
|
||||
martialCompetition.setTotalParticipants(cnt.intValue());
|
||||
// Count distinct participants by id_card
|
||||
Long cnt = ((MartialAthleteMapper) martialAthleteService.getBaseMapper()).countDistinctParticipants(martialCompetition.getId());
|
||||
martialCompetition.setTotalParticipants(cnt != null ? cnt.intValue() : 0);
|
||||
}
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
+2
@@ -385,6 +385,8 @@ public class MartialRegistrationOrderController extends BladeController {
|
||||
newRecord.setGender(existingAthlete.getGender());
|
||||
newRecord.setIdCard(existingAthlete.getIdCard());
|
||||
newRecord.setIdCardType(existingAthlete.getIdCardType());
|
||||
newRecord.setBirthDate(existingAthlete.getBirthDate());
|
||||
newRecord.setAge(existingAthlete.getAge());
|
||||
newRecord.setContactPhone(existingAthlete.getContactPhone());
|
||||
newRecord.setOrganization(existingAthlete.getOrganization());
|
||||
newRecord.setTeamName(existingAthlete.getTeamName());
|
||||
|
||||
@@ -22,4 +22,10 @@ public interface MartialAthleteMapper extends BaseMapper<MartialAthlete> {
|
||||
*/
|
||||
IPage<MartialAthleteVO> selectAthleteVOPage(IPage<MartialAthleteVO> page, @Param("athlete") MartialAthlete athlete);
|
||||
|
||||
/**
|
||||
* Count distinct participants by id_card for a competition
|
||||
*/
|
||||
@org.apache.ibatis.annotations.Select("SELECT COUNT(DISTINCT id_card) FROM martial_athlete WHERE competition_id = #{competitionId} AND is_deleted = 0")
|
||||
Long countDistinctParticipants(@Param("competitionId") Long competitionId);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -348,7 +348,7 @@ public class MartialScheduleServiceImpl extends ServiceImpl<MartialScheduleMappe
|
||||
groupDTO.setType("单人");
|
||||
break;
|
||||
case 2:
|
||||
groupDTO.setType("双人");
|
||||
groupDTO.setType("集体");
|
||||
break;
|
||||
case 3:
|
||||
groupDTO.setType("集体");
|
||||
|
||||
Reference in New Issue
Block a user