游戏数学学期计划

This commit is contained in:
sk1551
2020-10-29 15:19:18 +08:00
parent b5a602af52
commit 09ca6827c4
10 changed files with 1256 additions and 54 deletions

View File

@ -6,26 +6,24 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
* 启动程序
*
*
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
public static void main(String[] args)
{
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class RuoYiApplication {
public static void main(String[] args) {
System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args);
System.out.println(
"-------^&^-------" +
"BenYi Startup success" +
"-------^&^-------\n" +
"-------^&^-------" +
"BenYi Startup success" +
"-------^&^-------\n" +
"-------^&^-------" +
"BenYi Startup success" +
"-------^&^-------\n"
"BenYi Startup success" +
"-------^&^-------\n" +
"-------^&^-------" +
"BenYi Startup success" +
"-------^&^-------\n" +
"-------^&^-------" +
"BenYi Startup success" +
"-------^&^-------\n"
);
}
}

View File

@ -0,0 +1,134 @@
package com.ruoyi.project.benyi.controller;
import java.util.List;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.project.common.SchoolCommon;
import com.ruoyi.project.system.service.IByClassService;
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.benyi.domain.ByMathTermplan;
import com.ruoyi.project.benyi.service.IByMathTermplanService;
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-10-29
*/
@RestController
@RequestMapping("/benyi/mathtermplan")
public class ByMathTermplanController extends BaseController
{
@Autowired
private IByMathTermplanService byMathTermplanService;
@Autowired
private SchoolCommon schoolCommon;
@Autowired
private IByClassService byClassService;
/**
* 查询游戏数学学期计划列表
*/
@PreAuthorize("@ss.hasPermi('benyi:mathtermplan:list')")
@GetMapping("/list")
public TableDataInfo list(ByMathTermplan byMathTermplan)
{
startPage();
List<ByMathTermplan> list = byMathTermplanService.selectByMathTermplanList(byMathTermplan);
return getDataTable(list);
}
/**
* 导出游戏数学学期计划列表
*/
@PreAuthorize("@ss.hasPermi('benyi:mathtermplan:export')")
@Log(title = "游戏数学学期计划", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ByMathTermplan byMathTermplan)
{
List<ByMathTermplan> list = byMathTermplanService.selectByMathTermplanList(byMathTermplan);
ExcelUtil<ByMathTermplan> util = new ExcelUtil<ByMathTermplan>(ByMathTermplan.class);
return util.exportExcel(list, "mathtermplan");
}
/**
* 获取游戏数学学期计划详细信息
*/
@PreAuthorize("@ss.hasPermi('benyi:mathtermplan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return AjaxResult.success(byMathTermplanService.selectByMathTermplanById(id));
}
/**
* 新增游戏数学学期计划
*/
@PreAuthorize("@ss.hasPermi('benyi:mathtermplan:add')")
@Log(title = "游戏数学学期计划", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ByMathTermplan byMathTermplan)
{
String classId = schoolCommon.getClassId();
int iCount = schoolCommon.getDifMonth(byMathTermplan.getStartmonth(), byMathTermplan.getEndmonth());
System.out.println("月份差=" + iCount);
String uuid = schoolCommon.getUuid();
byMathTermplan.setId(uuid);
byMathTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byMathTermplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byMathTermplan.setClassid(classId);
byMathTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合学期计划");
return toAjax(byMathTermplanService.insertByMathTermplan(byMathTermplan));
}
/**
* 修改游戏数学学期计划
*/
@PreAuthorize("@ss.hasPermi('benyi:mathtermplan:edit')")
@Log(title = "游戏数学学期计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ByMathTermplan byMathTermplan)
{
return toAjax(byMathTermplanService.updateByMathTermplan(byMathTermplan));
}
/**
* 删除游戏数学学期计划
*/
@PreAuthorize("@ss.hasPermi('benyi:mathtermplan:remove')")
@Log(title = "游戏数学学期计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(byMathTermplanService.deleteByMathTermplanByIds(ids));
}
/**
* 提交主题整合学期计划
*/
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:edit')")
@Log(title = "主题整合学期计划", businessType = BusinessType.UPDATE)
@PostMapping("/check/{id}")
public AjaxResult check(@PathVariable String id) {
ByMathTermplan byMathTermplan = new ByMathTermplan();
byMathTermplan.setId(id);
byMathTermplan.setStatus("1");
return toAjax(byMathTermplanService.updateByMathTermplan(byMathTermplan));
}
}

View File

@ -0,0 +1,209 @@
package com.ruoyi.project.benyi.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* 游戏数学学期计划对象 by_math_termplan
*
* @author tsbz
* @date 2020-10-29
*/
public class ByMathTermplan extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
private String id;
/**
* 学校ID
*/
@Excel(name = "学校ID")
private Long schoolid;
/**
* 班级id
*/
@Excel(name = "班级id")
private String classid;
/**
* 名称
*/
@Excel(name = "名称")
private String name;
/**
* 开始月份
*/
@JsonFormat(pattern = "yyyy-MM")
@Excel(name = "开始月份", width = 30, dateFormat = "yyyy-MM")
private Date startmonth;
/**
* 结束月份
*/
@JsonFormat(pattern = "yyyy-MM")
@Excel(name = "结束月份", width = 30, dateFormat = "yyyy-MM")
private Date endmonth;
/**
* 学年学期
*/
@Excel(name = "学年学期")
private String xnxq;
/**
* 状态
*/
@Excel(name = "状态")
private String status;
/**
* 审批人
*/
@Excel(name = "审批人")
private Integer spr;
/**
* 审批时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date sptime;
/**
* 审批意见
*/
@Excel(name = "审批意见")
private String spyj;
/**
* 创建人
*/
@Excel(name = "创建人")
private Long createuserid;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setSchoolid(Long schoolid) {
this.schoolid = schoolid;
}
public Long getSchoolid() {
return schoolid;
}
public void setClassid(String classid) {
this.classid = classid;
}
public String getClassid() {
return classid;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setStartmonth(Date startmonth) {
this.startmonth = startmonth;
}
public Date getStartmonth() {
return startmonth;
}
public void setEndmonth(Date endmonth) {
this.endmonth = endmonth;
}
public Date getEndmonth() {
return endmonth;
}
public void setXnxq(String xnxq) {
this.xnxq = xnxq;
}
public String getXnxq() {
return xnxq;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setSpr(Integer spr) {
this.spr = spr;
}
public Integer getSpr() {
return spr;
}
public void setSptime(Date sptime) {
this.sptime = sptime;
}
public Date getSptime() {
return sptime;
}
public void setSpyj(String spyj) {
this.spyj = spyj;
}
public String getSpyj() {
return spyj;
}
public void setCreateuserid(Long createuserid) {
this.createuserid = createuserid;
}
public Long getCreateuserid() {
return createuserid;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("schoolid", getSchoolid())
.append("classid", getClassid())
.append("name", getName())
.append("startmonth", getStartmonth())
.append("endmonth", getEndmonth())
.append("xnxq", getXnxq())
.append("status", getStatus())
.append("spr", getSpr())
.append("sptime", getSptime())
.append("spyj", getSpyj())
.append("remark", getRemark())
.append("createuserid", getCreateuserid())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.mapper;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByMathTermplan;
/**
* 游戏数学学期计划Mapper接口
*
* @author tsbz
* @date 2020-10-29
*/
public interface ByMathTermplanMapper
{
/**
* 查询游戏数学学期计划
*
* @param id 游戏数学学期计划ID
* @return 游戏数学学期计划
*/
public ByMathTermplan selectByMathTermplanById(String id);
/**
* 查询游戏数学学期计划列表
*
* @param byMathTermplan 游戏数学学期计划
* @return 游戏数学学期计划集合
*/
public List<ByMathTermplan> selectByMathTermplanList(ByMathTermplan byMathTermplan);
/**
* 新增游戏数学学期计划
*
* @param byMathTermplan 游戏数学学期计划
* @return 结果
*/
public int insertByMathTermplan(ByMathTermplan byMathTermplan);
/**
* 修改游戏数学学期计划
*
* @param byMathTermplan 游戏数学学期计划
* @return 结果
*/
public int updateByMathTermplan(ByMathTermplan byMathTermplan);
/**
* 删除游戏数学学期计划
*
* @param id 游戏数学学期计划ID
* @return 结果
*/
public int deleteByMathTermplanById(String id);
/**
* 批量删除游戏数学学期计划
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteByMathTermplanByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.service;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByMathTermplan;
/**
* 游戏数学学期计划Service接口
*
* @author tsbz
* @date 2020-10-29
*/
public interface IByMathTermplanService
{
/**
* 查询游戏数学学期计划
*
* @param id 游戏数学学期计划ID
* @return 游戏数学学期计划
*/
public ByMathTermplan selectByMathTermplanById(String id);
/**
* 查询游戏数学学期计划列表
*
* @param byMathTermplan 游戏数学学期计划
* @return 游戏数学学期计划集合
*/
public List<ByMathTermplan> selectByMathTermplanList(ByMathTermplan byMathTermplan);
/**
* 新增游戏数学学期计划
*
* @param byMathTermplan 游戏数学学期计划
* @return 结果
*/
public int insertByMathTermplan(ByMathTermplan byMathTermplan);
/**
* 修改游戏数学学期计划
*
* @param byMathTermplan 游戏数学学期计划
* @return 结果
*/
public int updateByMathTermplan(ByMathTermplan byMathTermplan);
/**
* 批量删除游戏数学学期计划
*
* @param ids 需要删除的游戏数学学期计划ID
* @return 结果
*/
public int deleteByMathTermplanByIds(String[] ids);
/**
* 删除游戏数学学期计划信息
*
* @param id 游戏数学学期计划ID
* @return 结果
*/
public int deleteByMathTermplanById(String id);
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.project.benyi.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.benyi.mapper.ByMathTermplanMapper;
import com.ruoyi.project.benyi.domain.ByMathTermplan;
import com.ruoyi.project.benyi.service.IByMathTermplanService;
/**
* 游戏数学学期计划Service业务层处理
*
* @author tsbz
* @date 2020-10-29
*/
@Service
public class ByMathTermplanServiceImpl implements IByMathTermplanService
{
@Autowired
private ByMathTermplanMapper byMathTermplanMapper;
/**
* 查询游戏数学学期计划
*
* @param id 游戏数学学期计划ID
* @return 游戏数学学期计划
*/
@Override
public ByMathTermplan selectByMathTermplanById(String id)
{
return byMathTermplanMapper.selectByMathTermplanById(id);
}
/**
* 查询游戏数学学期计划列表
*
* @param byMathTermplan 游戏数学学期计划
* @return 游戏数学学期计划
*/
@Override
public List<ByMathTermplan> selectByMathTermplanList(ByMathTermplan byMathTermplan)
{
return byMathTermplanMapper.selectByMathTermplanList(byMathTermplan);
}
/**
* 新增游戏数学学期计划
*
* @param byMathTermplan 游戏数学学期计划
* @return 结果
*/
@Override
public int insertByMathTermplan(ByMathTermplan byMathTermplan)
{
byMathTermplan.setCreateTime(DateUtils.getNowDate());
return byMathTermplanMapper.insertByMathTermplan(byMathTermplan);
}
/**
* 修改游戏数学学期计划
*
* @param byMathTermplan 游戏数学学期计划
* @return 结果
*/
@Override
public int updateByMathTermplan(ByMathTermplan byMathTermplan)
{
return byMathTermplanMapper.updateByMathTermplan(byMathTermplan);
}
/**
* 批量删除游戏数学学期计划
*
* @param ids 需要删除的游戏数学学期计划ID
* @return 结果
*/
@Override
public int deleteByMathTermplanByIds(String[] ids)
{
return byMathTermplanMapper.deleteByMathTermplanByIds(ids);
}
/**
* 删除游戏数学学期计划信息
*
* @param id 游戏数学学期计划ID
* @return 结果
*/
@Override
public int deleteByMathTermplanById(String id)
{
return byMathTermplanMapper.deleteByMathTermplanById(id);
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.benyi.mapper.ByMathTermplanMapper">
<resultMap type="ByMathTermplan" id="ByMathTermplanResult">
<result property="id" column="id"/>
<result property="schoolid" column="schoolid"/>
<result property="classid" column="classid"/>
<result property="name" column="name"/>
<result property="startmonth" column="startmonth"/>
<result property="endmonth" column="endmonth"/>
<result property="xnxq" column="xnxq"/>
<result property="status" column="status"/>
<result property="spr" column="spr"/>
<result property="sptime" column="sptime"/>
<result property="spyj" column="spyj"/>
<result property="remark" column="remark"/>
<result property="createuserid" column="createuserid"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectByMathTermplanVo">
select id, schoolid, classid, name, startmonth, endmonth, xnxq, status, spr, sptime, spyj, remark, createuserid, create_time from by_math_termplan
</sql>
<select id="selectByMathTermplanList" parameterType="ByMathTermplan" resultMap="ByMathTermplanResult">
<include refid="selectByMathTermplanVo"/>
<where>
<if test="schoolid != null ">and schoolid = #{schoolid}</if>
<if test="classid != null and classid != ''">and classid = #{classid}</if>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="startmonth != null ">and startmonth = #{startmonth}</if>
<if test="endmonth != null ">and endmonth = #{endmonth}</if>
<if test="xnxq != null and xnxq != ''">and xnxq = #{xnxq}</if>
<if test="status != null and status != ''">and status = #{status}</if>
<if test="spr != null ">and spr = #{spr}</if>
<if test="sptime != null ">and sptime = #{sptime}</if>
<if test="spyj != null and spyj != ''">and spyj = #{spyj}</if>
<if test="createuserid != null ">and createuserid = #{createuserid}</if>
</where>
</select>
<select id="selectByMathTermplanById" parameterType="String" resultMap="ByMathTermplanResult">
<include refid="selectByMathTermplanVo"/>
where id = #{id}
</select>
<insert id="insertByMathTermplan" parameterType="ByMathTermplan">
insert into by_math_termplan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="schoolid != null ">schoolid,</if>
<if test="classid != null and classid != ''">classid,</if>
<if test="name != null and name != ''">name,</if>
<if test="startmonth != null ">startmonth,</if>
<if test="endmonth != null ">endmonth,</if>
<if test="xnxq != null and xnxq != ''">xnxq,</if>
<if test="status != null and status != ''">status,</if>
<if test="spr != null ">spr,</if>
<if test="sptime != null ">sptime,</if>
<if test="spyj != null and spyj != ''">spyj,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createuserid != null ">createuserid,</if>
<if test="createTime != null ">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="schoolid != null ">#{schoolid},</if>
<if test="classid != null and classid != ''">#{classid},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="startmonth != null ">#{startmonth},</if>
<if test="endmonth != null ">#{endmonth},</if>
<if test="xnxq != null and xnxq != ''">#{xnxq},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="spr != null ">#{spr},</if>
<if test="sptime != null ">#{sptime},</if>
<if test="spyj != null and spyj != ''">#{spyj},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createuserid != null ">#{createuserid},</if>
<if test="createTime != null ">#{createTime},</if>
</trim>
</insert>
<update id="updateByMathTermplan" parameterType="ByMathTermplan">
update by_math_termplan
<trim prefix="SET" suffixOverrides=",">
<if test="schoolid != null ">schoolid = #{schoolid},</if>
<if test="classid != null and classid != ''">classid = #{classid},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="startmonth != null ">startmonth = #{startmonth},</if>
<if test="endmonth != null ">endmonth = #{endmonth},</if>
<if test="xnxq != null and xnxq != ''">xnxq = #{xnxq},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="spr != null ">spr = #{spr},</if>
<if test="sptime != null ">sptime = #{sptime},</if>
<if test="spyj != null and spyj != ''">spyj = #{spyj},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="createuserid != null ">createuserid = #{createuserid},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteByMathTermplanById" parameterType="String">
delete from by_math_termplan where id = #{id}
</delete>
<delete id="deleteByMathTermplanByIds" parameterType="String">
delete from by_math_termplan where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>