fix:修改App取消报名参加代理商活动,同时删除活动信息

This commit is contained in:
嘉多宝宝 2026-01-15 17:49:49 +08:00
parent 323f730255
commit 550a576a2f

View File

@ -8,16 +8,8 @@ import com.seer.teach.mp.app.controller.req.TestChildCharacterReq;
import com.seer.teach.mp.app.controller.resp.AppMpSignUpActivityResp;
import com.seer.teach.mp.app.controller.resp.TestChildCharacterResp;
import com.seer.teach.mp.app.convert.AppMpActivityInfoCollectionConvert;
import com.seer.teach.mp.entity.MpActivityEntity;
import com.seer.teach.mp.entity.MpActivityInfoCollectionEntity;
import com.seer.teach.mp.entity.MpAgentActivityParticipantEntity;
import com.seer.teach.mp.entity.MpAgentEntity;
import com.seer.teach.mp.entity.MpParentAgentActivityRelationEntity;
import com.seer.teach.mp.service.IMpActivityInfoCollectionService;
import com.seer.teach.mp.service.IMpActivityService;
import com.seer.teach.mp.service.IMpAgentActivityParticipantService;
import com.seer.teach.mp.service.IMpAgentService;
import com.seer.teach.mp.service.IMpParentAgentActivityRelationService;
import com.seer.teach.mp.entity.*;
import com.seer.teach.mp.service.*;
import com.seer.teach.teacher.service.AiModelCallService;
import com.seer.teach.teacher.service.platform.LlmResponse;
import lombok.RequiredArgsConstructor;
@ -126,11 +118,18 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
/**
* 取消报名
*
* @param relationId 关系ID
* @param id 报名ID
* @param parentId 家长ID
* @return true表示成功false表示失败
*/
public boolean cancelSignUp(Integer relationId, Integer parentId) {
public boolean cancelSignUp(Integer id, Integer parentId) {
MpActivityInfoCollectionEntity entity = activityInfoCollectionService.getById(id);
if (entity == null) {
return false;
}
boolean activityResult = activityInfoCollectionService.removeById(entity);
if (activityResult) {
Integer relationId = entity.getRelationId();
MpParentAgentActivityRelationEntity relation = parentAgentActivityRelationService.getById(relationId);
if (Objects.nonNull(relation) && relation.getParentId().equals(parentId)) {
relation.setStatus(0);
@ -138,6 +137,7 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
log.info("取消报名结果:{}", result);
return result;
}
}
return false;
}
@ -154,6 +154,7 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
LambdaQueryWrapper<MpParentAgentActivityRelationEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MpParentAgentActivityRelationEntity::getActivityId, activityId)
.eq(MpParentAgentActivityRelationEntity::getParentId, parentId)
.eq(MpParentAgentActivityRelationEntity::getStatus, 1)
.eq(MpParentAgentActivityRelationEntity::getAgentId, agentId);
MpParentAgentActivityRelationEntity one = parentAgentActivityRelationService.getOne(wrapper);
if (one == null) {