From c56fbfd8bfab8c068b04b827ded97a808bb79f08 Mon Sep 17 00:00:00 2001 From: paidaxing444 <12qwaszx> Date: Tue, 14 Apr 2020 18:12:03 +0800 Subject: [PATCH] =?UTF-8?q?20200414-zlp-1=20=E7=8F=AD=E7=BA=A7=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/system/class.js | 53 +++ ruoyi-ui/src/views/system/class/index.vue | 387 ++++++++++++++++++ .../system/controller/ByClassController.java | 103 +++++ .../ruoyi/project/system/domain/ByClass.java | 219 ++++++++++ .../project/system/mapper/ByClassMapper.java | 61 +++ .../system/service/IByClassService.java | 61 +++ .../service/impl/ByClassServiceImpl.java | 93 +++++ .../mybatis/system/ByClassMapper.xml | 114 ++++++ 8 files changed, 1091 insertions(+) create mode 100644 ruoyi-ui/src/api/system/class.js create mode 100644 ruoyi-ui/src/views/system/class/index.vue create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/domain/ByClass.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/mapper/ByClassMapper.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/service/IByClassService.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/service/impl/ByClassServiceImpl.java create mode 100644 ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml diff --git a/ruoyi-ui/src/api/system/class.js b/ruoyi-ui/src/api/system/class.js new file mode 100644 index 000000000..ba002de12 --- /dev/null +++ b/ruoyi-ui/src/api/system/class.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询班级信息列表 +export function listClass(query) { + return request({ + url: '/system/class/list', + method: 'get', + params: query + }) +} + +// 查询班级信息详细 +export function getClass(bjbh) { + return request({ + url: '/system/class/' + bjbh, + method: 'get' + }) +} + +// 新增班级信息 +export function addClass(data) { + return request({ + url: '/system/class', + method: 'post', + data: data + }) +} + +// 修改班级信息 +export function updateClass(data) { + return request({ + url: '/system/class', + method: 'put', + data: data + }) +} + +// 删除班级信息 +export function delClass(bjbh) { + return request({ + url: '/system/class/' + bjbh, + method: 'delete' + }) +} + +// 导出班级信息 +export function exportClass(query) { + return request({ + url: '/system/class/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/views/system/class/index.vue b/ruoyi-ui/src/views/system/class/index.vue new file mode 100644 index 000000000..4a452f487 --- /dev/null +++ b/ruoyi-ui/src/views/system/class/index.vue @@ -0,0 +1,387 @@ + + + \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java b/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java new file mode 100644 index 000000000..02ac88547 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.system.controller; + +import java.util.Date; +import java.util.List; +import java.util.UUID; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.system.domain.ByClass; +import com.ruoyi.project.system.service.IByClassService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 班级信息Controller + * + * @author tsbz + * @date 2020-04-14 + */ +@RestController +@RequestMapping("/system/class") +public class ByClassController extends BaseController { + @Autowired + private IByClassService byClassService; + + /** + * 查询班级信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:class:list')") + @GetMapping("/list") + public TableDataInfo list(ByClass byClass) { + startPage(); + List list = byClassService.selectByClassList(byClass); + return getDataTable(list); + } + + /** + * 导出班级信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:class:export')") + @Log(title = "班级信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ByClass byClass) { + List list = byClassService.selectByClassList(byClass); + ExcelUtil util = new ExcelUtil(ByClass.class); + return util.exportExcel(list, "class"); + } + + /** + * 获取班级信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:class:query')") + @GetMapping(value = "/{bjbh}") + public AjaxResult getInfo(@PathVariable("bjbh") String bjbh) { + return AjaxResult.success(byClassService.selectByClassById(bjbh)); + } + + /** + * 新增班级信息 + */ + @PreAuthorize("@ss.hasPermi('system:class:add')") + @Log(title = "班级信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ByClass byClass) { + String strBjbh = UUID.randomUUID().toString().replace("-",""); + System.out.println("bjbh:==" + strBjbh); + byClass.setBjbh(strBjbh); + byClass.setCreatetime(new Date()); + return toAjax(byClassService.insertByClass(byClass)); + } + + /** + * 修改班级信息 + */ + @PreAuthorize("@ss.hasPermi('system:class:edit')") + @Log(title = "班级信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ByClass byClass) { + return toAjax(byClassService.updateByClass(byClass)); + } + + /** + * 删除班级信息 + */ + @PreAuthorize("@ss.hasPermi('system:class:remove')") + @Log(title = "班级信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{bjbhs}") + public AjaxResult remove(@PathVariable String[] bjbhs) { + return toAjax(byClassService.deleteByClassByIds(bjbhs)); + } +} \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/ByClass.java b/ruoyi/src/main/java/com/ruoyi/project/system/domain/ByClass.java new file mode 100644 index 000000000..6f5cd30fb --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/domain/ByClass.java @@ -0,0 +1,219 @@ +package com.ruoyi.project.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +import java.util.Date; + +/** + * 班级信息对象 by_class + * + * @author tsbz + * @date 2020-04-14 + */ +public class ByClass extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 班级编号 + */ + private String bjbh; + + /** + * 学校代码 + */ + @Excel(name = "学校代码") + private String schoolid; + + /** + * 班级类型 + */ + @Excel(name = "班级类型") + private String bjtype; + + /** + * 班级序号 + */ + @Excel(name = "班级序号") + private Long bhxh; + + /** + * 学年 + */ + @Excel(name = "学年") + private String xn; + + /** + * 班级名称 + */ + @Excel(name = "班级名称") + private String bjmc; + + /** + * 班级荣誉称号 + */ + @Excel(name = "班级荣誉称号") + private String bjrych; + + /** + * 建班年月 + */ + @Excel(name = "建班年月", width = 30, dateFormat = "yyyy-MM-dd") + private Date jbny; + + /** + * 主班教师 + */ + @Excel(name = "主班教师") + private Long zbjs; + + /** + * 配班教师 + */ + @Excel(name = "配班教师") + private Long pbjs; + + /** + * 助理教师 + */ + @Excel(name = "助理教师") + private Long zljs; + + /** + * 是否删除 + * 1:删除 + * 0:正常 + */ + @Excel(name = "是否删除 1:删除 0:正常") + private String isdel; + /** + * 创建时间 + */ + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createtime; + + public void setBjbh(String bjbh) { + this.bjbh = bjbh; + } + + public String getBjbh() { + return bjbh; + } + + public void setSchoolid(String schoolid) { + this.schoolid = schoolid; + } + + public String getSchoolid() { + return schoolid; + } + + public void setBjtype(String bjtype) { + this.bjtype = bjtype; + } + + public String getBjtype() { + return bjtype; + } + + public void setBhxh(Long bhxh) { + this.bhxh = bhxh; + } + + public Long getBhxh() { + return bhxh; + } + + public void setXn(String xn) { + this.xn = xn; + } + + public String getXn() { + return xn; + } + + public void setBjmc(String bjmc) { + this.bjmc = bjmc; + } + + public String getBjmc() { + return bjmc; + } + + public void setBjrych(String bjrych) { + this.bjrych = bjrych; + } + + public String getBjrych() { + return bjrych; + } + + public void setJbny(Date jbny) { + this.jbny = jbny; + } + + public Date getJbny() { + return jbny; + } + + public void setZbjs(Long zbjs) { + this.zbjs = zbjs; + } + + public Long getZbjs() { + return zbjs; + } + + public void setPbjs(Long pbjs) { + this.pbjs = pbjs; + } + + public Long getPbjs() { + return pbjs; + } + + public void setZljs(Long zljs) { + this.zljs = zljs; + } + + public Long getZljs() { + return zljs; + } + + public void setIsdel(String isdel) { + this.isdel = isdel; + } + + public String getIsdel() { + return isdel; + } + + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + public Date getCreatetime() { + return createtime; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("bjbh", getBjbh()) + .append("schoolid", getSchoolid()) + .append("bjtype", getBjtype()) + .append("bhxh", getBhxh()) + .append("xn", getXn()) + .append("bjmc", getBjmc()) + .append("bjrych", getBjrych()) + .append("jbny", getJbny()) + .append("zbjs", getZbjs()) + .append("pbjs", getPbjs()) + .append("zljs", getZljs()) + .append("isdel", getIsdel()) + .append("createtime", getCreatetime()) + .toString(); + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/mapper/ByClassMapper.java b/ruoyi/src/main/java/com/ruoyi/project/system/mapper/ByClassMapper.java new file mode 100644 index 000000000..d897f7678 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/mapper/ByClassMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import com.ruoyi.project.system.domain.ByClass; + +/** + * 班级信息Mapper接口 + * + * @author tsbz + * @date 2020-04-14 + */ +public interface ByClassMapper +{ + /** + * 查询班级信息 + * + * @param bjbh 班级信息ID + * @return 班级信息 + */ + public ByClass selectByClassById(String bjbh); + + /** + * 查询班级信息列表 + * + * @param byClass 班级信息 + * @return 班级信息集合 + */ + public List selectByClassList(ByClass byClass); + + /** + * 新增班级信息 + * + * @param byClass 班级信息 + * @return 结果 + */ + public int insertByClass(ByClass byClass); + + /** + * 修改班级信息 + * + * @param byClass 班级信息 + * @return 结果 + */ + public int updateByClass(ByClass byClass); + + /** + * 删除班级信息 + * + * @param bjbh 班级信息ID + * @return 结果 + */ + public int deleteByClassById(String bjbh); + + /** + * 批量删除班级信息 + * + * @param bjbhs 需要删除的数据ID + * @return 结果 + */ + public int deleteByClassByIds(String[] bjbhs); +} \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/service/IByClassService.java b/ruoyi/src/main/java/com/ruoyi/project/system/service/IByClassService.java new file mode 100644 index 000000000..7c94ec000 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/service/IByClassService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import com.ruoyi.project.system.domain.ByClass; + +/** + * 班级信息Service接口 + * + * @author tsbz + * @date 2020-04-14 + */ +public interface IByClassService +{ + /** + * 查询班级信息 + * + * @param bjbh 班级信息ID + * @return 班级信息 + */ + public ByClass selectByClassById(String bjbh); + + /** + * 查询班级信息列表 + * + * @param byClass 班级信息 + * @return 班级信息集合 + */ + public List selectByClassList(ByClass byClass); + + /** + * 新增班级信息 + * + * @param byClass 班级信息 + * @return 结果 + */ + public int insertByClass(ByClass byClass); + + /** + * 修改班级信息 + * + * @param byClass 班级信息 + * @return 结果 + */ + public int updateByClass(ByClass byClass); + + /** + * 批量删除班级信息 + * + * @param bjbhs 需要删除的班级信息ID + * @return 结果 + */ + public int deleteByClassByIds(String[] bjbhs); + + /** + * 删除班级信息信息 + * + * @param bjbh 班级信息ID + * @return 结果 + */ + public int deleteByClassById(String bjbh); +} \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/ByClassServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/ByClassServiceImpl.java new file mode 100644 index 000000000..9e8fb4509 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/ByClassServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.system.mapper.ByClassMapper; +import com.ruoyi.project.system.domain.ByClass; +import com.ruoyi.project.system.service.IByClassService; + +/** + * 班级信息Service业务层处理 + * + * @author tsbz + * @date 2020-04-14 + */ +@Service +public class ByClassServiceImpl implements IByClassService +{ + @Autowired + private ByClassMapper byClassMapper; + + /** + * 查询班级信息 + * + * @param bjbh 班级信息ID + * @return 班级信息 + */ + @Override + public ByClass selectByClassById(String bjbh) + { + return byClassMapper.selectByClassById(bjbh); + } + + /** + * 查询班级信息列表 + * + * @param byClass 班级信息 + * @return 班级信息 + */ + @Override + public List selectByClassList(ByClass byClass) + { + return byClassMapper.selectByClassList(byClass); + } + + /** + * 新增班级信息 + * + * @param byClass 班级信息 + * @return 结果 + */ + @Override + public int insertByClass(ByClass byClass) + { + return byClassMapper.insertByClass(byClass); + } + + /** + * 修改班级信息 + * + * @param byClass 班级信息 + * @return 结果 + */ + @Override + public int updateByClass(ByClass byClass) + { + return byClassMapper.updateByClass(byClass); + } + + /** + * 批量删除班级信息 + * + * @param bjbhs 需要删除的班级信息ID + * @return 结果 + */ + @Override + public int deleteByClassByIds(String[] bjbhs) + { + return byClassMapper.deleteByClassByIds(bjbhs); + } + + /** + * 删除班级信息信息 + * + * @param bjbh 班级信息ID + * @return 结果 + */ + @Override + public int deleteByClassById(String bjbh) + { + return byClassMapper.deleteByClassById(bjbh); + } +} \ No newline at end of file diff --git a/ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml b/ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml new file mode 100644 index 000000000..7ba172294 --- /dev/null +++ b/ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + select bjbh, schoolid, bjtype, bhxh, xn, bjmc, bjrych, jbny, zbjs, pbjs, zljs, isdel, createtime from by_class + + + + + + + + insert into by_class + + bjbh, + schoolid, + bjtype, + bhxh, + xn, + bjmc, + bjrych, + jbny, + zbjs, + pbjs, + zljs, + isdel, + createtime, + + + #{bjbh}, + #{schoolid}, + #{bjtype}, + #{bhxh}, + #{xn}, + #{bjmc}, + #{bjrych}, + #{jbny}, + #{zbjs}, + #{pbjs}, + #{zljs}, + #{isdel}, + #{createtime}, + + + + + update by_class + + schoolid = #{schoolid}, + bjtype = #{bjtype}, + bhxh = #{bhxh}, + xn = #{xn}, + bjmc = #{bjmc}, + bjrych = #{bjrych}, + jbny = #{jbny}, + zbjs = #{zbjs}, + pbjs = #{pbjs}, + zljs = #{zljs}, + isdel = #{isdel}, + createtime = #{createtime}, + + where bjbh = #{bjbh} + + + + delete from by_class where bjbh = #{bjbh} + + + + delete from by_class where bjbh in + + #{bjbh} + + + + \ No newline at end of file