diff --git a/cs_student/pom.xml b/cs_student/pom.xml new file mode 100644 index 0000000..8841431 --- /dev/null +++ b/cs_student/pom.xml @@ -0,0 +1,26 @@ + + + + ruoyi + com.ruoyi + 4.7.6 + + 4.0.0 + + cs_student + + + 8 + 8 + + + + + com.ruoyi + ruoyi-common + + + + \ No newline at end of file diff --git a/cs_student/src/main/java/com/ruoyi/edu/controller/CsStudentController.java b/cs_student/src/main/java/com/ruoyi/edu/controller/CsStudentController.java new file mode 100644 index 0000000..5db74f5 --- /dev/null +++ b/cs_student/src/main/java/com/ruoyi/edu/controller/CsStudentController.java @@ -0,0 +1,127 @@ +package com.ruoyi.edu.controller; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.edu.domain.CsStudent; +import com.ruoyi.edu.service.ICsStudentService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 学生管理Controller + * + * @author ruoyi + * @date 2023-04-17 + */ +@Controller +@RequestMapping("/edu/student") +public class CsStudentController extends BaseController +{ + private String prefix = "edu/student"; + + @Autowired + private ICsStudentService csStudentService; + + @RequiresPermissions("edu:student:view") + @GetMapping() + public String student() + { + return prefix + "/student"; + } + + /** + * 查询学生管理列表 + */ + @RequiresPermissions("edu:student:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(CsStudent csStudent) + { + startPage(); + List list = csStudentService.selectCsStudentList(csStudent); + return getDataTable(list); + } + + /** + * 导出学生管理列表 + */ + @RequiresPermissions("edu:student:export") + @Log(title = "学生管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(CsStudent csStudent) + { + List list = csStudentService.selectCsStudentList(csStudent); + ExcelUtil util = new ExcelUtil(CsStudent.class); + return util.exportExcel(list, "学生管理数据"); + } + + /** + * 新增学生管理 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存学生管理 + */ + @RequiresPermissions("edu:student:add") + @Log(title = "学生管理", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(CsStudent csStudent) + { + return toAjax(csStudentService.insertCsStudent(csStudent)); + } + + /** + * 修改学生管理 + */ + @RequiresPermissions("edu:student:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + CsStudent csStudent = csStudentService.selectCsStudentById(id); + mmap.put("csStudent", csStudent); + return prefix + "/edit"; + } + + /** + * 修改保存学生管理 + */ + @RequiresPermissions("edu:student:edit") + @Log(title = "学生管理", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(CsStudent csStudent) + { + return toAjax(csStudentService.updateCsStudent(csStudent)); + } + + /** + * 删除学生管理 + */ + @RequiresPermissions("edu:student:remove") + @Log(title = "学生管理", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(csStudentService.deleteCsStudentByIds(ids)); + } +} diff --git a/cs_student/src/main/java/com/ruoyi/edu/domain/CsStudent.java b/cs_student/src/main/java/com/ruoyi/edu/domain/CsStudent.java new file mode 100644 index 0000000..cb83f99 --- /dev/null +++ b/cs_student/src/main/java/com/ruoyi/edu/domain/CsStudent.java @@ -0,0 +1,107 @@ +package com.ruoyi.edu.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 学生管理对象 cs_student + * + * @author ruoyi + * @date 2023-04-17 + */ +public class CsStudent extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 性别 */ + @Excel(name = "性别") + private String sex; + + /** 年龄 */ + @Excel(name = "年龄") + private String age; + + /** 部门 */ + @Excel(name = "部门") + private String depart; + + /** 班级 */ + @Excel(name = "班级") + private String cclass; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setSex(String sex) + { + this.sex = sex; + } + + public String getSex() + { + return sex; + } + public void setAge(String age) + { + this.age = age; + } + + public String getAge() + { + return age; + } + public void setDepart(String depart) + { + this.depart = depart; + } + + public String getDepart() + { + return depart; + } + public void setCclass(String cclass) + { + this.cclass = cclass; + } + + public String getCclass() + { + return cclass; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("sex", getSex()) + .append("age", getAge()) + .append("depart", getDepart()) + .append("cclass", getCclass()) + .toString(); + } +} diff --git a/cs_student/src/main/java/com/ruoyi/edu/mapper/CsStudentMapper.java b/cs_student/src/main/java/com/ruoyi/edu/mapper/CsStudentMapper.java new file mode 100644 index 0000000..8b5e1e1 --- /dev/null +++ b/cs_student/src/main/java/com/ruoyi/edu/mapper/CsStudentMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.edu.mapper; + +import java.util.List; +import com.ruoyi.edu.domain.CsStudent; + +/** + * 学生管理Mapper接口 + * + * @author ruoyi + * @date 2023-04-17 + */ +public interface CsStudentMapper +{ + /** + * 查询学生管理 + * + * @param id 学生管理主键 + * @return 学生管理 + */ + public CsStudent selectCsStudentById(Long id); + + /** + * 查询学生管理列表 + * + * @param csStudent 学生管理 + * @return 学生管理集合 + */ + public List selectCsStudentList(CsStudent csStudent); + + /** + * 新增学生管理 + * + * @param csStudent 学生管理 + * @return 结果 + */ + public int insertCsStudent(CsStudent csStudent); + + /** + * 修改学生管理 + * + * @param csStudent 学生管理 + * @return 结果 + */ + public int updateCsStudent(CsStudent csStudent); + + /** + * 删除学生管理 + * + * @param id 学生管理主键 + * @return 结果 + */ + public int deleteCsStudentById(Long id); + + /** + * 批量删除学生管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCsStudentByIds(String[] ids); +} diff --git a/cs_student/src/main/java/com/ruoyi/edu/service/ICsStudentService.java b/cs_student/src/main/java/com/ruoyi/edu/service/ICsStudentService.java new file mode 100644 index 0000000..5a028e8 --- /dev/null +++ b/cs_student/src/main/java/com/ruoyi/edu/service/ICsStudentService.java @@ -0,0 +1,61 @@ +package com.ruoyi.edu.service; + +import java.util.List; +import com.ruoyi.edu.domain.CsStudent; + +/** + * 学生管理Service接口 + * + * @author ruoyi + * @date 2023-04-17 + */ +public interface ICsStudentService +{ + /** + * 查询学生管理 + * + * @param id 学生管理主键 + * @return 学生管理 + */ + public CsStudent selectCsStudentById(Long id); + + /** + * 查询学生管理列表 + * + * @param csStudent 学生管理 + * @return 学生管理集合 + */ + public List selectCsStudentList(CsStudent csStudent); + + /** + * 新增学生管理 + * + * @param csStudent 学生管理 + * @return 结果 + */ + public int insertCsStudent(CsStudent csStudent); + + /** + * 修改学生管理 + * + * @param csStudent 学生管理 + * @return 结果 + */ + public int updateCsStudent(CsStudent csStudent); + + /** + * 批量删除学生管理 + * + * @param ids 需要删除的学生管理主键集合 + * @return 结果 + */ + public int deleteCsStudentByIds(String ids); + + /** + * 删除学生管理信息 + * + * @param id 学生管理主键 + * @return 结果 + */ + public int deleteCsStudentById(Long id); +} diff --git a/cs_student/src/main/java/com/ruoyi/edu/service/impl/CsStudentServiceImpl.java b/cs_student/src/main/java/com/ruoyi/edu/service/impl/CsStudentServiceImpl.java new file mode 100644 index 0000000..bcb2deb --- /dev/null +++ b/cs_student/src/main/java/com/ruoyi/edu/service/impl/CsStudentServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.edu.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.edu.mapper.CsStudentMapper; +import com.ruoyi.edu.domain.CsStudent; +import com.ruoyi.edu.service.ICsStudentService; +import com.ruoyi.common.core.text.Convert; + +/** + * 学生管理Service业务层处理 + * + * @author ruoyi + * @date 2023-04-17 + */ +@Service +public class CsStudentServiceImpl implements ICsStudentService +{ + @Autowired + private CsStudentMapper csStudentMapper; + + /** + * 查询学生管理 + * + * @param id 学生管理主键 + * @return 学生管理 + */ + @Override + public CsStudent selectCsStudentById(Long id) + { + return csStudentMapper.selectCsStudentById(id); + } + + /** + * 查询学生管理列表 + * + * @param csStudent 学生管理 + * @return 学生管理 + */ + @Override + public List selectCsStudentList(CsStudent csStudent) + { + return csStudentMapper.selectCsStudentList(csStudent); + } + + /** + * 新增学生管理 + * + * @param csStudent 学生管理 + * @return 结果 + */ + @Override + public int insertCsStudent(CsStudent csStudent) + { + return csStudentMapper.insertCsStudent(csStudent); + } + + /** + * 修改学生管理 + * + * @param csStudent 学生管理 + * @return 结果 + */ + @Override + public int updateCsStudent(CsStudent csStudent) + { + return csStudentMapper.updateCsStudent(csStudent); + } + + /** + * 批量删除学生管理 + * + * @param ids 需要删除的学生管理主键 + * @return 结果 + */ + @Override + public int deleteCsStudentByIds(String ids) + { + return csStudentMapper.deleteCsStudentByIds(Convert.toStrArray(ids)); + } + + /** + * 删除学生管理信息 + * + * @param id 学生管理主键 + * @return 结果 + */ + @Override + public int deleteCsStudentById(Long id) + { + return csStudentMapper.deleteCsStudentById(id); + } +} diff --git a/cs_student/src/main/resources/mapper/edu/CsStudentMapper.xml b/cs_student/src/main/resources/mapper/edu/CsStudentMapper.xml new file mode 100644 index 0000000..a423018 --- /dev/null +++ b/cs_student/src/main/resources/mapper/edu/CsStudentMapper.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + select id, name, sex, age, depart, cclass from cs_student + + + + + + + + insert into cs_student + + name, + sex, + age, + depart, + cclass, + + + #{name}, + #{sex}, + #{age}, + #{depart}, + #{cclass}, + + + + + update cs_student + + name = #{name}, + sex = #{sex}, + age = #{age}, + depart = #{depart}, + cclass = #{cclass}, + + where id = #{id} + + + + delete from cs_student where id = #{id} + + + + delete from cs_student where id in + + #{id} + + + + \ No newline at end of file diff --git a/cs_student/src/main/resources/templates/edu/student/add.html b/cs_student/src/main/resources/templates/edu/student/add.html new file mode 100644 index 0000000..8916634 --- /dev/null +++ b/cs_student/src/main/resources/templates/edu/student/add.html @@ -0,0 +1,71 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/cs_student/src/main/resources/templates/edu/student/edit.html b/cs_student/src/main/resources/templates/edu/student/edit.html new file mode 100644 index 0000000..f3ee895 --- /dev/null +++ b/cs_student/src/main/resources/templates/edu/student/edit.html @@ -0,0 +1,72 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/cs_student/src/main/resources/templates/edu/student/student.html b/cs_student/src/main/resources/templates/edu/student/student.html new file mode 100644 index 0000000..e1518fe --- /dev/null +++ b/cs_student/src/main/resources/templates/edu/student/student.html @@ -0,0 +1,118 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index dd17577..18afcc7 100644 --- a/pom.xml +++ b/pom.xml @@ -171,6 +171,11 @@ cs_test1 ${ruoyi.version} + + com.ruoyi + cs_student + ${ruoyi.version} + @@ -205,6 +210,7 @@ ruoyi-common cs_test cs_test1 + cs_student pom diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 8dcb0d2..c9b351a 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -76,6 +76,10 @@ com.ruoyi cs_test1 + + com.ruoyi + cs_student + diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index d9d4510..59ac302 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -98,7 +98,7 @@ shiro: # 首页地址 indexUrl: /index # 验证码开关 - captchaEnabled: true + captchaEnabled: false # 验证码类型 math 数组计算 char 字符 captchaType: math cookie: diff --git a/ruoyi-generator/src/main/resources/generator.yml b/ruoyi-generator/src/main/resources/generator.yml index 8e3224e..d7b0d68 100644 --- a/ruoyi-generator/src/main/resources/generator.yml +++ b/ruoyi-generator/src/main/resources/generator.yml @@ -4,7 +4,7 @@ gen: # 作者 author: ruoyi # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool - packageName: com.ruoyi.system + packageName: com.ruoyi.edu # 自动去除表前缀,默认是false autoRemovePre: false # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)