diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolStatisticsController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolStatisticsController.java new file mode 100644 index 00000000..f12275cf --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolStatisticsController.java @@ -0,0 +1,470 @@ +package org.jeecg.modules.aiol.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.aiol.entity.AiolClass; +import org.jeecg.modules.aiol.entity.AiolClassStudent; +import org.jeecg.modules.aiol.entity.AiolHomework; +import org.jeecg.modules.aiol.entity.AiolCourseSection; +import org.jeecg.modules.aiol.entity.AiolDiscussion; +import org.jeecg.modules.aiol.entity.AiolEntityLink; +import org.jeecg.modules.aiol.entity.AiolResource; +import org.jeecg.modules.aiol.entity.AiolComment; +import org.jeecg.modules.aiol.service.IAiolClassService; +import org.jeecg.modules.aiol.service.IAiolClassStudentService; +import org.jeecg.modules.aiol.service.IAiolHomeworkService; +import org.jeecg.modules.aiol.service.IAiolCourseSectionService; +import org.jeecg.modules.aiol.service.IAiolDiscussionService; +import org.jeecg.modules.aiol.service.IAiolEntityLinkService; +import org.jeecg.modules.aiol.service.IAiolResourceService; +import org.jeecg.modules.aiol.service.IAiolCommentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.HashSet; +import java.util.Set; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.stream.Collectors; +import java.time.ZoneId; +import java.util.Date; + +@Tag(name = "统计") +@RestController +@RequestMapping("/aiol/statistics") +@Slf4j +public class AiolStatisticsController { + + @Autowired + private IAiolClassService aiolClassService; + + @Autowired + private IAiolClassStudentService aiolClassStudentService; + + @Autowired + private IAiolHomeworkService aiolHomeworkService; + + @Autowired + private IAiolCourseSectionService aiolCourseSectionService; + + @Autowired + private IAiolDiscussionService aiolDiscussionService; + + @Autowired + private IAiolEntityLinkService aiolEntityLinkService; + + @Autowired + private IAiolResourceService aiolResourceService; + + @Autowired + private IAiolCommentService aiolCommentService; + + /** + * 课程基础数据统计 + * + * @param courseId 课程ID + * @return 课程统计数据 + */ + @Operation(summary = "课程基础数据统计", description = "统计课程下的学生人数、班级数量、作业数量、考试数量、练习数量、讨论数量") + @GetMapping(value = "/course-basic-stats") + public Result> getCourseBasicStats(@RequestParam(name = "courseId", required = true) String courseId) { + try { + log.info("开始统计课程基础数据,课程ID: {}", courseId); + + Map stats = new HashMap<>(); + + // 1. 统计课程下班级数量 + long classCount = getClassCount(courseId); + stats.put("classCount", classCount); + + // 2. 统计课程下学生人数 + long studentCount = getStudentCount(courseId); + stats.put("studentCount", studentCount); + + // 3. 统计课程下作业数量 + long homeworkCount = getHomeworkCount(courseId); + stats.put("homeworkCount", homeworkCount); + + // 4. 统计课程下考试数量 (type=2) + long examCount = getExamCount(courseId); + stats.put("examCount", examCount); + + // 5. 统计课程下练习数量 (type=4) + long practiceCount = getPracticeCount(courseId); + stats.put("practiceCount", practiceCount); + + // 6. 统计课程下讨论数量 + long discussionCount = getDiscussionCount(courseId); + stats.put("discussionCount", discussionCount); + + log.info("课程基础数据统计完成,课程ID: {}, 统计结果: {}", courseId, stats); + return Result.OK(stats); + + } catch (Exception e) { + log.error("课程基础数据统计失败,课程ID: {}, 错误: {}", courseId, e.getMessage(), e); + return Result.error("统计失败: " + e.getMessage()); + } + } + + /** + * 统计课程下班级数量 + * + * @param courseId 课程ID + * @return 班级数量 + */ + private long getClassCount(String courseId) { + QueryWrapper classQuery = new QueryWrapper<>(); + classQuery.eq("course_id", courseId); + long count = aiolClassService.count(classQuery); + log.debug("课程 {} 班级数量: {}", courseId, count); + return count; + } + + /** + * 统计课程下学生人数 + * + * @param courseId 课程ID + * @return 学生人数 + */ + private long getStudentCount(String courseId) { + // 1. 先查询课程下的所有班级 + QueryWrapper classQuery = new QueryWrapper<>(); + classQuery.eq("course_id", courseId); + List classList = aiolClassService.list(classQuery); + + if (classList.isEmpty()) { + log.debug("课程 {} 没有班级,学生人数为 0", courseId); + return 0; + } + + // 2. 收集所有班级ID + List classIds = classList.stream() + .map(AiolClass::getId) + .collect(java.util.stream.Collectors.toList()); + + // 3. 查询这些班级下的所有学生,使用Set去重 + QueryWrapper studentQuery = new QueryWrapper<>(); + studentQuery.in("class_id", classIds); + List studentList = aiolClassStudentService.list(studentQuery); + + // 4. 去重统计学生人数(一个学生可能在多个班级中) + Set uniqueStudentIds = new HashSet<>(); + for (AiolClassStudent student : studentList) { + uniqueStudentIds.add(student.getStudentId()); + } + + long count = uniqueStudentIds.size(); + log.debug("课程 {} 学生人数: {} (去重后)", courseId, count); + return count; + } + + /** + * 统计课程下作业数量 + * + * @param courseId 课程ID + * @return 作业数量 + */ + private long getHomeworkCount(String courseId) { + QueryWrapper homeworkQuery = new QueryWrapper<>(); + homeworkQuery.eq("course_id", courseId); + long count = aiolHomeworkService.count(homeworkQuery); + log.debug("课程 {} 作业数量: {}", courseId, count); + return count; + } + + /** + * 统计课程下考试数量 (type=2) + * + * @param courseId 课程ID + * @return 考试数量 + */ + private long getExamCount(String courseId) { + QueryWrapper examQuery = new QueryWrapper<>(); + examQuery.eq("course_id", courseId) + .eq("type", 2); + long count = aiolCourseSectionService.count(examQuery); + log.debug("课程 {} 考试数量: {}", courseId, count); + return count; + } + + /** + * 统计课程下练习数量 (type=4) + * + * @param courseId 课程ID + * @return 练习数量 + */ + private long getPracticeCount(String courseId) { + QueryWrapper practiceQuery = new QueryWrapper<>(); + practiceQuery.eq("course_id", courseId) + .eq("type", 4); + long count = aiolCourseSectionService.count(practiceQuery); + log.debug("课程 {} 练习数量: {}", courseId, count); + return count; + } + + /** + * 统计课程下讨论数量 + * + * @param courseId 课程ID + * @return 讨论数量 + */ + private long getDiscussionCount(String courseId) { + QueryWrapper discussionQuery = new QueryWrapper<>(); + discussionQuery.eq("course_id", courseId); + long count = aiolDiscussionService.count(discussionQuery); + log.debug("课程 {} 讨论数量: {}", courseId, count); + return count; + } + + /** + * 课程教学建设数据统计 + * + * @param courseId 课程ID + * @return 课程教学建设统计数据 + */ + @Operation(summary = "课程教学建设数据统计", description = "统计课程下的课件/视频数量、资料/文档数量、题库数量、试卷数量") + @GetMapping(value = "/course-teaching-stats") + public Result> getCourseTeachingStats(@RequestParam(name = "courseId", required = true) String courseId) { + try { + log.info("开始统计课程教学建设数据,课程ID: {}", courseId); + + Map stats = new HashMap<>(); + + // 1. 统计课件/视频数量和资料/文档数量 + Map resourceStats = getResourceStats(courseId); + stats.put("videoCount", resourceStats.get("videoCount")); + stats.put("documentCount", resourceStats.get("documentCount")); + + // 2. 统计题库数量 + long questionCount = getQuestionCount(courseId); + stats.put("questionCount", questionCount); + + log.info("课程教学建设数据统计完成,课程ID: {}, 统计结果: {}", courseId, stats); + return Result.OK(stats); + + } catch (Exception e) { + log.error("课程教学建设数据统计失败,课程ID: {}, 错误: {}", courseId, e.getMessage(), e); + return Result.error("统计失败: " + e.getMessage()); + } + } + + /** + * 统计课程下资源数量(视频和文档) + * + * @param courseId 课程ID + * @return 资源统计结果 + */ + private Map getResourceStats(String courseId) { + Map resourceStats = new HashMap<>(); + long videoCount = 0; + long documentCount = 0; + + try { + // 1. 查询课程关联的资源链接 + QueryWrapper linkQuery = new QueryWrapper<>(); + linkQuery.eq("source_type", "course") + .eq("source_id", courseId) + .eq("target_type", "resource"); + + List entityLinks = aiolEntityLinkService.list(linkQuery); + log.debug("课程 {} 关联的资源链接数量: {}", courseId, entityLinks.size()); + + if (!entityLinks.isEmpty()) { + // 2. 收集所有资源ID + List resourceIds = entityLinks.stream() + .map(AiolEntityLink::getTargetId) + .collect(java.util.stream.Collectors.toList()); + + // 3. 查询资源详情并按类型统计 + QueryWrapper resourceQuery = new QueryWrapper<>(); + resourceQuery.in("id", resourceIds); + List resources = aiolResourceService.list(resourceQuery); + + // 4. 按类型分类统计 + for (AiolResource resource : resources) { + Integer type = resource.getType(); + if (type != null) { + if (type == 0) { + // 视频类型 + videoCount++; + } else if (type == 1 || type == 2) { + // 图片(1)和文档(2)统称为资料/文档 + documentCount++; + } + } + } + + log.debug("课程 {} 资源统计完成 - 视频: {}, 文档: {}", courseId, videoCount, documentCount); + } + + } catch (Exception e) { + log.error("统计课程 {} 资源数量时发生异常: {}", courseId, e.getMessage(), e); + } + + resourceStats.put("videoCount", videoCount); + resourceStats.put("documentCount", documentCount); + return resourceStats; + } + + /** + * 统计课程下题库数量 + * + * @param courseId 课程ID + * @return 题库数量 + */ + private long getQuestionCount(String courseId) { + QueryWrapper repoQuery = new QueryWrapper<>(); + repoQuery.eq("source_type", "course") + .eq("source_id", courseId) + .eq("target_type", "repo"); + long count = aiolEntityLinkService.count(repoQuery); + log.debug("课程 {} 题库数量: {}", courseId, count); + return count; + } + + /** + * 课程评论数量统计(按天) + * + * @param courseId 课程ID + * @param limit 天数限制,统计从今天往前limit天的数据 + * @return 每天的评论数量统计 + */ + @Operation(summary = "课程评论数量统计", description = "统计课程下指定天数内每天的评论数量,包括子评论") + @GetMapping(value = "/course-comment-stats") + public Result> getCourseCommentStats( + @RequestParam(name = "courseId", required = true) String courseId, + @RequestParam(name = "limit", defaultValue = "7") Integer limit) { + try { + log.info("开始统计课程评论数据,课程ID: {}, 天数限制: {}", courseId, limit); + + // 1. 查询课程的直接评论 + List courseComments = getCourseDirectComments(courseId, limit); + log.debug("课程 {} 直接评论数量: {}", courseId, courseComments.size()); + + // 2. 递归查询所有子评论 + List allComments = new ArrayList<>(courseComments); + for (AiolComment comment : courseComments) { + List subComments = getAllSubComments(comment.getId()); + allComments.addAll(subComments); + } + log.debug("课程 {} 总评论数量(含子评论): {}", courseId, allComments.size()); + + // 3. 按日期分组统计 + Map dailyStats = groupCommentsByDate(allComments, limit); + + // 4. 构建返回结果 + Map result = new HashMap<>(); + result.put("courseId", courseId); + result.put("limit", limit); + result.put("totalComments", allComments.size()); + result.put("dailyStats", dailyStats); + + log.info("课程评论数据统计完成,课程ID: {}, 总评论数: {}", courseId, allComments.size()); + return Result.OK(result); + + } catch (Exception e) { + log.error("课程评论数据统计失败,课程ID: {}, 错误: {}", courseId, e.getMessage(), e); + return Result.error("统计失败: " + e.getMessage()); + } + } + + /** + * 获取课程的直接评论(指定天数内) + * + * @param courseId 课程ID + * @param limit 天数限制 + * @return 课程直接评论列表 + */ + private List getCourseDirectComments(String courseId, Integer limit) { + QueryWrapper commentQuery = new QueryWrapper<>(); + commentQuery.eq("target_type", "course") + .eq("target_id", courseId); + + // 添加时间范围限制 + if (limit != null && limit > 0) { + LocalDateTime startTime = LocalDate.now().minusDays(limit - 1).atStartOfDay(); + Date startDate = Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()); + commentQuery.ge("create_time", startDate); + } + + commentQuery.orderByDesc("create_time"); + return aiolCommentService.list(commentQuery); + } + + /** + * 递归获取评论的所有子评论 + * + * @param commentId 父评论ID + * @return 所有子评论列表 + */ + private List getAllSubComments(String commentId) { + List allSubComments = new ArrayList<>(); + + // 查询直接子评论 + QueryWrapper subCommentQuery = new QueryWrapper<>(); + subCommentQuery.eq("target_type", "comment") + .eq("target_id", commentId) + .orderByDesc("create_time"); + + List directSubComments = aiolCommentService.list(subCommentQuery); + allSubComments.addAll(directSubComments); + + // 递归查询子评论的子评论 + for (AiolComment subComment : directSubComments) { + List subSubComments = getAllSubComments(subComment.getId()); + allSubComments.addAll(subSubComments); + } + + return allSubComments; + } + + /** + * 按日期分组统计评论数量 + * + * @param comments 所有评论列表 + * @param limit 天数限制 + * @return 每日评论数量统计 + */ + private Map groupCommentsByDate(List comments, Integer limit) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + + // 初始化指定天数的日期统计(确保每天都有数据,即使是0) + Map dailyStats = new LinkedHashMap<>(); + for (int i = limit - 1; i >= 0; i--) { + String date = LocalDate.now().minusDays(i).format(formatter); + dailyStats.put(date, 0L); + } + + // 按创建日期分组统计评论数量 + Map commentStats = comments.stream() + .filter(comment -> comment.getCreateTime() != null) + .collect(Collectors.groupingBy( + comment -> { + Date createTime = comment.getCreateTime(); + LocalDateTime localDateTime = createTime.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDateTime(); + return localDateTime.toLocalDate().format(formatter); + }, + Collectors.counting() + )); + + // 合并统计结果 + commentStats.forEach((date, count) -> { + if (dailyStats.containsKey(date)) { + dailyStats.put(date, count); + } + }); + + return dailyStats; + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolViewLogController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolViewLogController.java new file mode 100644 index 00000000..ba3e0d0f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolViewLogController.java @@ -0,0 +1,182 @@ +package org.jeecg.modules.aiol.controller; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.query.QueryRuleEnum; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.aiol.entity.AiolViewLog; +import org.jeecg.modules.aiol.service.IAiolViewLogService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 访问日志 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +@Tag(name="访问日志") +@RestController +@RequestMapping("/aiol/aiolViewLog") +@Slf4j +public class AiolViewLogController extends JeecgController { + @Autowired + private IAiolViewLogService aiolViewLogService; + + /** + * 分页列表查询 + * + * @param aiolViewLog + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "访问日志-分页列表查询") + @Operation(summary="访问日志-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AiolViewLog aiolViewLog, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(aiolViewLog, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = aiolViewLogService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param aiolViewLog + * @return + */ + @AutoLog(value = "访问日志-添加") + @Operation(summary="访问日志-添加") + @RequiresPermissions("aiol:aiol_view_log:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AiolViewLog aiolViewLog) { + aiolViewLogService.save(aiolViewLog); + + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param aiolViewLog + * @return + */ + @AutoLog(value = "访问日志-编辑") + @Operation(summary="访问日志-编辑") + @RequiresPermissions("aiol:aiol_view_log:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody AiolViewLog aiolViewLog) { + aiolViewLogService.updateById(aiolViewLog); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "访问日志-通过id删除") + @Operation(summary="访问日志-通过id删除") + @RequiresPermissions("aiol:aiol_view_log:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + aiolViewLogService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "访问日志-批量删除") + @Operation(summary="访问日志-批量删除") + @RequiresPermissions("aiol:aiol_view_log:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.aiolViewLogService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "访问日志-通过id查询") + @Operation(summary="访问日志-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + AiolViewLog aiolViewLog = aiolViewLogService.getById(id); + if(aiolViewLog==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(aiolViewLog); + } + + /** + * 导出excel + * + * @param request + * @param aiolViewLog + */ + @RequiresPermissions("aiol:aiol_view_log:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AiolViewLog aiolViewLog) { + return super.exportXls(request, aiolViewLog, AiolViewLog.class, "访问日志"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("aiol:aiol_view_log:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AiolViewLog.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolViewLog.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolViewLog.java new file mode 100644 index 00000000..1968d967 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolViewLog.java @@ -0,0 +1,58 @@ +package org.jeecg.modules.aiol.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 访问日志 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +@Data +@TableName("aiol_view_log") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="访问日志") +public class AiolViewLog implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private java.lang.String id; + /**实体类型*/ + @Excel(name = "实体类型", width = 15) + @Schema(description = "实体类型") + private java.lang.String entityType; + /**实体id*/ + @Excel(name = "实体id", width = 15) + @Schema(description = "实体id") + private java.lang.String entityId; + /**访问时间*/ + @Excel(name = "访问时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "访问时间") + private java.util.Date viewTime; + /**用户id*/ + @Excel(name = "用户id", width = 15) + @Schema(description = "用户id") + private java.lang.String userId; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolViewLogMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolViewLogMapper.java new file mode 100644 index 00000000..e59c0e2d --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolViewLogMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.aiol.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.aiol.entity.AiolViewLog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 访问日志 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +public interface AiolViewLogMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/xml/AiolViewLogMapper.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/xml/AiolViewLogMapper.xml new file mode 100644 index 00000000..8cc246ae --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/xml/AiolViewLogMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/IAiolViewLogService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/IAiolViewLogService.java new file mode 100644 index 00000000..55a5a888 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/IAiolViewLogService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.aiol.service; + +import org.jeecg.modules.aiol.entity.AiolViewLog; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 访问日志 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +public interface IAiolViewLogService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolViewLogServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolViewLogServiceImpl.java new file mode 100644 index 00000000..7ddd67c5 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolViewLogServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.aiol.service.impl; + +import org.jeecg.modules.aiol.entity.AiolViewLog; +import org.jeecg.modules.aiol.mapper.AiolViewLogMapper; +import org.jeecg.modules.aiol.service.IAiolViewLogService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 访问日志 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +@Service +public class AiolViewLogServiceImpl extends ServiceImpl implements IAiolViewLogService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolViewLogForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolViewLogForm.vue new file mode 100644 index 00000000..e02b4cfa --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolViewLogForm.vue @@ -0,0 +1,96 @@ + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolViewLogList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolViewLogList.vue new file mode 100644 index 00000000..a7edbadd --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolViewLogList.vue @@ -0,0 +1,44 @@ + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogData.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogData.ts new file mode 100644 index 00000000..d2dfaf1b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogData.ts @@ -0,0 +1,24 @@ +import { render } from '@/common/renderUtils'; +//列表数据 +export const columns = [ + { + title: '实体类型', + align:"center", + dataIndex: 'entityType' + }, + { + title: '实体id', + align:"center", + dataIndex: 'entityId' + }, + { + title: '访问时间', + align:"center", + dataIndex: 'viewTime' + }, + { + title: '用户id', + align:"center", + dataIndex: 'userId' + }, +]; \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogForm.vue new file mode 100644 index 00000000..97799037 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogForm.vue @@ -0,0 +1,245 @@ + +{ +layout: 'default', +style: { +navigationStyle: 'custom', +navigationBarTitleText: '访问日志', +}, +} + + + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogList.vue new file mode 100644 index 00000000..3d4f7f2b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolViewLogList.vue @@ -0,0 +1,148 @@ + +{ +layout: 'default', +style: { +navigationBarTitleText: '访问日志', +navigationStyle: 'custom', +}, +} + + + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLog.api.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLog.api.ts new file mode 100644 index 00000000..19edf961 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLog.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/aiol/aiolViewLog/list', + save='/aiol/aiolViewLog/add', + edit='/aiol/aiolViewLog/edit', + deleteOne = '/aiol/aiolViewLog/delete', + deleteBatch = '/aiol/aiolViewLog/deleteBatch', + importExcel = '/aiol/aiolViewLog/importExcel', + exportXls = '/aiol/aiolViewLog/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLog.data.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLog.data.ts new file mode 100644 index 00000000..d397f166 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLog.data.ts @@ -0,0 +1,82 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '实体类型', + align:"center", + dataIndex: 'entityType' + }, + { + title: '实体id', + align:"center", + dataIndex: 'entityId' + }, + { + title: '访问时间', + align:"center", + dataIndex: 'viewTime' + }, + { + title: '用户id', + align:"center", + dataIndex: 'userId' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '实体类型', + field: 'entityType', + component: 'Input', + }, + { + label: '实体id', + field: 'entityId', + component: 'Input', + }, + { + label: '访问时间', + field: 'viewTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '用户id', + field: 'userId', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + entityType: {title: '实体类型',order: 0,view: 'text', type: 'string',}, + entityId: {title: '实体id',order: 1,view: 'text', type: 'string',}, + viewTime: {title: '访问时间',order: 2,view: 'datetime', type: 'string',}, + userId: {title: '用户id',order: 3,view: 'text', type: 'string',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLogList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLogList.vue new file mode 100644 index 00000000..edd7b753 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolViewLogList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/V20250926_1__menu_insert_AiolViewLog.sql b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/V20250926_1__menu_insert_AiolViewLog.sql new file mode 100644 index 00000000..fe406d88 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/V20250926_1__menu_insert_AiolViewLog.sql @@ -0,0 +1,26 @@ +-- 注意:该页面对应的前台目录为views/aiol文件夹下 +-- 如果你想更改到其他目录,请修改sql中component字段对应的值 + + +INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) +VALUES ('2025092610135840330', NULL, '访问日志', '/aiol/aiolViewLogList', 'aiol/AiolViewLogList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-26 10:13:33', NULL, NULL, 0); + +-- 权限控制sql +-- 新增 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025092610135850331', '2025092610135840330', '添加访问日志', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_view_log:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-26 10:13:33', NULL, NULL, 0, 0, '1', 0); +-- 编辑 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025092610135850332', '2025092610135840330', '编辑访问日志', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_view_log:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-26 10:13:33', NULL, NULL, 0, 0, '1', 0); +-- 删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025092610135850333', '2025092610135840330', '删除访问日志', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_view_log:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-26 10:13:33', NULL, NULL, 0, 0, '1', 0); +-- 批量删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025092610135850334', '2025092610135840330', '批量删除访问日志', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_view_log:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-26 10:13:33', NULL, NULL, 0, 0, '1', 0); +-- 导出excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025092610135850335', '2025092610135840330', '导出excel_访问日志', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_view_log:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-26 10:13:33', NULL, NULL, 0, 0, '1', 0); +-- 导入excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025092610135850336', '2025092610135840330', '导入excel_访问日志', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_view_log:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-26 10:13:33', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolViewLogForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolViewLogForm.vue new file mode 100644 index 00000000..93c11f28 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolViewLogForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolViewLogModal.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolViewLogModal.vue new file mode 100644 index 00000000..d2b9f38a --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolViewLogModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/AiolDiscussion.api.ts b/jeecgboot-vue3/src/views/aiol/AiolDiscussion.api.ts new file mode 100644 index 00000000..969dcbb9 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolDiscussion.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/aiol/aiolDiscussion/list', + save='/aiol/aiolDiscussion/add', + edit='/aiol/aiolDiscussion/edit', + deleteOne = '/aiol/aiolDiscussion/delete', + deleteBatch = '/aiol/aiolDiscussion/deleteBatch', + importExcel = '/aiol/aiolDiscussion/importExcel', + exportXls = '/aiol/aiolDiscussion/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts b/jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts index 96ea0ec4..e3f5bba3 100644 --- a/jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts +++ b/jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts @@ -15,11 +15,6 @@ export const columns: BasicColumn[] = [ align:"center", dataIndex: 'description' }, - { - title: '课程id', - align:"center", - dataIndex: 'courseId' - }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ @@ -35,11 +30,6 @@ export const formSchema: FormSchema[] = [ label: '讨论描述', field: 'description', component: 'Input', - }, - { - label: '课程id', - field: 'courseId', - component: 'Input', }, // TODO 主键隐藏字段,目前写死为ID { @@ -54,7 +44,6 @@ export const formSchema: FormSchema[] = [ export const superQuerySchema = { title: {title: '讨论标题',order: 0,view: 'text', type: 'string',}, description: {title: '讨论描述',order: 1,view: 'text', type: 'string',}, - courseId: {title: '课程id',order: 2,view: 'text', type: 'string',}, }; /** diff --git a/jeecgboot-vue3/src/views/aiol/AiolDiscussionList.vue b/jeecgboot-vue3/src/views/aiol/AiolDiscussionList.vue new file mode 100644 index 00000000..87f381aa --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolDiscussionList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/AiolResourceContent.api.ts b/jeecgboot-vue3/src/views/aiol/AiolResourceContent.api.ts new file mode 100644 index 00000000..51f72cfb --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolResourceContent.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/aiol/aiolResourceContent/list', + save='/aiol/aiolResourceContent/add', + edit='/aiol/aiolResourceContent/edit', + deleteOne = '/aiol/aiolResourceContent/delete', + deleteBatch = '/aiol/aiolResourceContent/deleteBatch', + importExcel = '/aiol/aiolResourceContent/importExcel', + exportXls = '/aiol/aiolResourceContent/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecgboot-vue3/src/views/aiol/AiolResourceContent.data.ts b/jeecgboot-vue3/src/views/aiol/AiolResourceContent.data.ts new file mode 100644 index 00000000..f852a03a --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolResourceContent.data.ts @@ -0,0 +1,67 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '内容类型', + align:"center", + dataIndex: 'contentType' + }, + { + title: '内容数据', + align:"center", + dataIndex: 'contentData' + }, + { + title: '资源id', + align:"center", + dataIndex: 'resourceId' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '内容类型', + field: 'contentType', + component: 'Input', + }, + { + label: '内容数据', + field: 'contentData', + component: 'Input', + }, + { + label: '资源id', + field: 'resourceId', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + contentType: {title: '内容类型',order: 0,view: 'text', type: 'string',}, + contentData: {title: '内容数据',order: 1,view: 'text', type: 'string',}, + resourceId: {title: '资源id',order: 2,view: 'text', type: 'string',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/AiolResourceContentList.vue b/jeecgboot-vue3/src/views/aiol/AiolResourceContentList.vue new file mode 100644 index 00000000..760fbd0d --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolResourceContentList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/AiolViewLog.api.ts b/jeecgboot-vue3/src/views/aiol/AiolViewLog.api.ts new file mode 100644 index 00000000..19edf961 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolViewLog.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/aiol/aiolViewLog/list', + save='/aiol/aiolViewLog/add', + edit='/aiol/aiolViewLog/edit', + deleteOne = '/aiol/aiolViewLog/delete', + deleteBatch = '/aiol/aiolViewLog/deleteBatch', + importExcel = '/aiol/aiolViewLog/importExcel', + exportXls = '/aiol/aiolViewLog/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecgboot-vue3/src/views/aiol/AiolViewLog.data.ts b/jeecgboot-vue3/src/views/aiol/AiolViewLog.data.ts new file mode 100644 index 00000000..d397f166 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolViewLog.data.ts @@ -0,0 +1,82 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '实体类型', + align:"center", + dataIndex: 'entityType' + }, + { + title: '实体id', + align:"center", + dataIndex: 'entityId' + }, + { + title: '访问时间', + align:"center", + dataIndex: 'viewTime' + }, + { + title: '用户id', + align:"center", + dataIndex: 'userId' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '实体类型', + field: 'entityType', + component: 'Input', + }, + { + label: '实体id', + field: 'entityId', + component: 'Input', + }, + { + label: '访问时间', + field: 'viewTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '用户id', + field: 'userId', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + entityType: {title: '实体类型',order: 0,view: 'text', type: 'string',}, + entityId: {title: '实体id',order: 1,view: 'text', type: 'string',}, + viewTime: {title: '访问时间',order: 2,view: 'datetime', type: 'string',}, + userId: {title: '用户id',order: 3,view: 'text', type: 'string',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/AiolViewLogList.vue b/jeecgboot-vue3/src/views/aiol/AiolViewLogList.vue new file mode 100644 index 00000000..edd7b753 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolViewLogList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolDiscussionForm.vue b/jeecgboot-vue3/src/views/aiol/components/AiolDiscussionForm.vue new file mode 100644 index 00000000..12a4dee9 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolDiscussionForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolDiscussionModal.vue b/jeecgboot-vue3/src/views/aiol/components/AiolDiscussionModal.vue new file mode 100644 index 00000000..b7addcb8 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolDiscussionModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolResourceContentForm.vue b/jeecgboot-vue3/src/views/aiol/components/AiolResourceContentForm.vue new file mode 100644 index 00000000..96996ccb --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolResourceContentForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolResourceContentModal.vue b/jeecgboot-vue3/src/views/aiol/components/AiolResourceContentModal.vue new file mode 100644 index 00000000..e32b052d --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolResourceContentModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolViewLogForm.vue b/jeecgboot-vue3/src/views/aiol/components/AiolViewLogForm.vue new file mode 100644 index 00000000..93c11f28 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolViewLogForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolViewLogModal.vue b/jeecgboot-vue3/src/views/aiol/components/AiolViewLogModal.vue new file mode 100644 index 00000000..d2b9f38a --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolViewLogModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file