diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassController.java new file mode 100644 index 00000000..59e54447 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassController.java @@ -0,0 +1,328 @@ +package org.jeecg.modules.aiol.controller; + +import java.util.ArrayList; +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.system.util.JwtUtil; +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.aiol.entity.AiolClass; +import org.jeecg.modules.aiol.entity.AiolClassStudent; +import org.jeecg.modules.aiol.service.IAiolClassService; +import org.jeecg.modules.aiol.service.IAiolClassStudentService; +import org.jeecg.modules.system.entity.SysUser; +import org.jeecg.modules.system.mapper.SysUserMapper; + +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.api.ISysBaseAPI; +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.jeecg.common.constant.CommonConstant; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 班级 + * @Author: jeecg-boot + * @Date: 2025-09-04 + * @Version: V1.0 + */ +@Tag(name="班级") +@RestController +@RequestMapping("/aiol/aiolClass") +@Slf4j +public class AiolClassController extends JeecgController { + @Autowired + private IAiolClassService aiolClassService; + @Autowired + private IAiolClassStudentService aiolClassStudentService; + @Autowired + private ISysBaseAPI sysBaseApi; + @Autowired + private SysUserMapper sysUserMapper; + + /** + * 分页列表查询 + * + * @param aiolClass + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "班级-分页列表查询") + @Operation(summary="班级-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AiolClass aiolClass, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(aiolClass, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = aiolClassService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param aiolClass + * @return + */ + @AutoLog(value = "班级-添加") + @Operation(summary="班级-添加") + @RequiresPermissions("aiol:aiol_class:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AiolClass aiolClass) { + aiolClassService.save(aiolClass); + + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param aiolClass + * @return + */ + @AutoLog(value = "班级-编辑") + @Operation(summary="班级-编辑") + @RequiresPermissions("aiol:aiol_class:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody AiolClass aiolClass) { + aiolClassService.updateById(aiolClass); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "班级-通过id删除") + @Operation(summary="班级-通过id删除") + @RequiresPermissions("aiol:aiol_class:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + aiolClassService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "班级-批量删除") + @Operation(summary="班级-批量删除") + @RequiresPermissions("aiol:aiol_class:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.aiolClassService.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) { + AiolClass aiolClass = aiolClassService.getById(id); + if(aiolClass==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(aiolClass); + } + + /** + * 导出excel + * + * @param request + * @param aiolClass + */ + @RequiresPermissions("aiol:aiol_class:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AiolClass aiolClass) { + return super.exportXls(request, aiolClass, AiolClass.class, "班级"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("aiol:aiol_class:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AiolClass.class); + } + + /** + * 批量导入学生到班级 + * + * @param classId 班级ID + * @param requestBody 请求体,包含ids字段 + * @param request HTTP请求对象 + * @return + */ + @AutoLog(value = "班级学生-批量导入学生") + @Operation(summary = "批量导入学生到班级", description = "请求体为JSON格式,包含ids字段,ids为逗号分隔的学生ID字符串") + @PostMapping(value = "/{classId}/import_students") + public Result> importStudentsToClass( + @PathVariable(value = "classId") String classId, + @RequestBody Map requestBody, + HttpServletRequest request) { + + try { + // 1. 获取当前登录用户信息 + String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN); + String username = JwtUtil.getUsername(token); + LoginUser sysUser = sysBaseApi.getUserByName(username); + + if (sysUser == null) { + return Result.error("用户未登录或登录已过期"); + } + + // 2. 从请求体中获取学生ID列表 + String ids = (String) requestBody.get("ids"); + if (ids == null || ids.trim().isEmpty()) { + return Result.error("ids字段不能为空"); + } + + // 3. 调用Service层处理批量导入逻辑 + Map result = aiolClassService.importStudentsToClass(classId, ids, sysUser); + + log.info("用户 {} 成功导入学生到班级,班级ID: {}, 导入结果: {}", + username, classId, result); + + return Result.OK(result); + + } catch (Exception e) { + log.error("批量导入学生到班级失败: classId={}, error={}", classId, e.getMessage(), e); + return Result.error("批量导入学生失败: " + e.getMessage()); + } + } + + /** + * 查询班级学生列表 + * + * @param classId 班级ID + * @return + */ + @Operation(summary = "查询班级学生列表", description = "根据班级ID查询该班级下的所有学生") + @GetMapping(value = "/{classId}/student_list") + public Result>> queryClassStudentList(@PathVariable("classId") String classId) { + try { + // 1. 查询班级学生关联记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("class_id", classId); + + List classStudents = aiolClassStudentService.list(queryWrapper); + + // 2. 联查用户信息,构建包含学生信息的列表 + List> result = new ArrayList<>(); + for (AiolClassStudent classStudent : classStudents) { + Map studentInfo = new HashMap<>(); + // 复制班级学生关联信息 + studentInfo.put("id", classStudent.getId()); + studentInfo.put("classId", classStudent.getClassId()); + studentInfo.put("studentId", classStudent.getStudentId()); + studentInfo.put("createTime", classStudent.getCreateTime()); + studentInfo.put("createBy", classStudent.getCreateBy()); + studentInfo.put("updateTime", classStudent.getUpdateTime()); + studentInfo.put("updateBy", classStudent.getUpdateBy()); + + // 查询学生用户信息 + SysUser sysUser = sysUserMapper.selectById(classStudent.getStudentId()); + if (sysUser != null) { + studentInfo.put("realname", sysUser.getRealname()); + studentInfo.put("userAvatar", sysUser.getAvatar()); + studentInfo.put("username", sysUser.getUsername()); + studentInfo.put("phone", sysUser.getPhone()); + studentInfo.put("email", sysUser.getEmail()); + studentInfo.put("status", sysUser.getStatus()); + } + + result.add(studentInfo); + } + + return Result.OK(result); + + } catch (Exception e) { + log.error("查询班级学生列表失败: classId={}, error={}", classId, e.getMessage(), e); + return Result.error("查询班级学生列表失败: " + e.getMessage()); + } + } + + /** + * 从班级中移除学生 + * + * @param classId 班级ID + * @param studentId 学生ID + * @return + */ + @AutoLog(value = "班级学生-移除学生") + @Operation(summary = "从班级中移除学生", description = "将指定学生从班级中移除") + @DeleteMapping(value = "/{classId}/remove_student/{studentId}") + public Result removeStudentFromClass( + @PathVariable("classId") String classId, + @PathVariable("studentId") String studentId) { + + try { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("class_id", classId) + .eq("student_id", studentId); + + boolean removed = aiolClassStudentService.remove(queryWrapper); + + if (removed) { + log.info("成功从班级移除学生,班级ID: {}, 学生ID: {}", classId, studentId); + return Result.OK("学生移除成功!"); + } else { + return Result.error("未找到该学生在班级中的记录"); + } + + } catch (Exception e) { + log.error("从班级移除学生失败: classId={}, studentId={}, error={}", + classId, studentId, e.getMessage(), e); + return Result.error("移除学生失败: " + e.getMessage()); + } + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassStudentController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassStudentController.java new file mode 100644 index 00000000..0ae35820 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassStudentController.java @@ -0,0 +1,186 @@ +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.system.util.JwtUtil; +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.aiol.entity.AiolClassStudent; +import org.jeecg.modules.aiol.service.IAiolClassStudentService; + +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.api.ISysBaseAPI; +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.jeecg.common.constant.CommonConstant; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 班级学生 + * @Author: jeecg-boot + * @Date: 2025-09-04 + * @Version: V1.0 + */ +@Tag(name="班级学生") +@RestController +@RequestMapping("/aiol/aiolClassStudent") +@Slf4j +public class AiolClassStudentController extends JeecgController { + @Autowired + private IAiolClassStudentService aiolClassStudentService; + @Autowired + private ISysBaseAPI sysBaseApi; + /** + * 分页列表查询 + * + * @param aiolClassStudent + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "班级学生-分页列表查询") + @Operation(summary="班级学生-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AiolClassStudent aiolClassStudent, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(aiolClassStudent, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = aiolClassStudentService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param aiolClassStudent + * @return + */ + @AutoLog(value = "班级学生-添加") + @Operation(summary="班级学生-添加") + @RequiresPermissions("aiol:aiol_class_student:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AiolClassStudent aiolClassStudent) { + aiolClassStudentService.save(aiolClassStudent); + + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param aiolClassStudent + * @return + */ + @AutoLog(value = "班级学生-编辑") + @Operation(summary="班级学生-编辑") + @RequiresPermissions("aiol:aiol_class_student:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody AiolClassStudent aiolClassStudent) { + aiolClassStudentService.updateById(aiolClassStudent); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "班级学生-通过id删除") + @Operation(summary="班级学生-通过id删除") + @RequiresPermissions("aiol:aiol_class_student:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + aiolClassStudentService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "班级学生-批量删除") + @Operation(summary="班级学生-批量删除") + @RequiresPermissions("aiol:aiol_class_student:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.aiolClassStudentService.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) { + AiolClassStudent aiolClassStudent = aiolClassStudentService.getById(id); + if(aiolClassStudent==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(aiolClassStudent); + } + + /** + * 导出excel + * + * @param request + * @param aiolClassStudent + */ + @RequiresPermissions("aiol:aiol_class_student:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AiolClassStudent aiolClassStudent) { + return super.exportXls(request, aiolClassStudent, AiolClassStudent.class, "班级学生"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("aiol:aiol_class_student:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AiolClassStudent.class); + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolClass.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolClass.java new file mode 100644 index 00000000..beda9945 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolClass.java @@ -0,0 +1,64 @@ +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-04 + * @Version: V1.0 + */ +@Data +@TableName("aiol_class") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="班级") +public class AiolClass 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 name; + /**课程id*/ + @Excel(name = "课程id", width = 15) + @Schema(description = "课程id") + private java.lang.String courseId; + /**创建人*/ + @Schema(description = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @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 createTime; + /**更新人*/ + @Schema(description = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @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 updateTime; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolClassStudent.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolClassStudent.java new file mode 100644 index 00000000..22dd6ba9 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolClassStudent.java @@ -0,0 +1,68 @@ +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-04 + * @Version: V1.0 + */ +@Data +@TableName("aiol_class_student") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="班级学生") +public class AiolClassStudent implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private java.lang.String id; + /**班级id*/ + @Excel(name = "班级id", width = 15) + @Schema(description = "班级id") + private java.lang.String classId; + /**学生id*/ + @Excel(name = "学生id", width = 15) + @Schema(description = "学生id") + private java.lang.String studentId; + /**状态*/ + @Excel(name = "状态", width = 15) + @Schema(description = "状态") + private java.lang.Integer status; + /**创建人*/ + @Schema(description = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @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 createTime; + /**更新人*/ + @Schema(description = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @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 updateTime; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolClassMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolClassMapper.java new file mode 100644 index 00000000..46f18ae7 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolClassMapper.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.AiolClass; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 班级 + * @Author: jeecg-boot + * @Date: 2025-09-04 + * @Version: V1.0 + */ +public interface AiolClassMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolClassStudentMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolClassStudentMapper.java new file mode 100644 index 00000000..788868f2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/AiolClassStudentMapper.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.AiolClassStudent; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 班级学生 + * @Author: jeecg-boot + * @Date: 2025-09-04 + * @Version: V1.0 + */ +public interface AiolClassStudentMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/xml/AiolClassMapper.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/xml/AiolClassMapper.xml new file mode 100644 index 00000000..73dce481 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/xml/AiolClassMapper.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/mapper/xml/AiolClassStudentMapper.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/xml/AiolClassStudentMapper.xml new file mode 100644 index 00000000..548d1522 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/mapper/xml/AiolClassStudentMapper.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/IAiolClassService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/IAiolClassService.java new file mode 100644 index 00000000..79999b8f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/IAiolClassService.java @@ -0,0 +1,25 @@ +package org.jeecg.modules.aiol.service; + +import java.util.Map; + +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.modules.aiol.entity.AiolClass; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 班级 + * @Author: jeecg-boot + * @Date: 2025-09-04 + * @Version: V1.0 + */ +public interface IAiolClassService extends IService { + /** + * 批量导入学生到班级 + * + * @param classId 班级ID + * @param ids 学生ID字符串(逗号分隔) + * @param teacher 教师信息 + * @return 导入结果 + */ + Map importStudentsToClass(String classId, String ids, LoginUser sysUser); +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/IAiolClassStudentService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/IAiolClassStudentService.java new file mode 100644 index 00000000..f94b18ca --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/IAiolClassStudentService.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.aiol.service; + +import java.util.Map; + +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.modules.aiol.entity.AiolClassStudent; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 班级学生 + * @Author: jeecg-boot + * @Date: 2025-09-04 + * @Version: V1.0 + */ +public interface IAiolClassStudentService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolClassServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolClassServiceImpl.java new file mode 100644 index 00000000..f4f0943a --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolClassServiceImpl.java @@ -0,0 +1,142 @@ +package org.jeecg.modules.aiol.service.impl; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.ibatis.executor.BatchResult; +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.modules.aiol.entity.AiolClass; +import org.jeecg.modules.aiol.entity.AiolClassStudent; +import org.jeecg.modules.aiol.mapper.AiolClassMapper; +import org.jeecg.modules.aiol.mapper.AiolClassStudentMapper; +import org.jeecg.modules.aiol.service.IAiolClassService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import lombok.extern.slf4j.Slf4j; + +/** + * @Description: 班级 + * @Author: jeecg-boot + * @Date: 2025-09-04 + * @Version: V1.0 + */ +@Service +@Slf4j +public class AiolClassServiceImpl extends ServiceImpl implements IAiolClassService { + @Autowired + private AiolClassStudentMapper aiolClassStudentMapper; + + @Override + public Map importStudentsToClass(String classId, String ids, LoginUser teacher) { + Map result = new HashMap<>(); + + try { + // 1. 参数校验 + if (classId == null || classId.trim().isEmpty()) { + throw new RuntimeException("班级ID不能为空"); + } + if (ids == null || ids.trim().isEmpty()) { + throw new RuntimeException("学生ID列表不能为空"); + } + if (teacher == null || teacher.getId() == null) { + throw new RuntimeException("教师信息不能为空"); + } + + // 2. 过滤有效的学生ID + List validStudentIds = new ArrayList<>(); + for (String studentId : ids.split(",")) { + if (studentId != null && !studentId.trim().isEmpty()) { + validStudentIds.add(studentId.trim()); + } + } + + if (validStudentIds.isEmpty()) { + throw new RuntimeException("没有有效的学生ID"); + } + + // 3. 检查哪些学生已经在班级中 + QueryWrapper existingQuery = new QueryWrapper<>(); + existingQuery.eq("class_id", classId).in("student_id", validStudentIds); + List existingStudents = aiolClassStudentMapper.selectList(existingQuery); + + Set alreadyInClassIds = new HashSet<>(); + for (AiolClassStudent student : existingStudents) { + alreadyInClassIds.add(student.getStudentId()); + } + + // 4. 过滤出需要新增的学生ID + List newStudentIds = new ArrayList<>(); + for (String studentId : validStudentIds) { + if (!alreadyInClassIds.contains(studentId)) { + newStudentIds.add(studentId); + } + } + + if (newStudentIds.isEmpty()) { + result.put("success", false); + result.put("code", "all_already_in_class"); + result.put("message", "所有学生都已经在班级中"); + result.put("addedCount", 0); + result.put("alreadyInClassCount", alreadyInClassIds.size()); + return result; + } + + // 5. 批量创建班级学生关联记录 + List newClassStudents = new ArrayList<>(); + Date now = new Date(); + for (String studentId : newStudentIds) { + AiolClassStudent classStudent = new AiolClassStudent(); + classStudent.setClassId(classId); + classStudent.setStudentId(studentId); + classStudent.setCreateTime(now); + classStudent.setCreateBy(teacher.getId()); + classStudent.setUpdateTime(now); + classStudent.setUpdateBy(teacher.getId()); + newClassStudents.add(classStudent); + } + + // 6. 批量插入班级学生关联记录 + Collection collection = newClassStudents; + List saveResults = aiolClassStudentMapper.insert(collection); + if (saveResults == null || saveResults.isEmpty()) { + throw new RuntimeException("保存班级学生关联记录失败"); + } + + // 7. 返回结果 + if (alreadyInClassIds.isEmpty()) { + result.put("success", true); + result.put("code", "success"); + result.put("message", "所有学生都成功添加到班级"); + result.put("addedCount", newStudentIds.size()); + result.put("alreadyInClassCount", 0); + } else { + result.put("success", true); + result.put("code", "partial_success"); + result.put("message", "部分学生添加成功,部分学生已经在班级中"); + result.put("addedCount", newStudentIds.size()); + result.put("alreadyInClassCount", alreadyInClassIds.size()); + } + + // 8. 记录操作日志 + log.info("教师 {} 成功导入学生到班级,班级ID: {}, 新增学生数: {}, 已存在学生数: {}", + teacher.getUsername(), classId, newStudentIds.size(), alreadyInClassIds.size()); + + return result; + + } catch (Exception e) { + log.error("批量导入学生到班级失败: classId={}, ids={}, teacher={}, error={}", + classId, ids, teacher.getUsername(), e.getMessage(), e); + throw new RuntimeException("批量导入学生到班级失败: " + e.getMessage(), e); + } + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolClassStudentServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolClassStudentServiceImpl.java new file mode 100644 index 00000000..a6c60b32 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/service/impl/AiolClassStudentServiceImpl.java @@ -0,0 +1,33 @@ +package org.jeecg.modules.aiol.service.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.modules.aiol.entity.AiolClassStudent; +import org.jeecg.modules.aiol.mapper.AiolClassStudentMapper; +import org.jeecg.modules.aiol.service.IAiolClassStudentService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import lombok.extern.slf4j.Slf4j; + +/** + * @Description: 班级学生 + * @Author: jeecg-boot + * @Date: 2025-09-04 + * @Version: V1.0 + */ +@Service +@Slf4j +public class AiolClassStudentServiceImpl extends ServiceImpl + implements IAiolClassStudentService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassForm.vue new file mode 100644 index 00000000..a89975b6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassForm.vue @@ -0,0 +1,89 @@ + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassList.vue new file mode 100644 index 00000000..6b4095ca --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassList.vue @@ -0,0 +1,44 @@ + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassStudentForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassStudentForm.vue new file mode 100644 index 00000000..012f3dac --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassStudentForm.vue @@ -0,0 +1,95 @@ + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassStudentList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassStudentList.vue new file mode 100644 index 00000000..2ee1811b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp/AiolClassStudentList.vue @@ -0,0 +1,44 @@ + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassData.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassData.ts new file mode 100644 index 00000000..8f28e5b3 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassData.ts @@ -0,0 +1,14 @@ +import { render } from '@/common/renderUtils'; +//列表数据 +export const columns = [ + { + title: '班级名', + align:"center", + dataIndex: 'name' + }, + { + title: '课程id', + align:"center", + dataIndex: 'courseId' + }, +]; \ 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/AiolClassForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassForm.vue new file mode 100644 index 00000000..13f1e918 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassForm.vue @@ -0,0 +1,222 @@ + +{ +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/AiolClassList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassList.vue new file mode 100644 index 00000000..77323de1 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassList.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/uniapp3/AiolClassStudentData.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassStudentData.ts new file mode 100644 index 00000000..29a8364f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassStudentData.ts @@ -0,0 +1,19 @@ +import { render } from '@/common/renderUtils'; +//列表数据 +export const columns = [ + { + title: '班级id', + align:"center", + dataIndex: 'classId' + }, + { + title: '学生id', + align:"center", + dataIndex: 'studentId' + }, + { + title: '状态', + align:"center", + dataIndex: 'status' + }, +]; \ 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/AiolClassStudentForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassStudentForm.vue new file mode 100644 index 00000000..b9bd1115 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassStudentForm.vue @@ -0,0 +1,236 @@ + +{ +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/AiolClassStudentList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassStudentList.vue new file mode 100644 index 00000000..97f1061e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/uniapp3/AiolClassStudentList.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/AiolClass.api.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClass.api.ts new file mode 100644 index 00000000..052772b6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClass.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/aiolClass/list', + save='/aiol/aiolClass/add', + edit='/aiol/aiolClass/edit', + deleteOne = '/aiol/aiolClass/delete', + deleteBatch = '/aiol/aiolClass/deleteBatch', + importExcel = '/aiol/aiolClass/importExcel', + exportXls = '/aiol/aiolClass/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/AiolClass.data.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClass.data.ts new file mode 100644 index 00000000..3639e92c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClass.data.ts @@ -0,0 +1,56 @@ +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: 'name' + }, + { + title: '课程id', + align:"center", + dataIndex: 'courseId' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '班级名', + field: 'name', + component: 'Input', + }, + { + label: '课程id', + field: 'courseId', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + name: {title: '班级名',order: 0,view: 'text', type: 'string',}, + courseId: {title: '课程id',order: 1,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/AiolClassList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClassList.vue new file mode 100644 index 00000000..8536d94c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClassList.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/AiolClassStudent.api.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClassStudent.api.ts new file mode 100644 index 00000000..c321ae4f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClassStudent.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/aiolClassStudent/list', + save='/aiol/aiolClassStudent/add', + edit='/aiol/aiolClassStudent/edit', + deleteOne = '/aiol/aiolClassStudent/delete', + deleteBatch = '/aiol/aiolClassStudent/deleteBatch', + importExcel = '/aiol/aiolClassStudent/importExcel', + exportXls = '/aiol/aiolClassStudent/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/AiolClassStudent.data.ts b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClassStudent.data.ts new file mode 100644 index 00000000..bc4f77c4 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClassStudent.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: '班级id', + align:"center", + dataIndex: 'classId' + }, + { + title: '学生id', + align:"center", + dataIndex: 'studentId' + }, + { + title: '状态', + align:"center", + dataIndex: 'status' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '班级id', + field: 'classId', + component: 'Input', + }, + { + label: '学生id', + field: 'studentId', + component: 'Input', + }, + { + label: '状态', + field: 'status', + component: 'InputNumber', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + classId: {title: '班级id',order: 0,view: 'text', type: 'string',}, + studentId: {title: '学生id',order: 1,view: 'text', type: 'string',}, + status: {title: '状态',order: 2,view: 'number', type: 'number',}, +}; + +/** +* 流程表单调用这个方法获取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/AiolClassStudentList.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClassStudentList.vue new file mode 100644 index 00000000..1ace54e6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/AiolClassStudentList.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/V20250904_1__menu_insert_AiolClass.sql b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/V20250904_1__menu_insert_AiolClass.sql new file mode 100644 index 00000000..4266398a --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/V20250904_1__menu_insert_AiolClass.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 ('2025090402194660260', NULL, '班级', '/aiol/aiolClassList', 'aiol/AiolClassList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660261', '2025090402194660260', '添加班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660262', '2025090402194660260', '编辑班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660263', '2025090402194660260', '删除班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660264', '2025090402194660260', '批量删除班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660265', '2025090402194660260', '导出excel_班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660266', '2025090402194660260', '导入excel_班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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/V20250904_1__menu_insert_AiolClassStudent.sql b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/V20250904_1__menu_insert_AiolClassStudent.sql new file mode 100644 index 00000000..e2b45c5b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/V20250904_1__menu_insert_AiolClassStudent.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 ('2025090403021020350', NULL, '班级学生', '/aiol/aiolClassStudentList', 'aiol/AiolClassStudentList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020351', '2025090403021020350', '添加班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020352', '2025090403021020350', '编辑班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020353', '2025090403021020350', '删除班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020354', '2025090403021020350', '批量删除班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020355', '2025090403021020350', '导出excel_班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020356', '2025090403021020350', '导入excel_班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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/AiolClassForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolClassForm.vue new file mode 100644 index 00000000..7c33caea --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolClassForm.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/AiolClassModal.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolClassModal.vue new file mode 100644 index 00000000..f8cdf9b2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolClassModal.vue @@ -0,0 +1,99 @@ + + + + + \ 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/AiolClassStudentForm.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolClassStudentForm.vue new file mode 100644 index 00000000..1fdb44c0 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolClassStudentForm.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/AiolClassStudentModal.vue b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolClassStudentModal.vue new file mode 100644 index 00000000..12a5cbc4 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/vue3/components/AiolClassStudentModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/AiolClass.api.ts b/jeecgboot-vue3/src/views/aiol/AiolClass.api.ts new file mode 100644 index 00000000..052772b6 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolClass.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/aiolClass/list', + save='/aiol/aiolClass/add', + edit='/aiol/aiolClass/edit', + deleteOne = '/aiol/aiolClass/delete', + deleteBatch = '/aiol/aiolClass/deleteBatch', + importExcel = '/aiol/aiolClass/importExcel', + exportXls = '/aiol/aiolClass/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/AiolClass.data.ts b/jeecgboot-vue3/src/views/aiol/AiolClass.data.ts new file mode 100644 index 00000000..3639e92c --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolClass.data.ts @@ -0,0 +1,56 @@ +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: 'name' + }, + { + title: '课程id', + align:"center", + dataIndex: 'courseId' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '班级名', + field: 'name', + component: 'Input', + }, + { + label: '课程id', + field: 'courseId', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + name: {title: '班级名',order: 0,view: 'text', type: 'string',}, + courseId: {title: '课程id',order: 1,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/AiolClassList.vue b/jeecgboot-vue3/src/views/aiol/AiolClassList.vue new file mode 100644 index 00000000..8536d94c --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolClassList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/AiolClassStudent.api.ts b/jeecgboot-vue3/src/views/aiol/AiolClassStudent.api.ts new file mode 100644 index 00000000..c321ae4f --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolClassStudent.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/aiolClassStudent/list', + save='/aiol/aiolClassStudent/add', + edit='/aiol/aiolClassStudent/edit', + deleteOne = '/aiol/aiolClassStudent/delete', + deleteBatch = '/aiol/aiolClassStudent/deleteBatch', + importExcel = '/aiol/aiolClassStudent/importExcel', + exportXls = '/aiol/aiolClassStudent/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/AiolClassStudent.data.ts b/jeecgboot-vue3/src/views/aiol/AiolClassStudent.data.ts new file mode 100644 index 00000000..bc4f77c4 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolClassStudent.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: '班级id', + align:"center", + dataIndex: 'classId' + }, + { + title: '学生id', + align:"center", + dataIndex: 'studentId' + }, + { + title: '状态', + align:"center", + dataIndex: 'status' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '班级id', + field: 'classId', + component: 'Input', + }, + { + label: '学生id', + field: 'studentId', + component: 'Input', + }, + { + label: '状态', + field: 'status', + component: 'InputNumber', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + classId: {title: '班级id',order: 0,view: 'text', type: 'string',}, + studentId: {title: '学生id',order: 1,view: 'text', type: 'string',}, + status: {title: '状态',order: 2,view: 'number', type: 'number',}, +}; + +/** +* 流程表单调用这个方法获取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/AiolClassStudentList.vue b/jeecgboot-vue3/src/views/aiol/AiolClassStudentList.vue new file mode 100644 index 00000000..1ace54e6 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolClassStudentList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/V20250904_1__menu_insert_AiolClass.sql b/jeecgboot-vue3/src/views/aiol/V20250904_1__menu_insert_AiolClass.sql new file mode 100644 index 00000000..4266398a --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/V20250904_1__menu_insert_AiolClass.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 ('2025090402194660260', NULL, '班级', '/aiol/aiolClassList', 'aiol/AiolClassList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660261', '2025090402194660260', '添加班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660262', '2025090402194660260', '编辑班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660263', '2025090402194660260', '删除班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660264', '2025090402194660260', '批量删除班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660265', '2025090402194660260', '导出excel_班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', 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 ('2025090402194660266', '2025090402194660260', '导入excel_班级', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 02:19:26', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/V20250904_1__menu_insert_AiolClassStudent.sql b/jeecgboot-vue3/src/views/aiol/V20250904_1__menu_insert_AiolClassStudent.sql new file mode 100644 index 00000000..e2b45c5b --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/V20250904_1__menu_insert_AiolClassStudent.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 ('2025090403021020350', NULL, '班级学生', '/aiol/aiolClassStudentList', 'aiol/AiolClassStudentList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020351', '2025090403021020350', '添加班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020352', '2025090403021020350', '编辑班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020353', '2025090403021020350', '删除班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020354', '2025090403021020350', '批量删除班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020355', '2025090403021020350', '导出excel_班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', 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 ('2025090403021020356', '2025090403021020350', '导入excel_班级学生', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_class_student:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-04 03:02:35', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolClassForm.vue b/jeecgboot-vue3/src/views/aiol/components/AiolClassForm.vue new file mode 100644 index 00000000..7c33caea --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolClassForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolClassModal.vue b/jeecgboot-vue3/src/views/aiol/components/AiolClassModal.vue new file mode 100644 index 00000000..f8cdf9b2 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolClassModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolClassStudentForm.vue b/jeecgboot-vue3/src/views/aiol/components/AiolClassStudentForm.vue new file mode 100644 index 00000000..1fdb44c0 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolClassStudentForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/aiol/components/AiolClassStudentModal.vue b/jeecgboot-vue3/src/views/aiol/components/AiolClassStudentModal.vue new file mode 100644 index 00000000..12a5cbc4 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/components/AiolClassStudentModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file