Compare commits
No commits in common. "0b9a2cf1a5caf8da58a3acea8b3441cba158c93a" and "200dde370a3f9c07d1e74a957540e746b62ef46b" have entirely different histories.
0b9a2cf1a5
...
200dde370a
@ -19,7 +19,7 @@ import java.util.List;
|
||||
* @since 2025-12-30
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "mp_activity_info_collection", autoResultMap = true)
|
||||
@TableName("mp_activity_info_collection")
|
||||
@Schema(name = "MpActivityInfoCollectionEntity对象", description = "活动信息收集表")
|
||||
public class MpActivityInfoCollectionEntity extends BaseEntity {
|
||||
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
package com.seer.teach.mp.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.seer.teach.common.entity.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 嘉多宝宝
|
||||
* @since 2026-01-17
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("mp_test_child_character")
|
||||
@Schema(name = "MpTestChildCharacterEntity对象", description = "测试孩子性格")
|
||||
public class MpTestChildCharacterEntity extends BaseEntity {
|
||||
|
||||
|
||||
@TableField("parent_id")
|
||||
@Schema(description = "家长ID")
|
||||
private Integer parentId;
|
||||
|
||||
@TableField("grade")
|
||||
@Schema(description = "年级")
|
||||
private String grade;
|
||||
|
||||
@TableField("constellation")
|
||||
@Schema(description = "星座")
|
||||
private String constellation;
|
||||
|
||||
@TableField("child_birth_date")
|
||||
@Schema(description = "出生年月")
|
||||
private LocalDate childBirthDate;
|
||||
|
||||
@TableField("child_gender")
|
||||
@Schema(description = "孩子性别(男,女)")
|
||||
private String childGender;
|
||||
|
||||
@TableField("character_analysis")
|
||||
@Schema(description = "性格分析结果")
|
||||
private String characterAnalysis;
|
||||
|
||||
@TableField("character_traits")
|
||||
@Schema(description = "性格特征")
|
||||
private String characterTraits;
|
||||
|
||||
@TableField("suggestions")
|
||||
@Schema(description = "建议")
|
||||
private String suggestions;
|
||||
|
||||
@TableField("character_type")
|
||||
@Schema(description = "性格类型")
|
||||
private String characterType;
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.seer.teach.mp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.seer.teach.mp.entity.MpTestChildCharacterEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 嘉多宝宝
|
||||
* @since 2026-01-17
|
||||
*/
|
||||
public interface MpTestChildCharacterMapper extends BaseMapper<MpTestChildCharacterEntity> {
|
||||
|
||||
}
|
||||
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.seer.teach.mp.mapper.MpTestChildCharacterMapper">
|
||||
|
||||
</mapper>
|
||||
@ -63,8 +63,7 @@ public class AdminAgentEmployeeRelationController {
|
||||
@Operation(summary = "根据代理商ID获取员工列表")
|
||||
@GetMapping("/by-agent/{agentId}")
|
||||
@SaCheckPermission("mp:admin:agent:employee:by-agent")
|
||||
public ResultBean<PageListBean<AgentEmployeeRelationResp>> getByAgent(@PathVariable Integer agentId,
|
||||
@RequestBody @Validated AgentEmployeeRelationQueryReq query) {
|
||||
return ResultBean.success(agentEmployeeRelationService.getEmployeeRelationsByAgentId(agentId, query));
|
||||
public ResultBean<java.util.List<AgentEmployeeRelationResp>> getByAgent(@PathVariable Integer agentId) {
|
||||
return ResultBean.success(agentEmployeeRelationService.getEmployeeRelationsByAgentId(agentId));
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,9 @@ import lombok.Data;
|
||||
@Data
|
||||
public class AgentEmployeeRelationQueryReq extends PageRequest {
|
||||
|
||||
@Schema(description = "代理商名称")
|
||||
private String agentName;
|
||||
|
||||
@Schema(description = "员工名称")
|
||||
private String employeeName;
|
||||
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package com.seer.teach.mp.admin.service;
|
||||
|
||||
import com.seer.teach.common.PageListBean;
|
||||
import com.seer.teach.mp.admin.controller.req.AgentEmployeeRelationQueryReq;
|
||||
import com.seer.teach.mp.admin.controller.req.AgentEmployeeSaveReq;
|
||||
import com.seer.teach.mp.admin.controller.req.AgentEmployeeUpdateReq;
|
||||
import com.seer.teach.mp.admin.controller.resp.AgentEmployeeRelationResp;
|
||||
import com.seer.teach.mp.admin.controller.req.AgentEmployeeRelationQueryReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -54,7 +56,7 @@ public interface IAdminAgentEmployeeRelationService {
|
||||
* @param agentId 代理商ID
|
||||
* @return 员工关联列表
|
||||
*/
|
||||
PageListBean<AgentEmployeeRelationResp> getEmployeeRelationsByAgentId(Integer agentId,AgentEmployeeRelationQueryReq query);
|
||||
List<AgentEmployeeRelationResp> getEmployeeRelationsByAgentId(Integer agentId);
|
||||
|
||||
/**
|
||||
* 新增代理商员工关联(管理端)
|
||||
|
||||
@ -22,6 +22,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -47,6 +48,7 @@ public class AdminAgentEmployeeRelationServiceImpl implements IAdminAgentEmploye
|
||||
public PageListBean<AgentEmployeeRelationResp> pageList(AgentEmployeeRelationQueryReq query) {
|
||||
Page<MpAgentEmployeeRelationEntity> pageParm = new Page<>(query.getPageNo(), query.getPageSize());
|
||||
var pageResult = agentEmployeeRelationService.page(pageParm, new LambdaQueryWrapper<>(MpAgentEmployeeRelationEntity.class)
|
||||
.like(Objects.nonNull(query.getAgentName()), MpAgentEmployeeRelationEntity::getAgentName, query.getAgentName())
|
||||
.like(Objects.nonNull(query.getEmployeeName()), MpAgentEmployeeRelationEntity::getEmployeeName, query.getEmployeeName())
|
||||
.eq(Objects.nonNull(query.getStatus()), MpAgentEmployeeRelationEntity::getStatus, query.getStatus()));
|
||||
|
||||
@ -95,14 +97,11 @@ public class AdminAgentEmployeeRelationServiceImpl implements IAdminAgentEmploye
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageListBean<AgentEmployeeRelationResp> getEmployeeRelationsByAgentId(Integer agentId,AgentEmployeeRelationQueryReq query) {
|
||||
Page<MpAgentEmployeeRelationEntity> page = new Page<>(query.getPageNo(), query.getPageSize());
|
||||
LambdaQueryWrapper<MpAgentEmployeeRelationEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MpAgentEmployeeRelationEntity::getAgentId, agentId)
|
||||
.like(Objects.nonNull(query.getEmployeeName()), MpAgentEmployeeRelationEntity::getEmployeeName, query.getEmployeeName())
|
||||
.eq(Objects.nonNull(query.getStatus()), MpAgentEmployeeRelationEntity::getStatus, query.getStatus());
|
||||
Page<MpAgentEmployeeRelationEntity> pageParm = agentEmployeeRelationService.page(page, wrapper);
|
||||
return PageConverterUtils.convertPageListBean(pageParm, AdminAgentEmployeeRelationConvert.INSTANCE::convertToRespList);
|
||||
public List<AgentEmployeeRelationResp> getEmployeeRelationsByAgentId(Integer agentId) {
|
||||
var relations = agentEmployeeRelationService.getEmployeeRelationsByAgentId(agentId);
|
||||
return relations.stream()
|
||||
.map(AdminAgentEmployeeRelationConvert.INSTANCE::convertToResp)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
--创建孩子性格测试表
|
||||
DROP TABLE IF EXISTS `mp_test_child_character`;
|
||||
CREATE TABLE `mp_test_child_character`(
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`parent_id` int NULL DEFAULT NULL COMMENT '家长Id',
|
||||
`grade` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '年级',
|
||||
`constellation` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '星座',
|
||||
`child_birth_date` date NULL DEFAULT NULL COMMENT '出生年月',
|
||||
`child_gender` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '孩子性别(男,女)',
|
||||
`character_analysis` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '性格分析结果',
|
||||
`character_traits` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '性格特征',
|
||||
`suggestions` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '建议',
|
||||
`character_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '性格类型',
|
||||
`deleted` int NOT NULL COMMENT '逻辑删除(0-正常,1-已删除)',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '修改人',
|
||||
`tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '租户Id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_german2_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
SET
|
||||
FOREIGN_KEY_CHECKS = 1;
|
||||
@ -5,7 +5,6 @@ import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.seer.teach.common.ResultBean;
|
||||
import com.seer.teach.mp.app.controller.req.AppMpSignUpActivityReq;
|
||||
import com.seer.teach.mp.app.controller.req.TestChildCharacterReq;
|
||||
import com.seer.teach.mp.app.controller.resp.AppChildCharacterResp;
|
||||
import com.seer.teach.mp.app.controller.resp.AppMpSignUpActivityResp;
|
||||
import com.seer.teach.mp.app.controller.resp.TestChildCharacterResp;
|
||||
import com.seer.teach.mp.app.service.AppParentAgentActivityService;
|
||||
@ -14,7 +13,13 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 家长参与代理商活动控制器 - 应用端
|
||||
@ -61,17 +66,9 @@ public class AppParentAgentActivityController {
|
||||
|
||||
@PostMapping("/test-child-character")
|
||||
@SaCheckLogin
|
||||
@Operation(summary = "AI测试孩子性格")
|
||||
@Operation(summary = "测试孩子性格")
|
||||
public ResultBean<TestChildCharacterResp> testChildCharacter(@RequestBody @Valid TestChildCharacterReq request) {
|
||||
Integer parentId = StpUtil.getLoginIdAsInt();
|
||||
return ResultBean.success(appParentAgentActivityService.testChildCharacter(request, parentId));
|
||||
}
|
||||
|
||||
@GetMapping("/get-child-character")
|
||||
@SaCheckLogin
|
||||
@Operation(summary = "获取AI测试性格报告")
|
||||
public ResultBean<AppChildCharacterResp> getChildCharacter() {
|
||||
Integer parentId = StpUtil.getLoginIdAsInt();
|
||||
return ResultBean.success(appParentAgentActivityService.getChildCharacter(parentId));
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
package com.seer.teach.mp.app.controller.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "测试孩子性格请求对象")
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
package com.seer.teach.mp.app.controller.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "孩子性格响应对象")
|
||||
@Data
|
||||
public class AppChildCharacterResp {
|
||||
|
||||
@Schema(description = "性格分析结果")
|
||||
private String characterAnalysis;
|
||||
|
||||
@Schema(description = "性格特征")
|
||||
private String characterTraits;
|
||||
|
||||
@Schema(description = "建议")
|
||||
private String suggestions;
|
||||
|
||||
@Schema(description = "性格类型")
|
||||
private String characterType;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String grade;
|
||||
|
||||
@Schema(description = "星座")
|
||||
private String constellation;
|
||||
|
||||
@Schema(description = "出生年月")
|
||||
private LocalDate childBirthDate;
|
||||
|
||||
@Schema(description = "孩子性别(男,女)")
|
||||
private String childGender;
|
||||
}
|
||||
@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(name = "AppMpSignUpActivityResp", description = "家长报名参加代理商活动信息Resp")
|
||||
@Data
|
||||
@ -55,12 +54,6 @@ public class AppMpSignUpActivityResp {
|
||||
@Schema(description = "薄弱科目")
|
||||
private String weakSubject;
|
||||
|
||||
@Schema(description = "薄弱科目")
|
||||
private List<Integer> weakSubjectIds;
|
||||
|
||||
@Schema(description = "优势科目")
|
||||
private List<Integer> strongSubjectIds;
|
||||
|
||||
@Schema(description = "代理商拨打电话联系家长的次数")
|
||||
private Integer contactCallCount;
|
||||
}
|
||||
@ -18,7 +18,4 @@ public class TestChildCharacterResp {
|
||||
|
||||
@Schema(description = "性格类型")
|
||||
private String characterType;
|
||||
|
||||
@Schema(description = "星座")
|
||||
private String constellation;
|
||||
}
|
||||
@ -1,10 +1,8 @@
|
||||
package com.seer.teach.mp.app.convert;
|
||||
|
||||
import com.seer.teach.mp.app.controller.req.AppMpSignUpActivityReq;
|
||||
import com.seer.teach.mp.app.controller.resp.AppChildCharacterResp;
|
||||
import com.seer.teach.mp.app.controller.resp.AppMpSignUpActivityResp;
|
||||
import com.seer.teach.mp.entity.MpActivityInfoCollectionEntity;
|
||||
import com.seer.teach.mp.entity.MpTestChildCharacterEntity;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@ -21,8 +19,6 @@ public interface AppMpActivityInfoCollectionConvert {
|
||||
*/
|
||||
@Mapping(source = "mobile", target = "mobile")
|
||||
@Mapping(source = "contactCallCount", target = "contactCallCount")
|
||||
@Mapping(source = "weakSubjectIds", target = "weakSubjectIds")
|
||||
@Mapping(source = "strongSubjectIds", target = "strongSubjectIds")
|
||||
AppMpSignUpActivityResp convert2Resp(MpActivityInfoCollectionEntity entity);
|
||||
|
||||
|
||||
@ -32,7 +28,4 @@ public interface AppMpActivityInfoCollectionConvert {
|
||||
* @return 实体
|
||||
*/
|
||||
MpActivityInfoCollectionEntity convertOne2Entity(AppMpSignUpActivityReq request);
|
||||
|
||||
|
||||
AppChildCharacterResp convert2ChildCharacterResp(MpTestChildCharacterEntity entity);
|
||||
}
|
||||
@ -5,7 +5,6 @@ import com.seer.teach.common.enums.ResultCodeEnum;
|
||||
import com.seer.teach.common.utils.AssertUtils;
|
||||
import com.seer.teach.mp.app.controller.req.AppMpSignUpActivityReq;
|
||||
import com.seer.teach.mp.app.controller.req.TestChildCharacterReq;
|
||||
import com.seer.teach.mp.app.controller.resp.AppChildCharacterResp;
|
||||
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;
|
||||
@ -38,8 +37,6 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
|
||||
|
||||
private final AiModelCallService aiModelCallService;
|
||||
|
||||
private final IMpTestChildCharacterService mpTestChildCharacterService;
|
||||
|
||||
/**
|
||||
* 报名活动
|
||||
*
|
||||
@ -114,26 +111,7 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
|
||||
entity.setLearningSituation(request.getLearningSituation());
|
||||
entity.setWeakSubjectIds(request.getWeakSubjectIds());
|
||||
entity.setStrongSubjectIds(request.getStrongSubjectIds());
|
||||
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;
|
||||
return activityInfoCollectionService.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,22 +130,6 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
|
||||
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;
|
||||
@ -219,34 +181,6 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
|
||||
// 获取AI返回的内容
|
||||
String content = response.getChoices().get(0).getMessage().getContent();
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
// 如果AI调用失败,返回默认响应
|
||||
result.setCharacterAnalysis("暂时无法分析孩子的性格,请稍后重试。");
|
||||
@ -259,20 +193,6 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
|
||||
return result;
|
||||
}
|
||||
|
||||
private MpTestChildCharacterEntity getCharacterEntity(TestChildCharacterReq request, Integer parentId, TestChildCharacterResp result) {
|
||||
MpTestChildCharacterEntity entity = new MpTestChildCharacterEntity();
|
||||
entity.setParentId(parentId);
|
||||
entity.setConstellation(request.getConstellation());
|
||||
entity.setGrade(request.getGrade());
|
||||
entity.setChildBirthDate(request.getChildBirthDate());
|
||||
entity.setChildGender(request.getChildGender());
|
||||
entity.setCharacterType(result.getCharacterType());
|
||||
entity.setCharacterAnalysis(result.getCharacterAnalysis());
|
||||
entity.setCharacterTraits(result.getCharacterTraits());
|
||||
entity.setSuggestions(result.getSuggestions());
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建性格测试的提示词
|
||||
*
|
||||
@ -361,21 +281,5 @@ public class AppParentAgentActivityService implements IAppParentAgentActivitySer
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取孩子性格返回结果
|
||||
*
|
||||
* @param parentId 家长ID
|
||||
* @return 孩子性格返回结果
|
||||
*/
|
||||
public AppChildCharacterResp getChildCharacter(Integer parentId) {
|
||||
MpTestChildCharacterEntity one = mpTestChildCharacterService.lambdaQuery()
|
||||
.eq(MpTestChildCharacterEntity::getParentId, parentId)
|
||||
.orderByDesc(MpTestChildCharacterEntity::getCreateTime)
|
||||
.last("limit 1") // 获取最新的一条数据
|
||||
.one();
|
||||
if (one == null) {
|
||||
return new AppChildCharacterResp();
|
||||
}
|
||||
return AppMpActivityInfoCollectionConvert.INSTANCE.convert2ChildCharacterResp(one);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.seer.teach.mp.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.seer.teach.mp.entity.MpTestChildCharacterEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 嘉多宝宝
|
||||
* @since 2026-01-17
|
||||
*/
|
||||
public interface IMpTestChildCharacterService extends IService<MpTestChildCharacterEntity> {
|
||||
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.seer.teach.mp.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.seer.teach.mp.entity.MpTestChildCharacterEntity;
|
||||
import com.seer.teach.mp.mapper.MpTestChildCharacterMapper;
|
||||
import com.seer.teach.mp.service.IMpTestChildCharacterService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 嘉多宝宝
|
||||
* @since 2026-01-17
|
||||
*/
|
||||
@Service
|
||||
public class MpTestChildCharacterServiceImpl extends ServiceImpl<MpTestChildCharacterMapper, MpTestChildCharacterEntity> implements IMpTestChildCharacterService {
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user