4-28 代码提交 完成待前端测试 todo
This commit is contained in:
@@ -1,14 +1,34 @@
|
|||||||
package com.yxt.demo.system.api.sys_forum;
|
package com.yxt.demo.system.api.sys_forum;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:21
|
* @Date 2023/4/24 14:21
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
@Api(tags = "论坛")
|
@Api(tags = "论坛表")
|
||||||
public interface SysForumFeign {
|
public interface SysForumFeign {
|
||||||
|
|
||||||
|
@ApiOperation(value = "添加论坛")
|
||||||
|
@RequestMapping("/saveSysForum")
|
||||||
|
ResultBean saveSysForum(@RequestBody SysForum sysForum);
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除论坛")
|
||||||
|
@RequestMapping("/deleteSysForum/{sid}")
|
||||||
|
ResultBean deleteSysForum(@PathVariable String sid);
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改论坛")
|
||||||
|
@RequestMapping("/alterSysForum")
|
||||||
|
ResultBean alterSysForum(@RequestBody SysForum sysForum);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询论坛")
|
||||||
|
@RequestMapping("/selectSysForum")
|
||||||
|
ResultBean selectSysForum();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,34 @@
|
|||||||
package com.yxt.demo.system.api.sys_forum_comment;
|
package com.yxt.demo.system.api.sys_forum_comment;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:22
|
* @Date 2023/4/24 14:22
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
@Api(tags = "论坛评论")
|
@Api(tags = "论坛评论表")
|
||||||
public interface SysForumCommentFeign {
|
public interface SysForumCommentFeign {
|
||||||
|
|
||||||
|
@ApiOperation(value = "添加论坛评论")
|
||||||
|
@RequestMapping("/saveSysForumComment")
|
||||||
|
ResultBean saveSysForumComment(@RequestBody SysForumComment sysForumComment);
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除论坛评论")
|
||||||
|
@RequestMapping("/deleteSysForumComment/{sid}")
|
||||||
|
ResultBean deleteSysForumComment(@PathVariable String sid);
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改论坛评论")
|
||||||
|
@RequestMapping("/alterSysForumComment")
|
||||||
|
ResultBean alterSysForumComment(@RequestBody SysForumComment sysForumComment);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询论坛评论")
|
||||||
|
@RequestMapping("/selectSysForumComment")
|
||||||
|
ResultBean selectSysForumComment();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import lombok.Data;
|
|||||||
public class SysInfo extends BaseEntity {
|
public class SysInfo extends BaseEntity {
|
||||||
private static final long serialVersionUID = -6222893927885655368L;
|
private static final long serialVersionUID = -6222893927885655368L;
|
||||||
|
|
||||||
|
@ApiModelProperty("sid")
|
||||||
|
private String sid;
|
||||||
@ApiModelProperty("用户sid")
|
@ApiModelProperty("用户sid")
|
||||||
private String userSid;
|
private String userSid;
|
||||||
@ApiModelProperty("学号、工号")
|
@ApiModelProperty("学号、工号")
|
||||||
|
|||||||
@@ -9,10 +9,8 @@ import com.yxt.demo.system.utils.ResultBean;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
@@ -30,9 +28,13 @@ public interface SysInfoFeign {
|
|||||||
@RequestMapping("/selectInfo")
|
@RequestMapping("/selectInfo")
|
||||||
ResultBean selectInfoOne(@RequestBody SysInfoPageCount sysInfoPageCount);
|
ResultBean selectInfoOne(@RequestBody SysInfoPageCount sysInfoPageCount);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询基本信息")
|
||||||
|
@RequestMapping("/selectInfoList")
|
||||||
|
ResultBean selectInfoList(@RequestBody String type);
|
||||||
|
|
||||||
@ApiOperation(value = "删除基本信息")
|
@ApiOperation(value = "删除基本信息")
|
||||||
@RequestMapping("/deleteInfo")
|
@RequestMapping("/deleteInfo/{sid}")
|
||||||
ResultBean deleteInfo(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
ResultBean deleteInfo(@PathVariable String sid);
|
||||||
|
|
||||||
@ApiOperation(value = "添加基本信息")
|
@ApiOperation(value = "添加基本信息")
|
||||||
@RequestMapping("/saveInfo")
|
@RequestMapping("/saveInfo")
|
||||||
|
|||||||
@@ -15,4 +15,7 @@ public class SysInfoPageCount {
|
|||||||
private Integer from;
|
private Integer from;
|
||||||
@ApiModelProperty(value = "显示条数")
|
@ApiModelProperty(value = "显示条数")
|
||||||
private Integer to;
|
private Integer to;
|
||||||
|
@ApiModelProperty(value = "学生还是教师")
|
||||||
|
private String studentAndTeacher;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,4 +20,12 @@ public class SysInfoShip extends BaseEntity {
|
|||||||
private String studentNo;
|
private String studentNo;
|
||||||
@ApiModelProperty("学生")
|
@ApiModelProperty("学生")
|
||||||
private String studentName;
|
private String studentName;
|
||||||
|
@ApiModelProperty("入学时间")
|
||||||
|
private String studyYear;
|
||||||
|
@ApiModelProperty("类别")
|
||||||
|
private String department;
|
||||||
|
@ApiModelProperty("专业")
|
||||||
|
private String speciality;
|
||||||
|
@ApiModelProperty("班级")
|
||||||
|
private String calss;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public interface SysInfoShipFeign {
|
|||||||
|
|
||||||
@ApiOperation(value = "删除教师学生关联")
|
@ApiOperation(value = "删除教师学生关联")
|
||||||
@RequestMapping("/deleteSysInfoShip/{sid}")
|
@RequestMapping("/deleteSysInfoShip/{sid}")
|
||||||
ResultBean deleteSysInfoShip(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
ResultBean deleteSysInfoShip(@PathVariable String sid);
|
||||||
|
|
||||||
@ApiOperation(value = "修改教师学生关联")
|
@ApiOperation(value = "修改教师学生关联")
|
||||||
@RequestMapping("alterSysInfoShip")
|
@RequestMapping("alterSysInfoShip")
|
||||||
@@ -33,4 +33,8 @@ public interface SysInfoShipFeign {
|
|||||||
@ApiOperation(value = "查询教师学生关联")
|
@ApiOperation(value = "查询教师学生关联")
|
||||||
@RequestMapping("/selectSysInfoShip")
|
@RequestMapping("/selectSysInfoShip")
|
||||||
ResultBean selectSysInfoShip();
|
ResultBean selectSysInfoShip();
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询该老师下的学生")
|
||||||
|
@RequestMapping("/selectTeacherDownStudent/{teacher}")
|
||||||
|
ResultBean selectTeacherDownStudent(@PathVariable String teacher);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ public interface SysMenuRoleFeign {
|
|||||||
ResultBean addSysMenuRole(@RequestBody SysMenuRole sysMenuRole);
|
ResultBean addSysMenuRole(@RequestBody SysMenuRole sysMenuRole);
|
||||||
|
|
||||||
@ApiOperation(value = "删除给菜单设置的权限")
|
@ApiOperation(value = "删除给菜单设置的权限")
|
||||||
@RequestMapping("/deleteSysMenuRole")
|
@RequestMapping("/deleteSysMenuRole/{sid}")
|
||||||
ResultBean deleteSysMenuRole(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
ResultBean deleteSysMenuRole(@PathVariable String sid);
|
||||||
|
|
||||||
@ApiOperation(value = "修改菜单角色")
|
@ApiOperation(value = "修改菜单角色")
|
||||||
@RequestMapping("/alterSysMenuRole")
|
@RequestMapping("/alterSysMenuRole")
|
||||||
|
|||||||
@@ -1,12 +1,33 @@
|
|||||||
package com.yxt.demo.system.api.sys_notice;
|
package com.yxt.demo.system.api.sys_notice;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:23
|
* @Date 2023/4/24 14:23
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
@Api(tags = "公告")
|
@Api(tags = "公告表")
|
||||||
public interface SysNoticeFeign {
|
public interface SysNoticeFeign {
|
||||||
|
|
||||||
|
@ApiOperation(value = "增加公告")
|
||||||
|
@RequestMapping("/saveSysNotice")
|
||||||
|
ResultBean saveSysNotice(@RequestBody SysNotice sysNotice);
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除公告")
|
||||||
|
@RequestMapping("/deleteSysNotice/{sid}")
|
||||||
|
ResultBean deleteSysNotice(@PathVariable String sid);
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改公告")
|
||||||
|
@RequestMapping("/alterSysNotice")
|
||||||
|
ResultBean alterSysNotice(@RequestBody SysNotice sysNotice);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询公告")
|
||||||
|
@RequestMapping("/selectSysNotice")
|
||||||
|
ResultBean selectSysNotice();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ import com.yxt.demo.system.api.sys_user.SysUserDto;
|
|||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
@@ -16,10 +19,14 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
public interface SysPlanScheduleFeign {
|
public interface SysPlanScheduleFeign {
|
||||||
|
|
||||||
@ApiOperation(value = "修改自主学习计划进度")
|
@ApiOperation(value = "修改自主学习计划进度")
|
||||||
@PostMapping("/alterSysPlanSchedule")
|
@RequestMapping("/alterSysPlanSchedule")
|
||||||
ResultBean alterSysPlanSchedule(@RequestBody SysPlanSchedule sysPlanSchedule);
|
ResultBean alterSysPlanSchedule(@RequestBody SysPlanSchedule sysPlanSchedule);
|
||||||
|
|
||||||
// @ApiOperation(value = "添加自主学习计划进度")
|
@ApiOperation(value = "添加/修改 自主学习计划进度")
|
||||||
// @PostMapping("/alterSysPlanSchedule")
|
@RequestMapping("/saveSysPlanSchedule")
|
||||||
// ResultBean
|
ResultBean saveSysPlanSchedule(@RequestBody SysPlanSchedule sysPlanSchedule);
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除自主学习计划进度")
|
||||||
|
@RequestMapping("/deleteSysPlanSchedule/{sid}")
|
||||||
|
ResultBean deleteSysPlanSchedule(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public interface SysRoleFeign {
|
|||||||
|
|
||||||
@ApiOperation(value = "查询角色")
|
@ApiOperation(value = "查询角色")
|
||||||
@PostMapping("/RoleOne/{sid}")
|
@PostMapping("/RoleOne/{sid}")
|
||||||
ResultBean RoleOne(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
ResultBean RoleOne(@PathVariable String sid);
|
||||||
|
|
||||||
@ApiOperation(value = "查询多角色")
|
@ApiOperation(value = "查询多角色")
|
||||||
@PostMapping("/RoleOne")
|
@PostMapping("/RoleOne")
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ public interface SysStudentScoreFeign {
|
|||||||
ResultBean addStudentScore(@RequestBody SysStudentScore sysStudentScore);
|
ResultBean addStudentScore(@RequestBody SysStudentScore sysStudentScore);
|
||||||
|
|
||||||
@ApiOperation(value = "删除学生成绩")
|
@ApiOperation(value = "删除学生成绩")
|
||||||
@RequestMapping("/deleteStudentScore")
|
@RequestMapping("/deleteStudentScore/{sid}")
|
||||||
ResultBean deleteStudentScore(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
ResultBean deleteStudentScore(@PathVariable String sid);
|
||||||
|
|
||||||
@ApiOperation(value = "修改学生成绩")
|
@ApiOperation(value = "修改学生成绩")
|
||||||
@RequestMapping("/alterStudentScore")
|
@RequestMapping("/alterStudentScore")
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.yxt.demo.system.api.sys_user;
|
|||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -27,4 +28,8 @@ public interface SysUserFeign {
|
|||||||
@ApiOperation(value = "修改密码")
|
@ApiOperation(value = "修改密码")
|
||||||
@RequestMapping("/alterPassword")
|
@RequestMapping("/alterPassword")
|
||||||
ResultBean alterPassword(@RequestBody SysUser sysUser);
|
ResultBean alterPassword(@RequestBody SysUser sysUser);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询个人信息")
|
||||||
|
@RequestMapping("/selectUserInfo/{sid}")
|
||||||
|
ResultBean selectUserInfo(@PathVariable String sid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package com.yxt.demo.system.biz.sys_forum;
|
package com.yxt.demo.system.biz.sys_forum;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yxt.demo.system.api.sys_forum.SysForum;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:21
|
* @Date 2023/4/24 14:21
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysForumMapper {
|
public interface SysForumMapper extends BaseMapper<SysForum> {
|
||||||
|
List<SysForum> selectSysForumList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?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" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.yxt.demo.system.biz.sys_forum.SysForumMapper">
|
<mapper namespace="com.yxt.demo.system.biz.sys_forum.SysForumMapper">
|
||||||
|
<select id="selectSysForumList" resultType="com.yxt.demo.system.api.sys_forum.SysForum">
|
||||||
|
select * from sys_forum
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,9 +1,48 @@
|
|||||||
package com.yxt.demo.system.biz.sys_forum;
|
package com.yxt.demo.system.biz.sys_forum;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_forum.SysForum;
|
||||||
|
import com.yxt.demo.system.api.sys_forum.SysForumFeign;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:21
|
* @Date 2023/4/24 14:21
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public class SysForumRest {
|
@Api(tags = "论坛表")
|
||||||
|
@RequestMapping("v1/sysforum")
|
||||||
|
@RestController
|
||||||
|
public class SysForumRest implements SysForumFeign {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysForumService sysForumService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean saveSysForum(SysForum sysForum) {
|
||||||
|
return sysForumService.saveSysForum(sysForum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean deleteSysForum(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int i = sysForumService.deleteBySid(sid);
|
||||||
|
if (i == 0){
|
||||||
|
return rb.setMsg("删除失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean alterSysForum(SysForum sysForum) {
|
||||||
|
return sysForumService.alterSysForum(sysForum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectSysForum() {
|
||||||
|
return sysForumService.selectSysForum();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,47 @@
|
|||||||
package com.yxt.demo.system.biz.sys_forum;
|
package com.yxt.demo.system.biz.sys_forum;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_forum.SysForum;
|
||||||
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:21
|
* @Date 2023/4/24 14:21
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public class SysForumService {
|
@Service
|
||||||
|
public class SysForumService extends MybatisBaseService<SysForumMapper, SysForum> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysForumMapper sysForumMapper;
|
||||||
|
|
||||||
|
public ResultBean saveSysForum(SysForum sysForum) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int insert = sysForumMapper.insert(sysForum);
|
||||||
|
if (insert == 0){
|
||||||
|
return rb.setMsg("添加失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean alterSysForum(SysForum sysForum) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
sysForum.setModifyTime(new Date());
|
||||||
|
int i = baseMapper.updateById(sysForum);
|
||||||
|
if (i == 0){
|
||||||
|
return rb.setMsg("修改失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean selectSysForum() {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<SysForum> sysForums = sysForumMapper.selectSysForumList();
|
||||||
|
return rb.success().setData(sysForums);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
package com.yxt.demo.system.biz.sys_forum_comment;
|
package com.yxt.demo.system.biz.sys_forum_comment;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yxt.demo.system.api.sys_forum_comment.SysForumComment;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:22
|
* @Date 2023/4/24 14:22
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public interface SysForumCommentMapper {
|
@Mapper
|
||||||
|
public interface SysForumCommentMapper extends BaseMapper<SysForumComment> {
|
||||||
|
List<SysForumComment> selectSysForumCommentList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?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" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.yxt.demo.system.biz.sys_forum_comment.SysForumCommentMapper">
|
<mapper namespace="com.yxt.demo.system.biz.sys_forum_comment.SysForumCommentMapper">
|
||||||
|
<select id="selectSysForumCommentList" resultType="com.yxt.demo.system.api.sys_forum_comment.SysForumComment">
|
||||||
|
select * from sys_forum_comment
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,9 +1,50 @@
|
|||||||
package com.yxt.demo.system.biz.sys_forum_comment;
|
package com.yxt.demo.system.biz.sys_forum_comment;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_forum.SysForum;
|
||||||
|
import com.yxt.demo.system.api.sys_forum.SysForumFeign;
|
||||||
|
import com.yxt.demo.system.api.sys_forum_comment.SysForumComment;
|
||||||
|
import com.yxt.demo.system.api.sys_forum_comment.SysForumCommentFeign;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:22
|
* @Date 2023/4/24 14:22
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public class SysForumCommentRest {
|
@Api(tags = "论坛评论表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("v1/sysforumcommen")
|
||||||
|
public class SysForumCommentRest implements SysForumCommentFeign {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysForumCommentService sysForumCommentService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean saveSysForumComment(SysForumComment sysForumComment) {
|
||||||
|
return sysForumCommentService.saveSysForumComment(sysForumComment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean deleteSysForumComment(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int i = sysForumCommentService.deleteBySid(sid);
|
||||||
|
if (i == 0){
|
||||||
|
return rb.setMsg("删除失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean alterSysForumComment(SysForumComment sysForumComment) {
|
||||||
|
return sysForumCommentService.alterSysForumComment(sysForumComment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectSysForumComment() {
|
||||||
|
return sysForumCommentService.selectSysForumComment();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,49 @@
|
|||||||
package com.yxt.demo.system.biz.sys_forum_comment;
|
package com.yxt.demo.system.biz.sys_forum_comment;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_forum.SysForum;
|
||||||
|
import com.yxt.demo.system.api.sys_forum_comment.SysForumComment;
|
||||||
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:22
|
* @Date 2023/4/24 14:22
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public class SysForumCommentService {
|
@Service
|
||||||
|
public class SysForumCommentService extends MybatisBaseService<SysForumCommentMapper, SysForumComment> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysForumCommentMapper sysForumCommentMapper;
|
||||||
|
|
||||||
|
public ResultBean saveSysForumComment(SysForumComment sysForumComment) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int insert = sysForumCommentMapper.insert(sysForumComment);
|
||||||
|
if (insert == 0){
|
||||||
|
return rb.setMsg("添加失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean alterSysForumComment(SysForumComment sysForumComment) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int i = sysForumCommentMapper.updateById(sysForumComment);
|
||||||
|
if (i == 0){
|
||||||
|
return rb.setMsg("修改失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean selectSysForumComment() {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<SysForumComment> sysForumComments = sysForumCommentMapper.selectSysForumCommentList();
|
||||||
|
if (sysForumComments == null){
|
||||||
|
return rb.setMsg("查询失败");
|
||||||
|
}
|
||||||
|
return rb.success().setData(sysForumComments);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ public interface SysInfoMapper extends BaseMapper<SysInfo> {
|
|||||||
|
|
||||||
SysInfo selectStudentBySid(SysInfoPageCount sysInfoPageCount);
|
SysInfo selectStudentBySid(SysInfoPageCount sysInfoPageCount);
|
||||||
|
|
||||||
List<SysInfo> selectInfoList(SysInfoPageCount sysInfoPageCount);
|
List<SysInfo> selectInfoStudentList();
|
||||||
|
|
||||||
|
List<SysInfo> selectInfoTeacherList();
|
||||||
|
|
||||||
SysInfo selectBySid(@Param("sid") String sid);
|
SysInfo selectBySid(@Param("sid") String sid);
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,12 @@
|
|||||||
where i.userSid = #{sid} limit #{from},#{to}
|
where i.userSid = #{sid} limit #{from},#{to}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectInfoList" resultType="com.yxt.demo.system.api.sys_info.SysInfo" parameterType="com.yxt.demo.system.api.sys_info.SysInfoPageCount">
|
<select id="selectInfoStudentList" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
select i.id,i.userSid,i.infoId,u.userName,u.password,i.name,i.sex,i.studyYear,i.department,i.speciality,i.calss
|
select * from sys_info where infoId like "%xs%"
|
||||||
from sys_info i
|
</select>
|
||||||
left join sys_user u
|
|
||||||
on i.userSid = u.sid limit #{from},#{to}
|
<select id="selectInfoTeacherList" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
|
select * from sys_info where infoId like "%js%"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBySid" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
<select id="selectBySid" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ public class SysInfoRest implements SysInfoFeign {
|
|||||||
return sysInfoService.selectInfoOne(sysInfoPageCount);
|
return sysInfoService.selectInfoOne(sysInfoPageCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectInfoList(String type) {
|
||||||
|
return sysInfoService.selectInfoList(type);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultBean deleteInfo(String sid) {
|
public ResultBean deleteInfo(String sid) {
|
||||||
return sysInfoService.deleteInfoBySid(sid);
|
return sysInfoService.deleteInfoBySid(sid);
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserMapper sysUserMapper;
|
private SysUserMapper sysUserMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysInfoMapper sysInfoMapper;
|
||||||
|
|
||||||
public SysInfo selectByNoAndName(String userName, String name) {
|
public SysInfo selectByNoAndName(String userName, String name) {
|
||||||
return baseMapper.selectByNoAndName(userName, name);
|
return baseMapper.selectByNoAndName(userName, name);
|
||||||
@@ -43,6 +45,20 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
return rb.success().setData(sysInfo);
|
return rb.success().setData(sysInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultBean selectInfoList(String type) {
|
||||||
|
ResultBean objectResultBean = ResultBean.fireFail();
|
||||||
|
List<SysInfo> sysInfos = null;
|
||||||
|
if (type != null){
|
||||||
|
if (type.equals("xs")){
|
||||||
|
sysInfos = sysInfoMapper.selectInfoStudentList();
|
||||||
|
}else if (type.equals("js")){
|
||||||
|
sysInfos = sysInfoMapper.selectInfoTeacherList();
|
||||||
|
}
|
||||||
|
return objectResultBean.success().setData(sysInfos);
|
||||||
|
}
|
||||||
|
return objectResultBean;
|
||||||
|
}
|
||||||
|
|
||||||
public ResultBean deleteInfoBySid(String sid){
|
public ResultBean deleteInfoBySid(String sid){
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
SysInfo sysInfo = baseMapper.selectBySid(sid);
|
SysInfo sysInfo = baseMapper.selectBySid(sid);
|
||||||
@@ -53,18 +69,23 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
|
|
||||||
public ResultBean saveInfo(SysInfo sysInfo){
|
public ResultBean saveInfo(SysInfo sysInfo){
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
SysUser sysUser = sysUserMapper.selectByNameAndUserName(sysInfo.getInfoId(), sysInfo.getName());
|
if (sysInfo.getInfoId().contains("xs") || sysInfo.getInfoId().contains("js")){
|
||||||
if (sysUser != null){
|
SysUser sysUser = sysUserMapper.selectByNameAndUserName(sysInfo.getInfoId(), sysInfo.getName());
|
||||||
sysInfo.setUserSid(sysUser.getSid());
|
if (sysUser != null){
|
||||||
baseMapper.insert(sysInfo);
|
sysInfo.setUserSid(sysUser.getSid());
|
||||||
sysUser.setInfoSid(sysInfo.getSid());
|
baseMapper.insert(sysInfo);
|
||||||
sysUser.setModifyTime(new Date());
|
sysUser.setInfoSid(sysInfo.getSid());
|
||||||
sysUserMapper.updateById(sysUser);
|
sysUser.setModifyTime(new Date());
|
||||||
return rb.success();
|
sysUserMapper.updateById(sysUser);
|
||||||
|
return rb.success();
|
||||||
|
}else {
|
||||||
|
baseMapper.insert(sysInfo);
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
baseMapper.insert(sysInfo);
|
return rb.setMsg("学号格式不正确!!!");
|
||||||
return rb.success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.yxt.demo.system.biz.sys_info_ship;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -14,4 +15,6 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface SysInfoShipMapper extends BaseMapper<SysInfoShip> {
|
public interface SysInfoShipMapper extends BaseMapper<SysInfoShip> {
|
||||||
List<SysInfoShip> selectSysInfoShipList();
|
List<SysInfoShip> selectSysInfoShipList();
|
||||||
|
|
||||||
|
List<SysInfoShip> selectTeacherDownStudent(@Param("teacher") String teacher);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,10 @@
|
|||||||
<select id="selectSysInfoShipList" resultType="com.yxt.demo.system.api.sys_info_ship.SysInfoShip">
|
<select id="selectSysInfoShipList" resultType="com.yxt.demo.system.api.sys_info_ship.SysInfoShip">
|
||||||
select * from sys_info_ship
|
select * from sys_info_ship
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTeacherDownStudent" resultType="com.yxt.demo.system.api.sys_info_ship.SysInfoShip">
|
||||||
|
select s.id,s.sid,s.StudentNo,s.studentName,i.sex,i.studyYear,i.department,i.speciality,i.calss from sys_info_ship s
|
||||||
|
left join sys_info i on s.StudentNo = i.infoId
|
||||||
|
where s.teacherNo = #{teacher}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -44,4 +44,9 @@ public class SysInfoShipRest implements SysInfoShipFeign {
|
|||||||
public ResultBean selectSysInfoShip() {
|
public ResultBean selectSysInfoShip() {
|
||||||
return sysInfoShipService.selectSysInfoShip();
|
return sysInfoShipService.selectSysInfoShip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectTeacherDownStudent(String teacher) {
|
||||||
|
return sysInfoShipService.selectTeacherDownStudent(teacher);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,4 +44,13 @@ public class SysInfoShipService extends MybatisBaseService<SysInfoShipMapper, Sy
|
|||||||
List<SysInfoShip> sysInfoShips = sysInfoShipMapper.selectSysInfoShipList();
|
List<SysInfoShip> sysInfoShips = sysInfoShipMapper.selectSysInfoShipList();
|
||||||
return rb.success().setData(sysInfoShips);
|
return rb.success().setData(sysInfoShips);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultBean selectTeacherDownStudent(String teacher) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List list = sysInfoShipMapper.selectTeacherDownStudent(teacher);
|
||||||
|
if(list.size() == 0){
|
||||||
|
return rb.success().setMsg("该老师没有学生");
|
||||||
|
}
|
||||||
|
return rb.success().setData(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package com.yxt.demo.system.biz.sys_notice;
|
package com.yxt.demo.system.biz.sys_notice;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yxt.demo.system.api.sys_notice.SysNotice;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:14
|
* @Date 2023/4/24 14:14
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysNoticeMapper {
|
public interface SysNoticeMapper extends BaseMapper<SysNotice> {
|
||||||
|
List<SysNotice> selectSysNoticeList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?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" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.yxt.demo.system.biz.sys_notice.SysNoticeMapper">
|
<mapper namespace="com.yxt.demo.system.biz.sys_notice.SysNoticeMapper">
|
||||||
|
<select id="selectSysNoticeList" resultType="com.yxt.demo.system.api.sys_notice.SysNotice">
|
||||||
|
select * from sys_notice
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,9 +1,48 @@
|
|||||||
package com.yxt.demo.system.biz.sys_notice;
|
package com.yxt.demo.system.biz.sys_notice;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_notice.SysNotice;
|
||||||
|
import com.yxt.demo.system.api.sys_notice.SysNoticeFeign;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:23
|
* @Date 2023/4/24 14:23
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public class SysNoticeRest {
|
@Api(tags = "公告表")
|
||||||
|
@RequestMapping("v1/sysnatic")
|
||||||
|
@RestController
|
||||||
|
public class SysNoticeRest implements SysNoticeFeign {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysNoticeService sysNoticeService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean saveSysNotice(SysNotice sysNotice) {
|
||||||
|
return sysNoticeService.saveSysNotice(sysNotice);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean deleteSysNotice(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int i = sysNoticeService.deleteBySid(sid);
|
||||||
|
if (i == 0){
|
||||||
|
return rb.setMsg("删除失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean alterSysNotice(SysNotice sysNotice) {
|
||||||
|
return sysNoticeService.alterSysNotice(sysNotice);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectSysNotice() {
|
||||||
|
return sysNoticeService.selectSysNotice();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,47 @@
|
|||||||
package com.yxt.demo.system.biz.sys_notice;
|
package com.yxt.demo.system.biz.sys_notice;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_notice.SysNotice;
|
||||||
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:13
|
* @Date 2023/4/24 14:13
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysNoticeService {
|
public class SysNoticeService extends MybatisBaseService<SysNoticeMapper, SysNotice> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysNoticeMapper sysNoticeMapper;
|
||||||
|
|
||||||
|
public ResultBean saveSysNotice(SysNotice sysNotice) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int insert = baseMapper.insert(sysNotice);
|
||||||
|
if (insert == 0){
|
||||||
|
return rb.setMsg("添加失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean alterSysNotice(SysNotice sysNotice) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
sysNotice.setModifyTime(new Date());
|
||||||
|
int i = baseMapper.updateById(sysNotice);
|
||||||
|
if (i == 0){
|
||||||
|
return rb.setMsg("修改失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean selectSysNotice() {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<SysNotice> sysNotices = sysNoticeMapper.selectSysNoticeList();
|
||||||
|
return rb.success().setData(sysNotices);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.yxt.demo.system.biz.sys_plan;
|
|||||||
|
|
||||||
import com.yxt.demo.system.api.sys_plan.SysPlan;
|
import com.yxt.demo.system.api.sys_plan.SysPlan;
|
||||||
import com.yxt.demo.system.api.sys_plan.SysPlanFeign;
|
import com.yxt.demo.system.api.sys_plan.SysPlanFeign;
|
||||||
|
import com.yxt.demo.system.biz.sys_plan_schedule.SysPlanScheduleRest;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -20,6 +21,8 @@ public class SysPlanRest implements SysPlanFeign {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPlanService sysPlanService;
|
private SysPlanService sysPlanService;
|
||||||
|
@Autowired
|
||||||
|
private SysPlanScheduleRest sysPlanScheduleRest;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultBean saveSysPlan(SysPlan sysPlan) {
|
public ResultBean saveSysPlan(SysPlan sysPlan) {
|
||||||
@@ -30,6 +33,7 @@ public class SysPlanRest implements SysPlanFeign {
|
|||||||
public ResultBean deleteSysPlan(String sid) {
|
public ResultBean deleteSysPlan(String sid) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
int i = sysPlanService.deleteBySid(sid);
|
int i = sysPlanService.deleteBySid(sid);
|
||||||
|
sysPlanScheduleRest.deleteSysPlanSchedule(sid);
|
||||||
if (i == 0){
|
if (i == 0){
|
||||||
return rb.setMsg("删除失败");
|
return rb.setMsg("删除失败");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.yxt.demo.system.biz.sys_plan;
|
package com.yxt.demo.system.biz.sys_plan;
|
||||||
|
|
||||||
import com.yxt.demo.system.api.sys_plan.SysPlan;
|
import com.yxt.demo.system.api.sys_plan.SysPlan;
|
||||||
|
import com.yxt.demo.system.api.sys_plan_schedule.SysPlanSchedule;
|
||||||
|
import com.yxt.demo.system.biz.sys_plan_schedule.SysPlanScheduleService;
|
||||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -18,6 +20,8 @@ public class SysPlanService extends MybatisBaseService<SysPlanMapper, SysPlan> {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPlanMapper sysPlanMapper;
|
private SysPlanMapper sysPlanMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysPlanScheduleService sysPlanScheduleService;
|
||||||
|
|
||||||
public ResultBean saveSysPlan(SysPlan sysPlan){
|
public ResultBean saveSysPlan(SysPlan sysPlan){
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
@@ -25,6 +29,9 @@ public class SysPlanService extends MybatisBaseService<SysPlanMapper, SysPlan> {
|
|||||||
if (insert == 0){
|
if (insert == 0){
|
||||||
return rb.setMsg("添加失败");
|
return rb.setMsg("添加失败");
|
||||||
}
|
}
|
||||||
|
SysPlanSchedule sysPlanSchedule = new SysPlanSchedule();
|
||||||
|
sysPlanSchedule.setPlanSid(sysPlan.getSid());
|
||||||
|
sysPlanScheduleService.saveSysPlanSchedule(sysPlanSchedule);
|
||||||
return rb.success();
|
return rb.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,4 +11,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysPlanScheduleMapper extends BaseMapper<SysPlanSchedule> {
|
public interface SysPlanScheduleMapper extends BaseMapper<SysPlanSchedule> {
|
||||||
|
void updateSysPlanScheduleBySid(SysPlanSchedule sysPlanSchedule);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?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" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.yxt.demo.system.biz.sys_plan_schedule.SysPlanScheduleMapper">
|
<mapper namespace="com.yxt.demo.system.biz.sys_plan_schedule.SysPlanScheduleMapper">
|
||||||
|
<update id="updateSysPlanScheduleBySid" parameterType="com.yxt.demo.system.api.sys_plan_schedule.SysPlanSchedule">
|
||||||
|
update sys_plan_schedule
|
||||||
|
<set>
|
||||||
|
<if test="planContent != null">
|
||||||
|
planContent = #{planContent},
|
||||||
|
</if>
|
||||||
|
<if test="planOpinion != null">
|
||||||
|
planOpinion=#{planOpinion},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where planSid=#{planSid}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -25,4 +25,19 @@ public class SysPlanScheduleRest implements SysPlanScheduleFeign{
|
|||||||
public ResultBean alterSysPlanSchedule(SysPlanSchedule sysPlanSchedule) {
|
public ResultBean alterSysPlanSchedule(SysPlanSchedule sysPlanSchedule) {
|
||||||
return sysPlanScheduleService.alterSysPlanSchedule(sysPlanSchedule);
|
return sysPlanScheduleService.alterSysPlanSchedule(sysPlanSchedule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean saveSysPlanSchedule(SysPlanSchedule sysPlanSchedule) {
|
||||||
|
return sysPlanScheduleService.updateSysPlanSchedule(sysPlanSchedule);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean deleteSysPlanSchedule(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int i = sysPlanScheduleService.deleteBySid(sid);
|
||||||
|
if (i == 0){
|
||||||
|
return rb.setMsg("删除失败");
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.yxt.demo.system.biz.sys_plan_schedule;
|
|||||||
import com.yxt.demo.system.api.sys_plan_schedule.SysPlanSchedule;
|
import com.yxt.demo.system.api.sys_plan_schedule.SysPlanSchedule;
|
||||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -15,6 +16,8 @@ import java.util.Date;
|
|||||||
@Service
|
@Service
|
||||||
public class SysPlanScheduleService extends MybatisBaseService<SysPlanScheduleMapper, SysPlanSchedule> {
|
public class SysPlanScheduleService extends MybatisBaseService<SysPlanScheduleMapper, SysPlanSchedule> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysPlanScheduleMapper sysPlanScheduleMapper;
|
||||||
|
|
||||||
public ResultBean alterSysPlanSchedule(SysPlanSchedule sysPlanSchedule){
|
public ResultBean alterSysPlanSchedule(SysPlanSchedule sysPlanSchedule){
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
@@ -26,6 +29,13 @@ public class SysPlanScheduleService extends MybatisBaseService<SysPlanScheduleMa
|
|||||||
return rb.success();
|
return rb.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveSysPlanSchedule(){
|
public void saveSysPlanSchedule(SysPlanSchedule sysPlanSchedule){
|
||||||
|
baseMapper.insert(sysPlanSchedule);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean updateSysPlanSchedule(SysPlanSchedule sysPlanSchedule) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
sysPlanScheduleMapper.updateSysPlanScheduleBySid(sysPlanSchedule);
|
||||||
|
return rb.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
|||||||
void deleteUserBySid(@Param("sid") String sid);
|
void deleteUserBySid(@Param("sid") String sid);
|
||||||
|
|
||||||
SysUser selectByNameAndUserName(@Param("userName") String userName, @Param("name") String name);
|
SysUser selectByNameAndUserName(@Param("userName") String userName, @Param("name") String name);
|
||||||
|
|
||||||
|
SysUser selectUserInfo(@Param("sid") String sid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,4 +14,10 @@
|
|||||||
<select id="selectByNameAndUserName" resultType="com.yxt.demo.system.api.sys_user.SysUser">
|
<select id="selectByNameAndUserName" resultType="com.yxt.demo.system.api.sys_user.SysUser">
|
||||||
select * from sys_user where userName = #{userName} and name = #{name}
|
select * from sys_user where userName = #{userName} and name = #{name}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectUserInfo" resultType="com.yxt.demo.system.api.sys_user.SysUser">
|
||||||
|
select u.id,u.sid,u.name,u.userName,u.password,u.nickName,i.sex,i.studyYear,i.department,i.speciality,i.calss from sys_info i
|
||||||
|
left join sys_user u on u.sid = i.userSid
|
||||||
|
where u.sid = #{sid}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -37,4 +37,9 @@ public class SysUserRest implements SysUserFeign {
|
|||||||
public ResultBean alterPassword(SysUser sysUser){
|
public ResultBean alterPassword(SysUser sysUser){
|
||||||
return sysUserService.alterPassword(sysUser);
|
return sysUserService.alterPassword(sysUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectUserInfo(String sid) {
|
||||||
|
return sysUserService.selectUserInfo(sid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,43 +29,47 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
|
|
||||||
public ResultBean register(SysUserDto dto) {
|
public ResultBean register(SysUserDto dto) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
//密码和确认密码是否相同
|
if (dto.getUserName().contains("xs") || dto.getUserName().contains("js")){
|
||||||
if(!dto.getPassword().equals(dto.getConfirmPassword())){
|
//密码和确认密码是否相同
|
||||||
return rb.setMsg("密码和确认密码不一致");
|
if(!dto.getPassword().equals(dto.getConfirmPassword())){
|
||||||
}
|
return rb.setMsg("密码和确认密码不一致");
|
||||||
//验证学号+姓名是否存在
|
}
|
||||||
String userName = dto.getUserName();
|
//验证学号+姓名是否存在
|
||||||
String name = dto.getName();
|
String userName = dto.getUserName();
|
||||||
SysInfo sysInfo = sysInfoService.selectByNoAndName(userName, name);
|
String name = dto.getName();
|
||||||
if (sysInfo != null) {
|
SysInfo sysInfo = sysInfoService.selectByNoAndName(userName, name);
|
||||||
|
if (sysInfo != null) {
|
||||||
// return rb.setMsg("学号或姓名错误");
|
// return rb.setMsg("学号或姓名错误");
|
||||||
//查看该账号是否已激活
|
//查看该账号是否已激活
|
||||||
SysUser sysUser = baseMapper.selectByNo(userName);
|
SysUser sysUser = baseMapper.selectByNo(userName);
|
||||||
if (sysUser != null) {
|
if (sysUser != null) {
|
||||||
if (sysUser.getHasActivated() == 1) {
|
if (sysUser.getHasActivated() == 1) {
|
||||||
return rb.setMsg("该账号已注册");
|
return rb.setMsg("该账号已注册");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
sysUser = new SysUser();
|
||||||
|
BeanUtil.copyProperties(dto, sysUser);
|
||||||
|
sysUser.setPassword(dto.getPassword());
|
||||||
|
sysUser.setInfoSid(sysInfo.getSid());
|
||||||
|
baseMapper.insert(sysUser);
|
||||||
|
sysInfo.setUserSid(sysUser.getSid());
|
||||||
|
sysInfoService.updateById(sysInfo);
|
||||||
|
return rb.success();
|
||||||
|
}else {
|
||||||
|
SysUser sysUser = baseMapper.selectByNo(userName);
|
||||||
|
if (sysUser != null) {
|
||||||
|
if (sysUser.getHasActivated() == 1) {
|
||||||
|
return rb.setMsg("该账号已注册");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sysUser = new SysUser();
|
||||||
|
BeanUtil.copyProperties(dto, sysUser);
|
||||||
|
sysUser.setPassword(dto.getPassword());
|
||||||
|
baseMapper.insert(sysUser);
|
||||||
|
return rb.success();
|
||||||
}
|
}
|
||||||
sysUser = new SysUser();
|
|
||||||
BeanUtil.copyProperties(dto, sysUser);
|
|
||||||
sysUser.setPassword(dto.getPassword());
|
|
||||||
sysUser.setInfoSid(sysInfo.getSid());
|
|
||||||
baseMapper.insert(sysUser);
|
|
||||||
sysInfo.setUserSid(sysUser.getSid());
|
|
||||||
sysInfoService.updateById(sysInfo);
|
|
||||||
return rb.success();
|
|
||||||
}else {
|
}else {
|
||||||
SysUser sysUser = baseMapper.selectByNo(userName);
|
return rb.setMsg("学号格式不正确!!!");
|
||||||
if (sysUser != null) {
|
|
||||||
if (sysUser.getHasActivated() == 1) {
|
|
||||||
return rb.setMsg("该账号已注册");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sysUser = new SysUser();
|
|
||||||
BeanUtil.copyProperties(dto, sysUser);
|
|
||||||
sysUser.setPassword(dto.getPassword());
|
|
||||||
baseMapper.insert(sysUser);
|
|
||||||
return rb.success();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,4 +101,10 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
}
|
}
|
||||||
return rb.setMsg("修改失败,请重试!!!");
|
return rb.setMsg("修改失败,请重试!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultBean selectUserInfo(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
SysUser sysUser = sysUserMapper.selectUserInfo(sid);
|
||||||
|
return rb.success().setData(sysUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user