Compare commits

..

No commits in common. "759718899027facc59d64577ecfd74dfd14a2cad" and "082a6ad7be4f1b0668908dd5d019ece200fd1162" have entirely different histories.

2 changed files with 3 additions and 35 deletions

View File

@ -97,21 +97,9 @@ public class AdminActivityInfoCollectionResp {
@Schema(description = "偏科(数学、英语等)")
private String weakSubject;
/**
* 弱点学科
*/
@Schema(description = "创建时间")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Schema(description = "更新时间")
private LocalDateTime updateTime;
/**
* 代理商拨打电话联系家长的次数
*/
@Schema(description = "代理商拨打电话联系家长的次数")
private Integer contactCallCount = 0;
}

View File

@ -186,31 +186,11 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
result = parseAiResponse(content);
result.setConstellation(request.getConstellation());
// 先查询该家长是否已有性格测试记录有则更新无则新增
MpTestChildCharacterEntity existingEntity = mpTestChildCharacterService
.lambdaQuery()
.eq(MpTestChildCharacterEntity::getParentId, parentId)
.orderByDesc(MpTestChildCharacterEntity::getCreateTime)
.last("LIMIT 1")
.one();
// 如果AI调用成功则将测试结果保存到数据库中
MpTestChildCharacterEntity entity = getCharacterEntity(request, parentId, result);
boolean saveOrUpdateResult;
if (existingEntity != null) {
// 如果存在记录则更新
entity.setId(existingEntity.getId());
saveOrUpdateResult = mpTestChildCharacterService.updateById(entity);
log.info("更新性格测试结果成功家长ID: {}", parentId);
} else {
// 如果不存在记录则新增
saveOrUpdateResult = mpTestChildCharacterService.save(entity);
log.info("保存性格测试结果成功家长ID: {}", parentId);
}
if (!saveOrUpdateResult) {
log.error("保存或更新性格测试结果失败家长ID: {}", parentId);
boolean save = mpTestChildCharacterService.save(entity);
if (save) {
log.info("保存性格测试结果成功");
}
} else {
// 如果AI调用失败返回默认响应