feat: 🎸 题目加知识点字段
This commit is contained in:
parent
d925089869
commit
01e9b12eaf
@ -22,8 +22,12 @@ import org.jeecg.config.shiro.IgnoreAuth;
|
||||
import org.jeecg.modules.aiol.entity.AiolChat;
|
||||
import org.jeecg.modules.aiol.entity.AiolChatMember;
|
||||
import org.jeecg.modules.aiol.entity.AiolChatMessage;
|
||||
import org.jeecg.modules.aiol.entity.AiolClass;
|
||||
import org.jeecg.modules.aiol.entity.AiolClassStudent;
|
||||
import org.jeecg.modules.aiol.mapper.AiolChatMemberMapper;
|
||||
import org.jeecg.modules.aiol.mapper.AiolChatMessageMapper;
|
||||
import org.jeecg.modules.aiol.mapper.AiolClassMapper;
|
||||
import org.jeecg.modules.aiol.mapper.AiolClassStudentMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolChatService;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.mapper.SysUserMapper;
|
||||
@ -75,6 +79,12 @@ public class AiolChatController extends JeecgController<AiolChat, IAiolChatServi
|
||||
@Autowired
|
||||
private AiolChatMessageMapper aiolChatMessageMapper;
|
||||
|
||||
@Autowired
|
||||
private AiolClassMapper aiolClassMapper;
|
||||
|
||||
@Autowired
|
||||
private AiolClassStudentMapper aiolClassStudentMapper;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@ -419,4 +429,77 @@ public class AiolChatController extends JeecgController<AiolChat, IAiolChatServi
|
||||
return Result.error("查询会话消息列表失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会话详情
|
||||
*
|
||||
* @param chatId 会话ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "查询会话详情", description = "根据会话ID查询会话详情,群聊类型会包含班级信息")
|
||||
@GetMapping(value = "/{chatId}/detail")
|
||||
public Result<Map<String, Object>> queryChatDetail(@PathVariable(value = "chatId") String chatId) {
|
||||
try {
|
||||
// 1. 查询会话基本信息
|
||||
AiolChat chat = aiolChatService.getById(chatId);
|
||||
if (chat == null) {
|
||||
return Result.error("会话不存在");
|
||||
}
|
||||
|
||||
// 2. 构建返回结果
|
||||
Map<String, Object> result = new java.util.HashMap<>();
|
||||
result.put("id", chat.getId());
|
||||
result.put("type", chat.getType());
|
||||
result.put("name", chat.getName());
|
||||
result.put("avatar", chat.getAvatar());
|
||||
result.put("refId", chat.getRefId());
|
||||
result.put("izAllMuted", chat.getIzAllMuted());
|
||||
result.put("showLabel", chat.getShowLabel());
|
||||
result.put("createBy", chat.getCreateBy());
|
||||
result.put("createTime", chat.getCreateTime());
|
||||
result.put("updateBy", chat.getUpdateBy());
|
||||
result.put("updateTime", chat.getUpdateTime());
|
||||
|
||||
// 3. 如果是群聊类型(type==1),查询班级信息
|
||||
if (chat.getType() != null && chat.getType() == 1 && chat.getRefId() != null) {
|
||||
try {
|
||||
// 查询班级信息
|
||||
AiolClass aiolClass = aiolClassMapper.selectById(chat.getRefId());
|
||||
if (aiolClass != null) {
|
||||
Map<String, Object> classInfo = new java.util.HashMap<>();
|
||||
classInfo.put("id", aiolClass.getId());
|
||||
classInfo.put("name", aiolClass.getName());
|
||||
classInfo.put("courseId", aiolClass.getCourseId());
|
||||
classInfo.put("inviteCode", aiolClass.getInviteCode());
|
||||
classInfo.put("createBy", aiolClass.getCreateBy());
|
||||
classInfo.put("createTime", aiolClass.getCreateTime());
|
||||
|
||||
// 查询班级人数
|
||||
QueryWrapper<AiolClassStudent> studentWrapper = new QueryWrapper<>();
|
||||
studentWrapper.eq("class_id", aiolClass.getId());
|
||||
long studentCount = aiolClassStudentMapper.selectCount(studentWrapper);
|
||||
classInfo.put("studentCount", studentCount);
|
||||
|
||||
result.put("classInfo", classInfo);
|
||||
} else {
|
||||
log.warn("群聊会话 {} 关联的班级 {} 不存在", chatId, chat.getRefId());
|
||||
result.put("classInfo", null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询群聊班级信息失败: chatId={}, refId={}, error={}",
|
||||
chatId, chat.getRefId(), e.getMessage(), e);
|
||||
result.put("classInfo", null);
|
||||
}
|
||||
} else {
|
||||
result.put("classInfo", null);
|
||||
}
|
||||
|
||||
log.info("查询会话详情成功: chatId={}, type={}", chatId, chat.getType());
|
||||
return Result.OK(result);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("查询会话详情失败: chatId={}, error={}", chatId, e.getMessage(), e);
|
||||
return Result.error("查询会话详情失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,10 @@ public class AiolQuestion implements Serializable {
|
||||
@Excel(name = "状态", width = 15)
|
||||
@Schema(description = "状态")
|
||||
private java.lang.Integer status;
|
||||
/**知识点*/
|
||||
@Excel(name = "知识点", width = 15)
|
||||
@Schema(description = "知识点")
|
||||
private java.lang.String knowledge;
|
||||
/**创建人*/
|
||||
@Schema(description = "创建人")
|
||||
private java.lang.String createBy;
|
||||
|
@ -45,6 +45,16 @@ export const columns: BasicColumn[] = [
|
||||
align:"center",
|
||||
dataIndex: 'ability'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align:"center",
|
||||
dataIndex: 'status'
|
||||
},
|
||||
{
|
||||
title: '知识点',
|
||||
align:"center",
|
||||
dataIndex: 'knowledge'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
@ -96,6 +106,16 @@ export const formSchema: FormSchema[] = [
|
||||
label: '能力',
|
||||
field: 'ability',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '知识点',
|
||||
field: 'knowledge',
|
||||
component: 'Input',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
@ -116,6 +136,8 @@ export const superQuerySchema = {
|
||||
score: {title: '分值',order: 5,view: 'number', type: 'number',},
|
||||
degree: {title: '程度',order: 6,view: 'number', type: 'number',},
|
||||
ability: {title: '能力',order: 7,view: 'number', type: 'number',},
|
||||
status: {title: '状态',order: 8,view: 'number', type: 'number',},
|
||||
knowledge: {title: '知识点',order: 9,view: 'text', type: 'string',},
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user