Compare commits

..

3 Commits

Author SHA1 Message Date
嘉多宝宝
7597188990 feat:查询APP端AI测试性格报告结果 2026-01-17 15:46:14 +08:00
嘉多宝宝
e000a148ee Merge remote-tracking branch 'origin/master' into dev-chenjiajian 2026-01-17 15:30:31 +08:00
200dde370a 修复代理商活动的问题 2026-01-16 20:14:21 +08:00
2 changed files with 35 additions and 3 deletions

View File

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

View File

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