dev-chenjiajian #1

Merged
ChenJiaJian merged 8 commits from dev-chenjiajian into master 2026-01-17 16:31:39 +08:00
Showing only changes of commit 26cb54ab3d - Show all commits

View File

@ -114,25 +114,60 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
entity.setLearningSituation(request.getLearningSituation());
entity.setWeakSubjectIds(request.getWeakSubjectIds());
entity.setStrongSubjectIds(request.getStrongSubjectIds());
return activityInfoCollectionService.updateById(entity);
boolean updateResult = activityInfoCollectionService.updateById(entity);
if (updateResult) {
// 查询性格测试记录如果存在则删除
MpTestChildCharacterEntity characterEntity = mpTestChildCharacterService
.lambdaQuery()
.eq(MpTestChildCharacterEntity::getParentId, parentId)
.orderByDesc(MpTestChildCharacterEntity::getCreateTime)
.last("LIMIT 1")
.one();
if (characterEntity != null) {
// 如果存在性格测试记录则删除
boolean removeResult = mpTestChildCharacterService.removeById(characterEntity.getId());
log.info("删除AI测试结果: {}", removeResult);
} else {
log.info("未找到家长 {} 的性格测试记录,无需删除", parentId);
}
}
return updateResult;
}
/**
* 取消报名
*
* @param id 报名ID
* @param parentId 家长ID
* @param id 报名ID
* @param parentId 家长ID
* @return true表示成功false表示失败
*/
@Transactional(rollbackFor = Exception.class, timeout = 120)
public boolean cancelSignUp(Integer id, Integer parentId) {
MpActivityInfoCollectionEntity entity = activityInfoCollectionService.getById(id);
MpActivityInfoCollectionEntity entity = activityInfoCollectionService.getById(id);
if (entity == null) {
return false;
}
boolean activityResult = activityInfoCollectionService.removeById(entity);
if (activityResult) {
Integer relationId = entity.getRelationId();
// 查询性格测试记录如果存在则删除
MpTestChildCharacterEntity characterEntity = mpTestChildCharacterService
.lambdaQuery()
.eq(MpTestChildCharacterEntity::getParentId, parentId)
.orderByDesc(MpTestChildCharacterEntity::getCreateTime)
.last("LIMIT 1")
.one();
if (characterEntity != null) {
// 如果存在性格测试记录则删除
boolean removeResult = mpTestChildCharacterService.removeById(characterEntity.getId());
log.info("删除AI测试结果: {}", removeResult);
} else {
log.info("未找到家长 {} 的性格测试记录,无需删除", parentId);
}
return parentAgentActivityRelationService.removeById(relationId);
}
return false;
@ -328,6 +363,7 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
/**
* 获取孩子性格返回结果
*
* @param parentId 家长ID
* @return 孩子性格返回结果
*/