This commit is contained in:
commit
43217f5f90
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
|
||||
2018年度最受欢迎中国开源软件评选
|
||||
请给若依/RuoYi 投票,谢谢大家。
|
||||
请给云企智联/RuoYi 投票,谢谢大家。
|
||||
https://www.oschina.net/project/top_cn_2018?sort=1
|
||||
|
||||
|
||||
一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
|
||||
一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了云企智联。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
|
||||
|
||||
寓意:你若不离不弃,我必生死相依
|
||||
|
||||
若依基于hplus和inspinia两套后台系统模板开发。有需要可自行到群内下载。
|
||||
云企智联基于hplus和inspinia两套后台系统模板开发。有需要可自行到群内下载。
|
||||
|
||||
> RuoYi从3.0开始,进行模块拆分,将原先的单应用转变为多模块,如需单应用,请移步 [RuoYi-fast](https://gitee.com/y_project/RuoYi-fast)
|
||||
|
||||
|
|
@ -71,6 +71,6 @@ https://www.oschina.net/project/top_cn_2018?sort=1
|
|||
</table>
|
||||
|
||||
|
||||
## 若依交流群
|
||||
## 云企智联交流群
|
||||
|
||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) 点击按钮入群。
|
||||
4
pom.xml
4
pom.xml
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>若依管理系统</description>
|
||||
<description>管理系统</description>
|
||||
|
||||
<properties>
|
||||
<ruoyi.version>3.1</ruoyi.version>
|
||||
|
|
@ -47,6 +47,8 @@
|
|||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-common</module>
|
||||
<module>ruoyi-exam</module>
|
||||
<module>ruoyi-vip</module>
|
||||
<module>ruoyi-train</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@
|
|||
<dependencies>
|
||||
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-->
|
||||
<dependency>
|
||||
|
|
@ -51,6 +51,24 @@
|
|||
<artifactId>ruoyi-exam</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
<!-- 会员系统-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-vip</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
<!-- 培训系统-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-train</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
<!-- 测试生成的代码-->
|
||||
<!--<dependency>-->
|
||||
<!--<groupId>com.ruoyi</groupId>-->
|
||||
<!--<artifactId>ruoyi-test</artifactId>-->
|
||||
<!--<version>${ruoyi.version}</version>-->
|
||||
<!--</dependency>-->
|
||||
<!-- 定时任务
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package com.ruoyi;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import tk.mybatis.spring.annotation.MapperScan;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
|
|
@ -18,7 +18,7 @@ public class RuoYiApplication
|
|||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(RuoYiApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
System.out.println("(♥◠‿◠)ノ゙ 云企智联启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -27,13 +28,12 @@ import com.ruoyi.framework.web.base.BaseController;
|
|||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/user")
|
||||
public class SysUserController extends BaseController
|
||||
{
|
||||
public class SysUserController extends BaseController {
|
||||
private String prefix = "system/user";
|
||||
|
||||
@Autowired
|
||||
|
|
@ -50,40 +50,36 @@ public class SysUserController extends BaseController
|
|||
|
||||
@RequiresPermissions("system:user:view")
|
||||
@GetMapping()
|
||||
public String user()
|
||||
{
|
||||
public String user() {
|
||||
return prefix + "/user";
|
||||
}
|
||||
|
||||
@RequiresPermissions("system:user:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SysUser user)
|
||||
{
|
||||
public TableDataInfo list(SysUser user) {
|
||||
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
List<SysUser> list = userService.selectUserList( user );
|
||||
return getDataTable( list );
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SysUser user)
|
||||
{
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
return util.exportExcel(list, "user");
|
||||
public AjaxResult export(SysUser user) {
|
||||
List<SysUser> list = userService.selectUserList( user );
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>( SysUser.class );
|
||||
return util.exportExcel( list, "user" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap)
|
||||
{
|
||||
mmap.put("roles", roleService.selectRoleAll());
|
||||
mmap.put("posts", postService.selectPostAll());
|
||||
public String add(ModelMap mmap) {
|
||||
mmap.put( "roles", roleService.selectRoleAll() );
|
||||
mmap.put( "posts", postService.selectPostAll() );
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
|
|
@ -95,27 +91,24 @@ public class SysUserController extends BaseController
|
|||
@PostMapping("/add")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(SysUser user)
|
||||
{
|
||||
if (StringUtils.isNotNull(user.getUserId()) && SysUser.isAdmin(user.getUserId()))
|
||||
{
|
||||
return error("不允许修改超级管理员用户");
|
||||
public AjaxResult addSave(SysUser user) {
|
||||
if (StringUtils.isNotNull( user.getUserId() ) && SysUser.isAdmin( user.getUserId() )) {
|
||||
return error( "不允许修改超级管理员用户" );
|
||||
}
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||
user.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(userService.insertUser(user));
|
||||
user.setSalt( ShiroUtils.randomSalt() );
|
||||
user.setPassword( passwordService.encryptPassword( user.getLoginName(), user.getPassword(), user.getSalt() ) );
|
||||
user.setCreateBy( ShiroUtils.getLoginName() );
|
||||
return toAjax( userService.insertUser( user ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@GetMapping("/edit/{userId}")
|
||||
public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("user", userService.selectUserById(userId));
|
||||
mmap.put("roles", roleService.selectRolesByUserId(userId));
|
||||
mmap.put("posts", postService.selectPostsByUserId(userId));
|
||||
public String edit(@PathVariable("userId") Long userId, ModelMap mmap) {
|
||||
mmap.put( "user", userService.selectUserById( userId ) );
|
||||
mmap.put( "roles", roleService.selectRolesByUserId( userId ) );
|
||||
mmap.put( "posts", postService.selectPostsByUserId( userId ) );
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
|
|
@ -127,22 +120,19 @@ public class SysUserController extends BaseController
|
|||
@PostMapping("/edit")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(SysUser user)
|
||||
{
|
||||
if (StringUtils.isNotNull(user.getUserId()) && SysUser.isAdmin(user.getUserId()))
|
||||
{
|
||||
return error("不允许修改超级管理员用户");
|
||||
public AjaxResult editSave(SysUser user) {
|
||||
if (StringUtils.isNotNull( user.getUserId() ) && SysUser.isAdmin( user.getUserId() )) {
|
||||
return error( "不允许修改超级管理员用户" );
|
||||
}
|
||||
user.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(userService.updateUser(user));
|
||||
user.setUpdateBy( ShiroUtils.getLoginName() );
|
||||
return toAjax( userService.updateUser( user ) );
|
||||
}
|
||||
|
||||
@RequiresPermissions("system:user:resetPwd")
|
||||
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/resetPwd/{userId}")
|
||||
public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("user", userService.selectUserById(userId));
|
||||
public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap) {
|
||||
mmap.put( "user", userService.selectUserById( userId ) );
|
||||
return prefix + "/resetPwd";
|
||||
}
|
||||
|
||||
|
|
@ -150,26 +140,21 @@ public class SysUserController extends BaseController
|
|||
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/resetPwd")
|
||||
@ResponseBody
|
||||
public AjaxResult resetPwdSave(SysUser user)
|
||||
{
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||
return toAjax(userService.resetUserPwd(user));
|
||||
public AjaxResult resetPwdSave(SysUser user) {
|
||||
user.setSalt( ShiroUtils.randomSalt() );
|
||||
user.setPassword( passwordService.encryptPassword( user.getLoginName(), user.getPassword(), user.getSalt() ) );
|
||||
return toAjax( userService.resetUserPwd( user ) );
|
||||
}
|
||||
|
||||
@RequiresPermissions("system:user:remove")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
return toAjax(userService.deleteUserByIds(ids));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return error(e.getMessage());
|
||||
public AjaxResult remove(String ids) {
|
||||
try {
|
||||
return toAjax( userService.deleteUserByIds( ids ) );
|
||||
} catch (Exception e) {
|
||||
return error( e.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -178,9 +163,8 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkLoginNameUnique")
|
||||
@ResponseBody
|
||||
public String checkLoginNameUnique(SysUser user)
|
||||
{
|
||||
return userService.checkLoginNameUnique(user.getLoginName());
|
||||
public String checkLoginNameUnique(SysUser user) {
|
||||
return userService.checkLoginNameUnique( user.getLoginName() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -188,9 +172,8 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkPhoneUnique")
|
||||
@ResponseBody
|
||||
public String checkPhoneUnique(SysUser user)
|
||||
{
|
||||
return userService.checkPhoneUnique(user);
|
||||
public String checkPhoneUnique(SysUser user) {
|
||||
return userService.checkPhoneUnique( user );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -198,8 +181,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkEmailUnique")
|
||||
@ResponseBody
|
||||
public String checkEmailUnique(SysUser user)
|
||||
{
|
||||
return userService.checkEmailUnique(user);
|
||||
public String checkEmailUnique(SysUser user) {
|
||||
return userService.checkEmailUnique( user );
|
||||
}
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ public class SwaggerConfig
|
|||
{
|
||||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
.title("标题:若依管理系统_接口文档")
|
||||
.title("标题:云企智联管理系统_接口文档")
|
||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
.contact(new Contact(Global.getName(), null, null))
|
||||
.version("版本号:" + Global.getVersion())
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ spring:
|
|||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
|
||||
url: jdbc:mysql://localhost:3306/jeesis?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ ruoyi:
|
|||
# 开发环境配置
|
||||
server:
|
||||
# 服务端口
|
||||
port: 80
|
||||
port: 8081
|
||||
servlet:
|
||||
# 项目contextPath
|
||||
context-path: /
|
||||
|
|
|
|||
|
|
@ -12,54 +12,54 @@
|
|||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-info.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 按天回滚 daily -->
|
||||
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>INFO</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
<!--<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
|
||||
<!--<file>${log.path}/sys-info.log</file>-->
|
||||
<!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
|
||||
<!--<!– 按天回滚 daily –>-->
|
||||
<!--<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>-->
|
||||
<!--<!– 日志最大的历史 60天 –>-->
|
||||
<!--<maxHistory>60</maxHistory>-->
|
||||
<!--</rollingPolicy>-->
|
||||
<!--<encoder>-->
|
||||
<!--<pattern>${log.pattern}</pattern>-->
|
||||
<!--</encoder>-->
|
||||
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">-->
|
||||
<!--<level>INFO</level>-->
|
||||
<!--<onMatch>ACCEPT</onMatch>-->
|
||||
<!--<onMismatch>DENY</onMismatch>-->
|
||||
<!--</filter>-->
|
||||
<!--</appender>-->
|
||||
<!---->
|
||||
<!--<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
|
||||
<!--<file>${log.path}/sys-error.log</file>-->
|
||||
<!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
|
||||
<!--<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>-->
|
||||
<!--<!– 日志最大的历史 60天 –>-->
|
||||
<!--<maxHistory>60</maxHistory>-->
|
||||
<!--</rollingPolicy>-->
|
||||
<!--<encoder>-->
|
||||
<!--<pattern>${log.pattern}</pattern>-->
|
||||
<!--</encoder>-->
|
||||
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">-->
|
||||
<!--<level>ERROR</level>-->
|
||||
<!--<onMatch>ACCEPT</onMatch>-->
|
||||
<!--<onMismatch>DENY</onMismatch>-->
|
||||
<!--</filter>-->
|
||||
<!--</appender>-->
|
||||
|
||||
<!-- 用户访问日志输出 -->
|
||||
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-user.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 按天回滚 daily -->
|
||||
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!--<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
|
||||
<!--<file>${log.path}/sys-user.log</file>-->
|
||||
<!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
|
||||
<!--<!– 按天回滚 daily –>-->
|
||||
<!--<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>-->
|
||||
<!--<!– 日志最大的历史 60天 –>-->
|
||||
<!--<maxHistory>60</maxHistory>-->
|
||||
<!--</rollingPolicy>-->
|
||||
<!--<encoder>-->
|
||||
<!--<pattern>${log.pattern}</pattern>-->
|
||||
<!--</encoder>-->
|
||||
<!--</appender>-->
|
||||
|
||||
<!-- 显示形成的sql、使用的参数、结果集 -->
|
||||
<!--
|
||||
|
|
@ -74,13 +74,13 @@
|
|||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
<!--<root level="info">-->
|
||||
<!--<appender-ref ref="file_info" />-->
|
||||
<!--<appender-ref ref="file_error" />-->
|
||||
<!--</root>-->
|
||||
|
||||
<!--系统用户操作日志-->
|
||||
<logger name="sys-user" level="info">
|
||||
<appender-ref ref="sys-user"/>
|
||||
</logger>
|
||||
<!--<logger name="sys-user" level="info">-->
|
||||
<!--<appender-ref ref="sys-user"/>-->
|
||||
<!--</logger>-->
|
||||
</configuration>
|
||||
|
|
@ -6661,7 +6661,7 @@ body.rtls .top-navigation .footer.fixed, body.rtls.top-navigation .footer.fixed
|
|||
}
|
||||
/*
|
||||
*
|
||||
* SKIN blue 若依管理系统
|
||||
* SKIN blue 云企智联管理系统
|
||||
* NAME - blue/purple
|
||||
*
|
||||
*/
|
||||
|
|
@ -6804,7 +6804,7 @@ body.skin-blue {
|
|||
}
|
||||
/*
|
||||
*
|
||||
* SKIN Yellow 若依管理系统
|
||||
* SKIN Yellow 云企智联管理系统
|
||||
* NAME - Yellow/purple
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>若依管理系统首页</title>
|
||||
<meta name="keywords" content="若依管理系统首页">
|
||||
<meta name="description" content="若依管理系统首页">
|
||||
<title>云企智联管理系统首页</title>
|
||||
<meta name="keywords" content="云企智联管理系统首页">
|
||||
<meta name="description" content="云企智联管理系统首页">
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="refresh" content="0;ie.html"/>
|
||||
<![endif]-->
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
<li class="active">
|
||||
<a href="index.html"><i class="fa fa-home"></i> <span class="nav-label">主页</span> <span class="fa arrow"></span></a>
|
||||
<ul class="nav nav-second-level">
|
||||
<li class="active"><a class="menuItem" th:href="@{/system/main}">了解若依</a></li>
|
||||
<li class="active"><a class="menuItem" th:href="@{/system/main}">了解云企智联</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li th:each="menu : ${menus}">
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
</div>
|
||||
<ul class="nav navbar-top-links navbar-right welcome-message">
|
||||
<li>
|
||||
<span class="m-r-sm text-muted">欢迎来到若依管理后台.</span>
|
||||
<span class="m-r-sm text-muted">欢迎来到云企智联管理后台.</span>
|
||||
</li>
|
||||
<li><a id="fullScreen"><i class="fa fa-arrows-alt"></i>全屏</a></li>
|
||||
<li><a th:href="@{logout}"><i class="fa fa-sign-out"></i>退出</a></li>
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
|
||||
<title>若依管理系统</title>
|
||||
<meta name="keywords" content="若依,若依开源,若依框架,若依系统,ruoyi">
|
||||
<meta name="description" content="若依基于SpringBoot2.0的权限管理系统 易读易懂、界面简洁美观。 核心技术采用Spring、MyBatis、Shiro没有任何其它重度依赖">
|
||||
<title>云企智联管理系统</title>
|
||||
<meta name="keywords" content="云企智联,云企智联开源,云企智联框架,云企智联系统,ruoyi">
|
||||
<meta name="description" content="云企智联基于SpringBoot2.0的权限管理系统 易读易懂、界面简洁美观。 核心技术采用Spring、MyBatis、Shiro没有任何其它重度依赖">
|
||||
<link href="../static/css/bootstrap.min.css" th:href="@{css/bootstrap.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/font-awesome.min.css" th:href="@{css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/style.css" th:href="@{css/style.css}" rel="stylesheet"/>
|
||||
|
|
@ -30,10 +30,10 @@
|
|||
<div class="col-sm-7">
|
||||
<div class="signin-info">
|
||||
<div class="logopanel m-b">
|
||||
<h1><img alt="[ 若依 ]" src="../static/ruoyi.png" th:src="@{/ruoyi.png}"></h1>
|
||||
<h1><img alt="[ 云企智联 ]" src="../static/ruoyi.png" th:src="@{/ruoyi.png}"></h1>
|
||||
</div>
|
||||
<div class="m-b"></div>
|
||||
<h4>欢迎使用 <strong>若依 后台管理系统</strong></h4>
|
||||
<h4>欢迎使用 <strong>云企智联 后台管理系统</strong></h4>
|
||||
<ul class="m-b">
|
||||
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> SpringBoot</li>
|
||||
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Mybatis</li>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!--360浏览器优先以webkit内核解析-->
|
||||
<title>若依介绍</title>
|
||||
<title>云企智联介绍</title>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<blockquote class="text-warning" style="font-size:14px">
|
||||
2018年度最受欢迎中国开源软件评选
|
||||
<br><a target="_blank" href="https://www.oschina.net/project/top_cn_2018?sort=1">https://www.oschina.net/project/top_cn_2018?sort=1</a>
|
||||
<h4 class="text-danger">请给若依/RuoYi 投票,谢谢支持。</h4>
|
||||
<h4 class="text-danger">请给云企智联/RuoYi 投票,谢谢支持。</h4>
|
||||
</blockquote>
|
||||
|
||||
<hr>
|
||||
|
|
@ -32,8 +32,8 @@
|
|||
<br>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<h2>若依后台管理框架</h2>
|
||||
<p>一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依管理系统。,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。</p>
|
||||
<h2>云企智联后台管理框架</h2>
|
||||
<p>一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了云企智联管理系统。,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。</p>
|
||||
<p>
|
||||
<b>当前版本:</b><span>v[[${version}]]</span>
|
||||
</p>
|
||||
|
|
@ -79,9 +79,9 @@
|
|||
</p>
|
||||
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <a href="https://jq.qq.com/?_wv=1027&k=5cHeRVW" target="_blank">1679294</a>
|
||||
</p>
|
||||
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *若依</a>
|
||||
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *云企智联</a>
|
||||
</p>
|
||||
<p><i class="fa fa-credit-card"></i> 支付宝:<a href="javascript:;" class="支付宝信息">/ *若依</a>
|
||||
<p><i class="fa fa-credit-card"></i> 支付宝:<a href="javascript:;" class="支付宝信息">/ *云企智联</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -288,7 +288,7 @@
|
|||
<li>优化登录失败刷新验证码</li>
|
||||
<li>新增用户登陆地址时间</li>
|
||||
<li>修复ajax超时退出问题</li>
|
||||
<li>新增html调用数据字典(若依首创)</li>
|
||||
<li>新增html调用数据字典(云企智联首创)</li>
|
||||
<li>调整系统部分样式</li>
|
||||
<li>新增用户逻辑删除</li>
|
||||
<li>新增管理员不允许删除修改</li>
|
||||
|
|
@ -412,7 +412,7 @@
|
|||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>新增代码生成(生成包括 java、html、js、xml、sql)</li>
|
||||
<li>新增按钮权限控制隐藏(若依首创)</li>
|
||||
<li>新增按钮权限控制隐藏(云企智联首创)</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -546,7 +546,7 @@
|
|||
<div id="v00" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>若依管理系统正式发布。</li>
|
||||
<li>云企智联管理系统正式发布。</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -69,6 +69,12 @@
|
|||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
</dependency>
|
||||
<!-- 通用工具 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>4.2.1</version>
|
||||
</dependency>
|
||||
<!-- 单表通用mapper -->
|
||||
<dependency>
|
||||
<groupId>tk.mybatis</groupId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="ruoyi-framework" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.34" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.34" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.34" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.12.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.penggle:kaptcha:2.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.jhlabs:filters:2.0.235-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-lang:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-cache:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-hash:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-core:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-cipher:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-core:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-ogdl:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-event:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-ehcache:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.6.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.theborakompanioni:thymeleaf-extras-shiro:2.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: eu.bitwalker:UserAgentUtils:1.19" level="project" />
|
||||
<orderEntry type="module" module-name="ruoyi-common" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:4.2.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-starter:2.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-core:1.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-base:1.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-weekend:1.1.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.oshi:oshi-core:3.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.5.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:2.7.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.47" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.ruoyi.web.controller.exam;
|
||||
package com.ruoyi.exam.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -23,7 +23,7 @@ import com.ruoyi.common.utils.ExcelUtil;
|
|||
* 问题点评 信息操作处理
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/exam/examQuestionComment")
|
||||
|
|
@ -49,7 +49,7 @@ public class ExamQuestionCommentController extends BaseController
|
|||
@ResponseBody
|
||||
public TableDataInfo list(ExamQuestionComment examQuestionComment)
|
||||
{
|
||||
List<ExamQuestionComment> list = examQuestionCommentService.selectExamQuestionCommentList(examQuestionComment);
|
||||
List<ExamQuestionComment> list = examQuestionCommentService.selectExamQuestionCommentPage(examQuestionComment);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ public class ExamQuestionCommentController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(ExamQuestionComment examQuestionComment)
|
||||
{
|
||||
return toAjax(examQuestionCommentService.insertExamQuestionComment(examQuestionComment));
|
||||
return toAjax(examQuestionCommentService.insert(examQuestionComment));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -94,7 +94,7 @@ public class ExamQuestionCommentController extends BaseController
|
|||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
||||
{
|
||||
ExamQuestionComment examQuestionComment = examQuestionCommentService.selectExamQuestionCommentById(id);
|
||||
ExamQuestionComment examQuestionComment = examQuestionCommentService.selectById(id);
|
||||
mmap.put("examQuestionComment", examQuestionComment);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ public class ExamQuestionCommentController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(ExamQuestionComment examQuestionComment)
|
||||
{
|
||||
return toAjax(examQuestionCommentService.updateExamQuestionComment(examQuestionComment));
|
||||
return toAjax(examQuestionCommentService.updateById(examQuestionComment));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -120,7 +120,7 @@ public class ExamQuestionCommentController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(examQuestionCommentService.deleteExamQuestionCommentByIds(ids));
|
||||
return toAjax(examQuestionCommentService.deleteByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
|||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 问题 信息操作处理
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.ruoyi.web.controller.exam;
|
||||
package com.ruoyi.exam.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -23,7 +23,7 @@ import com.ruoyi.common.utils.ExcelUtil;
|
|||
* 问题选项 信息操作处理
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/exam/examQuestionItem")
|
||||
|
|
@ -49,7 +49,7 @@ public class ExamQuestionItemController extends BaseController
|
|||
@ResponseBody
|
||||
public TableDataInfo list(ExamQuestionItem examQuestionItem)
|
||||
{
|
||||
List<ExamQuestionItem> list = examQuestionItemService.selectExamQuestionItemList(examQuestionItem);
|
||||
List<ExamQuestionItem> list = examQuestionItemService.selectExamQuestionItemPage(examQuestionItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ public class ExamQuestionItemController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(ExamQuestionItem examQuestionItem)
|
||||
{
|
||||
return toAjax(examQuestionItemService.insertExamQuestionItem(examQuestionItem));
|
||||
return toAjax(examQuestionItemService.insert(examQuestionItem));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -94,7 +94,7 @@ public class ExamQuestionItemController extends BaseController
|
|||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
||||
{
|
||||
ExamQuestionItem examQuestionItem = examQuestionItemService.selectExamQuestionItemById(id);
|
||||
ExamQuestionItem examQuestionItem = examQuestionItemService.selectById(id);
|
||||
mmap.put("examQuestionItem", examQuestionItem);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ public class ExamQuestionItemController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(ExamQuestionItem examQuestionItem)
|
||||
{
|
||||
return toAjax(examQuestionItemService.updateExamQuestionItem(examQuestionItem));
|
||||
return toAjax(examQuestionItemService.updateById(examQuestionItem));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -120,7 +120,7 @@ public class ExamQuestionItemController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(examQuestionItemService.deleteExamQuestionItemByIds(ids));
|
||||
return toAjax(examQuestionItemService.deleteByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,147 +3,184 @@ package com.ruoyi.exam.domain;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 问题表 exam_question
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
public class ExamQuestion
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
@Id
|
||||
private String id;
|
||||
/** 问题标题 */
|
||||
|
||||
private String title;
|
||||
/** 问题答案 */
|
||||
|
||||
private String answer;
|
||||
/** 问题类型 */
|
||||
|
||||
private String type;
|
||||
/** 标签 */
|
||||
|
||||
private String label;
|
||||
/** 类别 */
|
||||
|
||||
private String categoryId;
|
||||
/** 创建者 */
|
||||
|
||||
private String createBy;
|
||||
/** 创建时间 */
|
||||
|
||||
private Date createDate;
|
||||
/** 更新者 */
|
||||
|
||||
private String updateBy;
|
||||
/** 更新时间 */
|
||||
|
||||
private Date updateDate;
|
||||
/** 备注信息 */
|
||||
|
||||
private String remarks;
|
||||
/** 删除标记 */
|
||||
|
||||
private String delFlag;
|
||||
|
||||
/** 设置 */
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** 获取 */
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
/** 设置问题标题 */
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
/** 获取问题标题 */
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
/** 设置问题答案 */
|
||||
public void setAnswer(String answer)
|
||||
{
|
||||
this.answer = answer;
|
||||
}
|
||||
|
||||
/** 获取问题答案 */
|
||||
public String getAnswer()
|
||||
{
|
||||
return answer;
|
||||
}
|
||||
/** 设置问题类型 */
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/** 获取问题类型 */
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
/** 设置标签 */
|
||||
public void setLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
/** 获取标签 */
|
||||
public String getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
/** 设置类别 */
|
||||
public void setCategoryId(String categoryId)
|
||||
{
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
/** 获取类别 */
|
||||
public String getCategoryId()
|
||||
{
|
||||
return categoryId;
|
||||
}
|
||||
/** 设置创建者 */
|
||||
public void setCreateBy(String createBy)
|
||||
{
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
/** 获取创建者 */
|
||||
public String getCreateBy()
|
||||
{
|
||||
return createBy;
|
||||
}
|
||||
/** 设置创建时间 */
|
||||
public void setCreateDate(Date createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
/** 获取创建时间 */
|
||||
public Date getCreateDate()
|
||||
{
|
||||
return createDate;
|
||||
}
|
||||
/** 设置更新者 */
|
||||
public void setUpdateBy(String updateBy)
|
||||
{
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
/** 获取更新者 */
|
||||
public String getUpdateBy()
|
||||
{
|
||||
return updateBy;
|
||||
}
|
||||
/** 设置更新时间 */
|
||||
public void setUpdateDate(Date updateDate)
|
||||
{
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
/** 获取更新时间 */
|
||||
public Date getUpdateDate()
|
||||
{
|
||||
return updateDate;
|
||||
}
|
||||
/** 设置备注信息 */
|
||||
public void setRemarks(String remarks)
|
||||
{
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
/** 获取备注信息 */
|
||||
public String getRemarks()
|
||||
{
|
||||
return remarks;
|
||||
}
|
||||
/** 设置删除标记 */
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
/** 获取删除标记 */
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.ruoyi.exam.domain;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -16,6 +18,7 @@ public class ExamQuestionCategory
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
@Id
|
||||
private Long id;
|
||||
/** 分类 */
|
||||
private String name;
|
||||
|
|
|
|||
|
|
@ -3,136 +3,170 @@ package com.ruoyi.exam.domain;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 问题点评表 exam_question_comment
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
public class ExamQuestionComment
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
@Id
|
||||
private String id;
|
||||
/** 点评内容 */
|
||||
|
||||
private Integer content;
|
||||
/** 问题 */
|
||||
|
||||
private String examQuestionId;
|
||||
/** 点赞数量 */
|
||||
|
||||
private Integer praiseCount;
|
||||
/** 类型(0 学生点评 1 老师点评) */
|
||||
|
||||
private String commentType;
|
||||
/** 创建者 */
|
||||
|
||||
private String createBy;
|
||||
/** 创建时间 */
|
||||
|
||||
private Date createDate;
|
||||
/** 更新者 */
|
||||
|
||||
private String updateBy;
|
||||
/** 更新时间 */
|
||||
|
||||
private Date updateDate;
|
||||
/** 备注信息 */
|
||||
|
||||
private String remarks;
|
||||
/** 删除标记 */
|
||||
|
||||
private String delFlag;
|
||||
|
||||
/** 设置 */
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** 获取 */
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
/** 设置点评内容 */
|
||||
public void setContent(Integer content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
/** 获取点评内容 */
|
||||
public Integer getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
/** 设置问题 */
|
||||
public void setExamQuestionId(String examQuestionId)
|
||||
{
|
||||
this.examQuestionId = examQuestionId;
|
||||
}
|
||||
|
||||
/** 获取问题 */
|
||||
public String getExamQuestionId()
|
||||
{
|
||||
return examQuestionId;
|
||||
}
|
||||
/** 设置点赞数量 */
|
||||
public void setPraiseCount(Integer praiseCount)
|
||||
{
|
||||
this.praiseCount = praiseCount;
|
||||
}
|
||||
|
||||
/** 获取点赞数量 */
|
||||
public Integer getPraiseCount()
|
||||
{
|
||||
return praiseCount;
|
||||
}
|
||||
/** 设置类型(0 学生点评 1 老师点评) */
|
||||
public void setCommentType(String commentType)
|
||||
{
|
||||
this.commentType = commentType;
|
||||
}
|
||||
|
||||
/** 获取类型(0 学生点评 1 老师点评) */
|
||||
public String getCommentType()
|
||||
{
|
||||
return commentType;
|
||||
}
|
||||
/** 设置创建者 */
|
||||
public void setCreateBy(String createBy)
|
||||
{
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
/** 获取创建者 */
|
||||
public String getCreateBy()
|
||||
{
|
||||
return createBy;
|
||||
}
|
||||
/** 设置创建时间 */
|
||||
public void setCreateDate(Date createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
/** 获取创建时间 */
|
||||
public Date getCreateDate()
|
||||
{
|
||||
return createDate;
|
||||
}
|
||||
/** 设置更新者 */
|
||||
public void setUpdateBy(String updateBy)
|
||||
{
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
/** 获取更新者 */
|
||||
public String getUpdateBy()
|
||||
{
|
||||
return updateBy;
|
||||
}
|
||||
/** 设置更新时间 */
|
||||
public void setUpdateDate(Date updateDate)
|
||||
{
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
/** 获取更新时间 */
|
||||
public Date getUpdateDate()
|
||||
{
|
||||
return updateDate;
|
||||
}
|
||||
/** 设置备注信息 */
|
||||
public void setRemarks(String remarks)
|
||||
{
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
/** 获取备注信息 */
|
||||
public String getRemarks()
|
||||
{
|
||||
return remarks;
|
||||
}
|
||||
/** 设置删除标记 */
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
/** 获取删除标记 */
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
|
|
|
|||
|
|
@ -3,125 +3,156 @@ package com.ruoyi.exam.domain;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 问题选项表 exam_question_item
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
public class ExamQuestionItem
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
@Id
|
||||
private String id;
|
||||
/** 选项内容 */
|
||||
|
||||
private String content;
|
||||
/** 选项 */
|
||||
|
||||
private String number;
|
||||
/** 题目 */
|
||||
|
||||
private String examQuestionId;
|
||||
/** 创建者 */
|
||||
|
||||
private String createBy;
|
||||
/** 创建时间 */
|
||||
|
||||
private Date createDate;
|
||||
/** 更新者 */
|
||||
|
||||
private String updateBy;
|
||||
/** 更新时间 */
|
||||
|
||||
private Date updateDate;
|
||||
/** 备注信息 */
|
||||
|
||||
private String remarks;
|
||||
/** 删除标记 */
|
||||
|
||||
private String delFlag;
|
||||
|
||||
/** 设置 */
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** 获取 */
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
/** 设置选项内容 */
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
/** 获取选项内容 */
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
/** 设置选项 */
|
||||
public void setNumber(String number)
|
||||
{
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
/** 获取选项 */
|
||||
public String getNumber()
|
||||
{
|
||||
return number;
|
||||
}
|
||||
/** 设置题目 */
|
||||
public void setExamQuestionId(String examQuestionId)
|
||||
{
|
||||
this.examQuestionId = examQuestionId;
|
||||
}
|
||||
|
||||
/** 获取题目 */
|
||||
public String getExamQuestionId()
|
||||
{
|
||||
return examQuestionId;
|
||||
}
|
||||
/** 设置创建者 */
|
||||
public void setCreateBy(String createBy)
|
||||
{
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
/** 获取创建者 */
|
||||
public String getCreateBy()
|
||||
{
|
||||
return createBy;
|
||||
}
|
||||
/** 设置创建时间 */
|
||||
public void setCreateDate(Date createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
/** 获取创建时间 */
|
||||
public Date getCreateDate()
|
||||
{
|
||||
return createDate;
|
||||
}
|
||||
/** 设置更新者 */
|
||||
public void setUpdateBy(String updateBy)
|
||||
{
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
/** 获取更新者 */
|
||||
public String getUpdateBy()
|
||||
{
|
||||
return updateBy;
|
||||
}
|
||||
/** 设置更新时间 */
|
||||
public void setUpdateDate(Date updateDate)
|
||||
{
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
/** 获取更新时间 */
|
||||
public Date getUpdateDate()
|
||||
{
|
||||
return updateDate;
|
||||
}
|
||||
/** 设置备注信息 */
|
||||
public void setRemarks(String remarks)
|
||||
{
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
/** 获取备注信息 */
|
||||
public String getRemarks()
|
||||
{
|
||||
return remarks;
|
||||
}
|
||||
/** 设置删除标记 */
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
/** 获取删除标记 */
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@ public interface ExamQuestionCategoryMapper extends MyMapper<ExamQuestionCatego
|
|||
{
|
||||
/**
|
||||
* 查询试题分类信息
|
||||
*
|
||||
*
|
||||
* @param id 试题分类ID
|
||||
* @return 试题分类信息
|
||||
*/
|
||||
public ExamQuestionCategory selectExamQuestionCategoryById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询试题分类列表
|
||||
*
|
||||
|
|
@ -30,34 +30,34 @@ public interface ExamQuestionCategoryMapper extends MyMapper<ExamQuestionCatego
|
|||
|
||||
/**
|
||||
* 新增试题分类
|
||||
*
|
||||
*
|
||||
* @param examQuestionCategory 试题分类信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertExamQuestionCategory(ExamQuestionCategory examQuestionCategory);
|
||||
|
||||
|
||||
/**
|
||||
* 修改试题分类
|
||||
*
|
||||
*
|
||||
* @param examQuestionCategory 试题分类信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExamQuestionCategory(ExamQuestionCategory examQuestionCategory);
|
||||
|
||||
|
||||
/**
|
||||
* 删除试题分类
|
||||
*
|
||||
*
|
||||
* @param id 试题分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionCategoryById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除试题分类
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionCategoryByIds(String[] ids);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -14,12 +14,12 @@ public interface ExamQuestionCommentMapper extends MyMapper<ExamQuestionComment
|
|||
{
|
||||
/**
|
||||
* 查询问题点评信息
|
||||
*
|
||||
*
|
||||
* @param id 问题点评ID
|
||||
* @return 问题点评信息
|
||||
*/
|
||||
public ExamQuestionComment selectExamQuestionCommentById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询问题点评列表
|
||||
*
|
||||
|
|
@ -30,34 +30,34 @@ public interface ExamQuestionCommentMapper extends MyMapper<ExamQuestionComment
|
|||
|
||||
/**
|
||||
* 新增问题点评
|
||||
*
|
||||
*
|
||||
* @param examQuestionComment 问题点评信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertExamQuestionComment(ExamQuestionComment examQuestionComment);
|
||||
|
||||
|
||||
/**
|
||||
* 修改问题点评
|
||||
*
|
||||
*
|
||||
* @param examQuestionComment 问题点评信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExamQuestionComment(ExamQuestionComment examQuestionComment);
|
||||
|
||||
|
||||
/**
|
||||
* 删除问题点评
|
||||
*
|
||||
*
|
||||
* @param id 问题点评ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionCommentById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除问题点评
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionCommentByIds(String[] ids);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -14,12 +14,12 @@ public interface ExamQuestionItemMapper extends MyMapper<ExamQuestionItem>
|
|||
{
|
||||
/**
|
||||
* 查询问题选项信息
|
||||
*
|
||||
*
|
||||
* @param id 问题选项ID
|
||||
* @return 问题选项信息
|
||||
*/
|
||||
public ExamQuestionItem selectExamQuestionItemById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询问题选项列表
|
||||
*
|
||||
|
|
@ -30,34 +30,34 @@ public interface ExamQuestionItemMapper extends MyMapper<ExamQuestionItem>
|
|||
|
||||
/**
|
||||
* 新增问题选项
|
||||
*
|
||||
*
|
||||
* @param examQuestionItem 问题选项信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertExamQuestionItem(ExamQuestionItem examQuestionItem);
|
||||
|
||||
|
||||
/**
|
||||
* 修改问题选项
|
||||
*
|
||||
*
|
||||
* @param examQuestionItem 问题选项信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExamQuestionItem(ExamQuestionItem examQuestionItem);
|
||||
|
||||
|
||||
/**
|
||||
* 删除问题选项
|
||||
*
|
||||
*
|
||||
* @param id 问题选项ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionItemById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除问题选项
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionItemByIds(String[] ids);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -14,12 +14,12 @@ public interface ExamQuestionMapper extends MyMapper<ExamQuestion>
|
|||
{
|
||||
/**
|
||||
* 查询问题信息
|
||||
*
|
||||
*
|
||||
* @param id 问题ID
|
||||
* @return 问题信息
|
||||
*/
|
||||
public ExamQuestion selectExamQuestionById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询问题列表
|
||||
*
|
||||
|
|
@ -30,34 +30,34 @@ public interface ExamQuestionMapper extends MyMapper<ExamQuestion>
|
|||
|
||||
/**
|
||||
* 新增问题
|
||||
*
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertExamQuestion(ExamQuestion examQuestion);
|
||||
|
||||
|
||||
/**
|
||||
* 修改问题
|
||||
*
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExamQuestion(ExamQuestion examQuestion);
|
||||
|
||||
|
||||
/**
|
||||
* 删除问题
|
||||
*
|
||||
*
|
||||
* @param id 问题ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除问题
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionByIds(String[] ids);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -15,39 +15,39 @@ public interface IExamQuestionCategoryService extends AbstractBaseService<ExamQu
|
|||
{
|
||||
/**
|
||||
* 查询试题分类信息
|
||||
*
|
||||
*
|
||||
* @param id 试题分类ID
|
||||
* @return 试题分类信息
|
||||
*/
|
||||
public ExamQuestionCategory selectExamQuestionCategoryById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询试题分类列表
|
||||
*
|
||||
*
|
||||
* @param examQuestionCategory 试题分类信息
|
||||
* @return 试题分类集合
|
||||
*/
|
||||
public List<ExamQuestionCategory> selectExamQuestionCategoryList(ExamQuestionCategory examQuestionCategory);
|
||||
|
||||
|
||||
/**
|
||||
* 新增试题分类
|
||||
*
|
||||
*
|
||||
* @param examQuestionCategory 试题分类信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertExamQuestionCategory(ExamQuestionCategory examQuestionCategory);
|
||||
|
||||
|
||||
/**
|
||||
* 修改试题分类
|
||||
*
|
||||
*
|
||||
* @param examQuestionCategory 试题分类信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExamQuestionCategory(ExamQuestionCategory examQuestionCategory);
|
||||
|
||||
|
||||
/**
|
||||
* 删除试题分类信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,48 +7,24 @@ import com.ruoyi.framework.web.base.AbstractBaseService;
|
|||
* 问题点评 服务层
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
public interface IExamQuestionCommentService extends AbstractBaseService<ExamQuestionComment>
|
||||
{
|
||||
/**
|
||||
* 查询问题点评信息
|
||||
*
|
||||
* @param id 问题点评ID
|
||||
* @return 问题点评信息
|
||||
*/
|
||||
public ExamQuestionComment selectExamQuestionCommentById(String id);
|
||||
|
||||
/**
|
||||
* 查询问题点评列表
|
||||
*
|
||||
* 查询问题点评分页列表
|
||||
*
|
||||
* @param examQuestionComment 问题点评信息
|
||||
* @return 问题点评集合
|
||||
*/
|
||||
public List<ExamQuestionComment> selectExamQuestionCommentList(ExamQuestionComment examQuestionComment);
|
||||
|
||||
/**
|
||||
* 新增问题点评
|
||||
*
|
||||
public List<ExamQuestionComment> selectExamQuestionCommentPage(ExamQuestionComment examQuestionComment);
|
||||
/**
|
||||
* 查询问题点评列表
|
||||
*
|
||||
* @param examQuestionComment 问题点评信息
|
||||
* @return 结果
|
||||
* @return 问题点评集合
|
||||
*/
|
||||
public int insertExamQuestionComment(ExamQuestionComment examQuestionComment);
|
||||
|
||||
/**
|
||||
* 修改问题点评
|
||||
*
|
||||
* @param examQuestionComment 问题点评信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExamQuestionComment(ExamQuestionComment examQuestionComment);
|
||||
|
||||
/**
|
||||
* 删除问题点评信息
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionCommentByIds(String ids);
|
||||
public List<ExamQuestionComment> selectExamQuestionCommentList(ExamQuestionComment examQuestionComment);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,48 +7,24 @@ import com.ruoyi.framework.web.base.AbstractBaseService;
|
|||
* 问题选项 服务层
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
public interface IExamQuestionItemService extends AbstractBaseService<ExamQuestionItem>
|
||||
{
|
||||
/**
|
||||
* 查询问题选项信息
|
||||
*
|
||||
* @param id 问题选项ID
|
||||
* @return 问题选项信息
|
||||
*/
|
||||
public ExamQuestionItem selectExamQuestionItemById(String id);
|
||||
|
||||
/**
|
||||
* 查询问题选项列表
|
||||
*
|
||||
* 查询问题选项分页列表
|
||||
*
|
||||
* @param examQuestionItem 问题选项信息
|
||||
* @return 问题选项集合
|
||||
*/
|
||||
public List<ExamQuestionItem> selectExamQuestionItemList(ExamQuestionItem examQuestionItem);
|
||||
|
||||
/**
|
||||
* 新增问题选项
|
||||
*
|
||||
public List<ExamQuestionItem> selectExamQuestionItemPage(ExamQuestionItem examQuestionItem);
|
||||
/**
|
||||
* 查询问题选项列表
|
||||
*
|
||||
* @param examQuestionItem 问题选项信息
|
||||
* @return 结果
|
||||
* @return 问题选项集合
|
||||
*/
|
||||
public int insertExamQuestionItem(ExamQuestionItem examQuestionItem);
|
||||
|
||||
/**
|
||||
* 修改问题选项
|
||||
*
|
||||
* @param examQuestionItem 问题选项信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExamQuestionItem(ExamQuestionItem examQuestionItem);
|
||||
|
||||
/**
|
||||
* 删除问题选项信息
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExamQuestionItemByIds(String ids);
|
||||
public List<ExamQuestionItem> selectExamQuestionItemList(ExamQuestionItem examQuestionItem);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,39 +13,39 @@ public interface IExamQuestionService extends AbstractBaseService<ExamQuestion>
|
|||
{
|
||||
/**
|
||||
* 查询问题信息
|
||||
*
|
||||
*
|
||||
* @param id 问题ID
|
||||
* @return 问题信息
|
||||
*/
|
||||
public ExamQuestion selectExamQuestionById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询问题列表
|
||||
*
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 问题集合
|
||||
*/
|
||||
public List<ExamQuestion> selectExamQuestionList(ExamQuestion examQuestion);
|
||||
|
||||
|
||||
/**
|
||||
* 新增问题
|
||||
*
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertExamQuestion(ExamQuestion examQuestion);
|
||||
|
||||
|
||||
/**
|
||||
* 修改问题
|
||||
*
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExamQuestion(ExamQuestion examQuestion);
|
||||
|
||||
|
||||
/**
|
||||
* 删除问题信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
|
|||
* 问题点评 服务层实现
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
@Service
|
||||
public class ExamQuestionCommentServiceImpl extends AbstractBaseServiceImpl<ExamQuestionCommentMapper,ExamQuestionComment> implements IExamQuestionCommentService
|
||||
|
|
@ -20,17 +20,6 @@ public class ExamQuestionCommentServiceImpl extends AbstractBaseServiceImpl<Exam
|
|||
@Autowired
|
||||
private ExamQuestionCommentMapper examQuestionCommentMapper;
|
||||
|
||||
/**
|
||||
* 查询问题点评信息
|
||||
*
|
||||
* @param id 问题点评ID
|
||||
* @return 问题点评信息
|
||||
*/
|
||||
@Override
|
||||
public ExamQuestionComment selectExamQuestionCommentById(String id)
|
||||
{
|
||||
return examQuestionCommentMapper.selectExamQuestionCommentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询问题点评列表
|
||||
|
|
@ -41,44 +30,19 @@ public class ExamQuestionCommentServiceImpl extends AbstractBaseServiceImpl<Exam
|
|||
@Override
|
||||
public List<ExamQuestionComment> selectExamQuestionCommentList(ExamQuestionComment examQuestionComment)
|
||||
{
|
||||
startPage();
|
||||
return examQuestionCommentMapper.selectExamQuestionCommentList(examQuestionComment);
|
||||
return examQuestionCommentMapper.selectExamQuestionCommentList(examQuestionComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增问题点评
|
||||
*
|
||||
* 查询问题点评分页列表
|
||||
*
|
||||
* @param examQuestionComment 问题点评信息
|
||||
* @return 结果
|
||||
* @return 问题点评集合
|
||||
*/
|
||||
@Override
|
||||
public int insertExamQuestionComment(ExamQuestionComment examQuestionComment)
|
||||
{
|
||||
return examQuestionCommentMapper.insertExamQuestionComment(examQuestionComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改问题点评
|
||||
*
|
||||
* @param examQuestionComment 问题点评信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateExamQuestionComment(ExamQuestionComment examQuestionComment)
|
||||
{
|
||||
return examQuestionCommentMapper.updateExamQuestionComment(examQuestionComment);
|
||||
}
|
||||
@Override
|
||||
public List<ExamQuestionComment> selectExamQuestionCommentPage(ExamQuestionComment examQuestionComment)
|
||||
{
|
||||
startPage();
|
||||
return examQuestionCommentMapper.selectExamQuestionCommentList(examQuestionComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除问题点评对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteExamQuestionCommentByIds(String ids)
|
||||
{
|
||||
return examQuestionCommentMapper.deleteExamQuestionCommentByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
|
|||
* 问题选项 服务层实现
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
* @date 2018-12-07
|
||||
*/
|
||||
@Service
|
||||
public class ExamQuestionItemServiceImpl extends AbstractBaseServiceImpl<ExamQuestionItemMapper,ExamQuestionItem> implements IExamQuestionItemService
|
||||
|
|
@ -20,17 +20,6 @@ public class ExamQuestionItemServiceImpl extends AbstractBaseServiceImpl<ExamQue
|
|||
@Autowired
|
||||
private ExamQuestionItemMapper examQuestionItemMapper;
|
||||
|
||||
/**
|
||||
* 查询问题选项信息
|
||||
*
|
||||
* @param id 问题选项ID
|
||||
* @return 问题选项信息
|
||||
*/
|
||||
@Override
|
||||
public ExamQuestionItem selectExamQuestionItemById(String id)
|
||||
{
|
||||
return examQuestionItemMapper.selectExamQuestionItemById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询问题选项列表
|
||||
|
|
@ -41,44 +30,19 @@ public class ExamQuestionItemServiceImpl extends AbstractBaseServiceImpl<ExamQue
|
|||
@Override
|
||||
public List<ExamQuestionItem> selectExamQuestionItemList(ExamQuestionItem examQuestionItem)
|
||||
{
|
||||
startPage();
|
||||
return examQuestionItemMapper.selectExamQuestionItemList(examQuestionItem);
|
||||
return examQuestionItemMapper.selectExamQuestionItemList(examQuestionItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增问题选项
|
||||
*
|
||||
* 查询问题选项分页列表
|
||||
*
|
||||
* @param examQuestionItem 问题选项信息
|
||||
* @return 结果
|
||||
* @return 问题选项集合
|
||||
*/
|
||||
@Override
|
||||
public int insertExamQuestionItem(ExamQuestionItem examQuestionItem)
|
||||
{
|
||||
return examQuestionItemMapper.insertExamQuestionItem(examQuestionItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改问题选项
|
||||
*
|
||||
* @param examQuestionItem 问题选项信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateExamQuestionItem(ExamQuestionItem examQuestionItem)
|
||||
{
|
||||
return examQuestionItemMapper.updateExamQuestionItem(examQuestionItem);
|
||||
}
|
||||
@Override
|
||||
public List<ExamQuestionItem> selectExamQuestionItemPage(ExamQuestionItem examQuestionItem)
|
||||
{
|
||||
startPage();
|
||||
return examQuestionItemMapper.selectExamQuestionItemList(examQuestionItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除问题选项对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteExamQuestionItemByIds(String ids)
|
||||
{
|
||||
return examQuestionItemMapper.deleteExamQuestionItemByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import com.ruoyi.common.support.Convert;
|
|||
import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
|
||||
/**
|
||||
* 问题 服务层实现
|
||||
*
|
||||
*
|
||||
* @author zhujj
|
||||
* @date 2018-12-06
|
||||
*/
|
||||
|
|
@ -30,68 +30,68 @@ public class ExamQuestionServiceImpl extends AbstractBaseServiceImpl<ExamQuestio
|
|||
private ExamQuestionItemMapper examQuestionItemMapper;
|
||||
|
||||
/**
|
||||
* 查询问题信息
|
||||
*
|
||||
* @param id 问题ID
|
||||
* @return 问题信息
|
||||
*/
|
||||
@Override
|
||||
* 查询问题信息
|
||||
*
|
||||
* @param id 问题ID
|
||||
* @return 问题信息
|
||||
*/
|
||||
@Override
|
||||
public ExamQuestion selectExamQuestionById(String id)
|
||||
{
|
||||
return examQuestionMapper.selectExamQuestionById(id);
|
||||
return examQuestionMapper.selectExamQuestionById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询问题列表
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 问题集合
|
||||
*/
|
||||
* 查询问题列表
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 问题集合
|
||||
*/
|
||||
@Override
|
||||
public List<ExamQuestion> selectExamQuestionList(ExamQuestion examQuestion)
|
||||
{
|
||||
startPage();
|
||||
return examQuestionMapper.selectExamQuestionList(examQuestion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增问题
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertExamQuestion(ExamQuestion examQuestion)
|
||||
{
|
||||
return examQuestionMapper.insertExamQuestion(examQuestion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改问题
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateExamQuestion(ExamQuestion examQuestion)
|
||||
{
|
||||
return examQuestionMapper.updateExamQuestion(examQuestion);
|
||||
return examQuestionMapper.selectExamQuestionList(examQuestion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除问题对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
* 新增问题
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertExamQuestion(ExamQuestion examQuestion)
|
||||
{
|
||||
return examQuestionMapper.insertExamQuestion(examQuestion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改问题
|
||||
*
|
||||
* @param examQuestion 问题信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateExamQuestion(ExamQuestion examQuestion)
|
||||
{
|
||||
return examQuestionMapper.updateExamQuestion(examQuestion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除问题对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteExamQuestionByIds(String ids)
|
||||
{
|
||||
return examQuestionMapper.deleteExamQuestionByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertQuestion(ExamQuestion examQuestion, String[] number, String[] content) {
|
||||
@Override
|
||||
public int insertQuestion(ExamQuestion examQuestion, String[] number, String[] content) {
|
||||
Date date = new Date();
|
||||
examQuestion.setCreateDate(date);
|
||||
examQuestion.setCreateBy(ShiroUtils.getLoginName());
|
||||
|
|
@ -112,6 +112,6 @@ public class ExamQuestionServiceImpl extends AbstractBaseServiceImpl<ExamQuestio
|
|||
|
||||
|
||||
return i ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectExamQuestionCategoryById" parameterType="String" resultMap="ExamQuestionCategoryResult">
|
||||
<include refid="selectExamQuestionCategoryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertExamQuestionCategory" parameterType="ExamQuestionCategory">
|
||||
insert into exam_question_category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateExamQuestionCategory" parameterType="ExamQuestionCategory">
|
||||
update exam_question_category
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
|
@ -90,12 +90,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<delete id="deleteExamQuestionCategoryById" parameterType="String">
|
||||
delete from exam_question_category where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteExamQuestionCategoryByIds" parameterType="String">
|
||||
delete from exam_question_category where id in
|
||||
delete from exam_question_category where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -19,11 +19,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectExamQuestionCommentVo">
|
||||
select id, content, exam_question_id, praise_count, comment_type, create_by, create_date, update_by, update_date, remarks, del_flag from exam_question_comment
|
||||
</sql>
|
||||
id, content, exam_question_id, praise_count, comment_type, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||
|
||||
<select id="selectExamQuestionCommentList" parameterType="ExamQuestionComment" resultMap="ExamQuestionCommentResult">
|
||||
select
|
||||
<include refid="selectExamQuestionCommentVo"/>
|
||||
from exam_question_comment
|
||||
<where>
|
||||
<if test="id != null and id != '' "> and id = #{id}</if>
|
||||
<if test="content != null "> and content = #{content}</if>
|
||||
|
|
@ -38,68 +39,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectExamQuestionCommentById" parameterType="String" resultMap="ExamQuestionCommentResult">
|
||||
<include refid="selectExamQuestionCommentVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertExamQuestionComment" parameterType="ExamQuestionComment">
|
||||
insert into exam_question_comment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != '' ">id,</if>
|
||||
<if test="content != null ">content,</if>
|
||||
<if test="examQuestionId != null and examQuestionId != '' ">exam_question_id,</if>
|
||||
<if test="praiseCount != null ">praise_count,</if>
|
||||
<if test="commentType != null and commentType != '' ">comment_type,</if>
|
||||
<if test="createBy != null and createBy != '' ">create_by,</if>
|
||||
<if test="createDate != null ">create_date,</if>
|
||||
<if test="updateBy != null and updateBy != '' ">update_by,</if>
|
||||
<if test="updateDate != null ">update_date,</if>
|
||||
<if test="remarks != null and remarks != '' ">remarks,</if>
|
||||
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != '' ">#{id},</if>
|
||||
<if test="content != null ">#{content},</if>
|
||||
<if test="examQuestionId != null and examQuestionId != '' ">#{examQuestionId},</if>
|
||||
<if test="praiseCount != null ">#{praiseCount},</if>
|
||||
<if test="commentType != null and commentType != '' ">#{commentType},</if>
|
||||
<if test="createBy != null and createBy != '' ">#{createBy},</if>
|
||||
<if test="createDate != null ">#{createDate},</if>
|
||||
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
|
||||
<if test="updateDate != null ">#{updateDate},</if>
|
||||
<if test="remarks != null and remarks != '' ">#{remarks},</if>
|
||||
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateExamQuestionComment" parameterType="ExamQuestionComment">
|
||||
update exam_question_comment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="content != null ">content = #{content},</if>
|
||||
<if test="examQuestionId != null and examQuestionId != '' ">exam_question_id = #{examQuestionId},</if>
|
||||
<if test="praiseCount != null ">praise_count = #{praiseCount},</if>
|
||||
<if test="commentType != null and commentType != '' ">comment_type = #{commentType},</if>
|
||||
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
|
||||
<if test="createDate != null ">create_date = #{createDate},</if>
|
||||
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
|
||||
<if test="updateDate != null ">update_date = #{updateDate},</if>
|
||||
<if test="remarks != null and remarks != '' ">remarks = #{remarks},</if>
|
||||
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExamQuestionCommentById" parameterType="String">
|
||||
delete from exam_question_comment where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamQuestionCommentByIds" parameterType="String">
|
||||
delete from exam_question_comment where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -18,11 +18,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectExamQuestionItemVo">
|
||||
select id, content, number, exam_question_id, create_by, create_date, update_by, update_date, remarks, del_flag from exam_question_item
|
||||
</sql>
|
||||
id, content, number, exam_question_id, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||
|
||||
<select id="selectExamQuestionItemList" parameterType="ExamQuestionItem" resultMap="ExamQuestionItemResult">
|
||||
select
|
||||
<include refid="selectExamQuestionItemVo"/>
|
||||
from exam_question_item
|
||||
<where>
|
||||
<if test="id != null and id != '' "> and id = #{id}</if>
|
||||
<if test="content != null and content != '' "> and content = #{content}</if>
|
||||
|
|
@ -36,65 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectExamQuestionItemById" parameterType="String" resultMap="ExamQuestionItemResult">
|
||||
<include refid="selectExamQuestionItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertExamQuestionItem" parameterType="ExamQuestionItem">
|
||||
insert into exam_question_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != '' ">id,</if>
|
||||
<if test="content != null and content != '' ">content,</if>
|
||||
<if test="number != null and number != '' ">number,</if>
|
||||
<if test="examQuestionId != null and examQuestionId != '' ">exam_question_id,</if>
|
||||
<if test="createBy != null and createBy != '' ">create_by,</if>
|
||||
<if test="createDate != null ">create_date,</if>
|
||||
<if test="updateBy != null and updateBy != '' ">update_by,</if>
|
||||
<if test="updateDate != null ">update_date,</if>
|
||||
<if test="remarks != null and remarks != '' ">remarks,</if>
|
||||
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != '' ">#{id},</if>
|
||||
<if test="content != null and content != '' ">#{content},</if>
|
||||
<if test="number != null and number != '' ">#{number},</if>
|
||||
<if test="examQuestionId != null and examQuestionId != '' ">#{examQuestionId},</if>
|
||||
<if test="createBy != null and createBy != '' ">#{createBy},</if>
|
||||
<if test="createDate != null ">#{createDate},</if>
|
||||
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
|
||||
<if test="updateDate != null ">#{updateDate},</if>
|
||||
<if test="remarks != null and remarks != '' ">#{remarks},</if>
|
||||
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateExamQuestionItem" parameterType="ExamQuestionItem">
|
||||
update exam_question_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="content != null and content != '' ">content = #{content},</if>
|
||||
<if test="number != null and number != '' ">number = #{number},</if>
|
||||
<if test="examQuestionId != null and examQuestionId != '' ">exam_question_id = #{examQuestionId},</if>
|
||||
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
|
||||
<if test="createDate != null ">create_date = #{createDate},</if>
|
||||
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
|
||||
<if test="updateDate != null ">update_date = #{updateDate},</if>
|
||||
<if test="remarks != null and remarks != '' ">remarks = #{remarks},</if>
|
||||
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExamQuestionItemById" parameterType="String">
|
||||
delete from exam_question_item where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamQuestionItemByIds" parameterType="String">
|
||||
delete from exam_question_item where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -20,11 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectExamQuestionVo">
|
||||
select id, title, answer, type, label, category_id, create_by, create_date, update_by, update_date, remarks, del_flag from exam_question
|
||||
</sql>
|
||||
id, title, answer, type, label, category_id, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||
|
||||
<select id="selectExamQuestionList" parameterType="ExamQuestion" resultMap="ExamQuestionResult">
|
||||
select
|
||||
<include refid="selectExamQuestionVo"/>
|
||||
from exam_question
|
||||
<where>
|
||||
<if test="id != null and id != '' "> and id = #{id}</if>
|
||||
<if test="title != null and title != '' "> and title = #{title}</if>
|
||||
|
|
@ -40,71 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectExamQuestionById" parameterType="String" resultMap="ExamQuestionResult">
|
||||
<include refid="selectExamQuestionVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertExamQuestion" parameterType="ExamQuestion">
|
||||
insert into exam_question
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != '' ">id,</if>
|
||||
<if test="title != null and title != '' ">title,</if>
|
||||
<if test="answer != null and answer != '' ">answer,</if>
|
||||
<if test="type != null and type != '' ">type,</if>
|
||||
<if test="label != null and label != '' ">label,</if>
|
||||
<if test="categoryId != null and categoryId != '' ">category_id,</if>
|
||||
<if test="createBy != null and createBy != '' ">create_by,</if>
|
||||
<if test="createDate != null ">create_date,</if>
|
||||
<if test="updateBy != null and updateBy != '' ">update_by,</if>
|
||||
<if test="updateDate != null ">update_date,</if>
|
||||
<if test="remarks != null and remarks != '' ">remarks,</if>
|
||||
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != '' ">#{id},</if>
|
||||
<if test="title != null and title != '' ">#{title},</if>
|
||||
<if test="answer != null and answer != '' ">#{answer},</if>
|
||||
<if test="type != null and type != '' ">#{type},</if>
|
||||
<if test="label != null and label != '' ">#{label},</if>
|
||||
<if test="categoryId != null and categoryId != '' ">#{categoryId},</if>
|
||||
<if test="createBy != null and createBy != '' ">#{createBy},</if>
|
||||
<if test="createDate != null ">#{createDate},</if>
|
||||
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
|
||||
<if test="updateDate != null ">#{updateDate},</if>
|
||||
<if test="remarks != null and remarks != '' ">#{remarks},</if>
|
||||
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateExamQuestion" parameterType="ExamQuestion">
|
||||
update exam_question
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null and title != '' ">title = #{title},</if>
|
||||
<if test="answer != null and answer != '' ">answer = #{answer},</if>
|
||||
<if test="type != null and type != '' ">type = #{type},</if>
|
||||
<if test="label != null and label != '' ">label = #{label},</if>
|
||||
<if test="categoryId != null and categoryId != '' ">category_id = #{categoryId},</if>
|
||||
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
|
||||
<if test="createDate != null ">create_date = #{createDate},</if>
|
||||
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
|
||||
<if test="updateDate != null ">update_date = #{updateDate},</if>
|
||||
<if test="remarks != null and remarks != '' ">remarks = #{remarks},</if>
|
||||
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExamQuestionById" parameterType="String">
|
||||
delete from exam_question where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamQuestionByIds" parameterType="String">
|
||||
delete from exam_question where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -58,14 +58,14 @@ public abstract class AbstractBaseServiceImpl<M extends MyMapper<T>, T> implemen
|
|||
|
||||
@Override
|
||||
public int insert(T entity) {
|
||||
EntityUtils.setCreatAndUpdatInfo(entity);
|
||||
EntityUtils.setCreateAndUpdateInfo(entity);
|
||||
return mapper.insert(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insertSelective(T entity) {
|
||||
EntityUtils.setCreatAndUpdatInfo(entity);
|
||||
EntityUtils.setUpdatedInfo(entity);
|
||||
return mapper.insertSelective(entity);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,65 +1,72 @@
|
|||
package com.ruoyi.framework.web.util;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 实体类相关工具类
|
||||
* 实体类相关工具类
|
||||
* 解决问题: 1、快速对实体的常驻字段,如:createUser、updateUser等值快速注入
|
||||
*
|
||||
*
|
||||
* @author Ace
|
||||
* @version 1.0
|
||||
* @date 2016年4月18日
|
||||
* @since 1.7
|
||||
*/
|
||||
public class EntityUtils {
|
||||
/**
|
||||
* 快速将bean的crtUser、crtHost、crtTime、updUser、updHost、updTime附上相关值
|
||||
*
|
||||
* @param entity 实体bean
|
||||
* @author 王浩彬
|
||||
*/
|
||||
public static <T> void setCreatAndUpdatInfo(T entity) {
|
||||
setCreateInfo(entity);
|
||||
setUpdatedInfo(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 快速将bean的crtUser、crtHost、crtTime附上相关值
|
||||
*
|
||||
* @param entity 实体bean
|
||||
* @author 王浩彬
|
||||
*/
|
||||
public static <T> void setCreateInfo(T entity){
|
||||
try {
|
||||
Method[] methods = entity.getClass().getMethods();
|
||||
for(Method m : methods){
|
||||
if(m.getName().equals("setCreateBy")){
|
||||
m.invoke(entity, com.ruoyi.framework.web.util.ShiroUtils.getUserId());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 快速将bean的crtUser、crtHost、crtTime、updUser、updHost、updTime附上相关值
|
||||
*
|
||||
* @param entity 实体bean
|
||||
* @author 王浩彬
|
||||
*/
|
||||
public static <T> void setCreateAndUpdateInfo(T entity) {
|
||||
setCreateInfo( entity );
|
||||
setUpdatedInfo( entity );
|
||||
}
|
||||
|
||||
/**
|
||||
* 快速将bean的updUser、updHost、updTime附上相关值
|
||||
*
|
||||
* @param entity 实体bean
|
||||
* @author 王浩彬
|
||||
*/
|
||||
public static <T> void setUpdatedInfo(T entity){
|
||||
try {
|
||||
Method[] methods = entity.getClass().getMethods();
|
||||
for(Method m : methods){
|
||||
if(m.getName().equals("setUpdateBy")){
|
||||
m.invoke(entity, com.ruoyi.framework.web.util.ShiroUtils.getUserId());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 快速将bean的crtUser、crtHost、crtTime附上相关值
|
||||
*
|
||||
* @param entity 实体bean
|
||||
* @author 王浩彬
|
||||
*/
|
||||
public static <T> void setCreateInfo(T entity) {
|
||||
try {
|
||||
Method[] methods = entity.getClass().getMethods();
|
||||
for (Method m : methods) {
|
||||
if (m.getName().equals( "setCreateBy" )) {
|
||||
m.invoke( entity,com.ruoyi.framework.web.util.ShiroUtils.getLoginName() );
|
||||
} else if (m.getName().equals( "setCreateDate" )) {
|
||||
m.invoke( entity, new Date() );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 快速将bean的updUser、updHost、updTime附上相关值
|
||||
*
|
||||
* @param entity 实体bean
|
||||
* @author 王浩彬
|
||||
*/
|
||||
public static <T> void setUpdatedInfo(T entity) {
|
||||
try {
|
||||
Method[] methods = entity.getClass().getMethods();
|
||||
for (Method m : methods) {
|
||||
if (m.getName().equals( "setUpdateBy" )) {
|
||||
m.invoke( entity,com.ruoyi.framework.web.util.ShiroUtils.getLoginName());
|
||||
} else if (m.getName().equals( "setUpdateDate" )) {
|
||||
m.invoke( entity, new Date() );
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 参数配置表 sys_config
|
||||
*
|
||||
|
|
@ -16,6 +18,7 @@ public class SysConfig extends BaseEntity
|
|||
|
||||
/** 参数主键 */
|
||||
@Excel(name = "参数主键")
|
||||
@Id
|
||||
private Long configId;
|
||||
|
||||
/** 参数名称 */
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
|||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
|
|
@ -14,6 +16,7 @@ public class SysDept extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 部门ID */
|
||||
@Id
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID */
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 字典数据表 sys_dict_data
|
||||
*
|
||||
|
|
@ -16,6 +18,7 @@ public class SysDictData extends BaseEntity
|
|||
|
||||
/** 字典编码 */
|
||||
@Excel(name = "字典编码")
|
||||
@Id
|
||||
private Long dictCode;
|
||||
|
||||
/** 字典排序 */
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 字典类型表 sys_dict_type
|
||||
*
|
||||
|
|
@ -16,6 +18,7 @@ public class SysDictType extends BaseEntity
|
|||
|
||||
/** 字典主键 */
|
||||
@Excel(name = "字典主键")
|
||||
@Id
|
||||
private Long dictId;
|
||||
|
||||
/** 字典名称 */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import java.util.Date;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 系统访问记录表 sys_logininfor
|
||||
*
|
||||
|
|
@ -17,6 +19,7 @@ public class SysLogininfor extends BaseEntity
|
|||
|
||||
/** ID */
|
||||
@Excel(name = "序号")
|
||||
@Id
|
||||
private Long infoId;
|
||||
|
||||
/** 用户账号 */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 菜单权限表 sys_menu
|
||||
*
|
||||
|
|
@ -16,6 +18,7 @@ public class SysMenu extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 菜单ID */
|
||||
@Id
|
||||
private Long menuId;
|
||||
|
||||
/** 菜单名称 */
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
|||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 通知公告表 sys_notice
|
||||
*
|
||||
|
|
@ -14,6 +16,7 @@ public class SysNotice extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 公告ID */
|
||||
@Id
|
||||
private Long noticeId;
|
||||
|
||||
/** 公告标题 */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import java.util.Date;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 操作日志记录表 oper_log
|
||||
*
|
||||
|
|
@ -17,6 +19,7 @@ public class SysOperLog extends BaseEntity
|
|||
|
||||
/** 日志主键 */
|
||||
@Excel(name = "操作序号")
|
||||
@Id
|
||||
private Long operId;
|
||||
|
||||
/** 操作模块 */
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 岗位表 sys_post
|
||||
*
|
||||
|
|
@ -16,6 +18,7 @@ public class SysPost extends BaseEntity
|
|||
|
||||
/** 岗位序号 */
|
||||
@Excel(name = "岗位序号")
|
||||
@Id
|
||||
private Long postId;
|
||||
|
||||
/** 岗位编码 */
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 角色表 sys_role
|
||||
*
|
||||
|
|
@ -16,6 +18,7 @@ public class SysRole extends BaseEntity
|
|||
|
||||
/** 角色ID */
|
||||
@Excel(name = "角色序号")
|
||||
@Id
|
||||
private Long roleId;
|
||||
|
||||
/** 角色名称 */
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.ruoyi.system.domain;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 角色和部门关联 sys_role_dept
|
||||
*
|
||||
|
|
@ -11,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
public class SysRoleDept
|
||||
{
|
||||
/** 角色ID */
|
||||
@Id
|
||||
private Long roleId;
|
||||
|
||||
/** 部门ID */
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.ruoyi.system.domain;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 角色和菜单关联 sys_role_menu
|
||||
*
|
||||
|
|
@ -11,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
public class SysRoleMenu
|
||||
{
|
||||
/** 角色ID */
|
||||
@Id
|
||||
private Long roleId;
|
||||
|
||||
/** 菜单ID */
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import java.util.List;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
|
|
@ -18,6 +20,7 @@ public class SysUser extends BaseEntity
|
|||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户序号")
|
||||
@Id
|
||||
private Long userId;
|
||||
|
||||
/** 部门ID */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.base.BaseEntity;
|
||||
import com.ruoyi.common.enums.OnlineStatus;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 当前在线会话 sys_user_online
|
||||
*
|
||||
|
|
@ -16,6 +18,7 @@ public class SysUserOnline extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户会话id */
|
||||
@Id
|
||||
private String sessionId;
|
||||
|
||||
/** 部门名称 */
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.ruoyi.system.domain;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 用户和岗位关联 sys_user_post
|
||||
*
|
||||
|
|
@ -11,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
public class SysUserPost
|
||||
{
|
||||
/** 用户ID */
|
||||
@Id
|
||||
private Long userId;
|
||||
|
||||
/** 岗位ID */
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.ruoyi.system.domain;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 用户和角色关联 sys_user_role
|
||||
*
|
||||
|
|
@ -11,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
public class SysUserRole
|
||||
{
|
||||
/** 用户ID */
|
||||
@Id
|
||||
private Long userId;
|
||||
|
||||
/** 角色ID */
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
package com.ruoyi.agile.domain;
|
||||
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Id;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
|
|
@ -17,6 +18,7 @@ public class GenTableColumn extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@Id
|
||||
private String id;
|
||||
/** 表名 */
|
||||
private String tableName;
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@ package com.ruoyi.agile.mapper;
|
|||
|
||||
import com.ruoyi.agile.domain.GenTable;
|
||||
import com.ruoyi.framework.web.base.MyMapper;
|
||||
import com.ruoyi.generator.domain.TableInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代码生成 数据层
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.ruoyi.generator.domain;
|
|||
import com.ruoyi.common.json.JSON;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* ry数据库表列信息
|
||||
*
|
||||
|
|
@ -11,6 +13,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
public class ColumnInfo
|
||||
{
|
||||
/** 字段名称 */
|
||||
@Id
|
||||
private String columnName;
|
||||
|
||||
/** 字段类型 */
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import java.util.List;
|
|||
import com.ruoyi.common.base.BaseEntity;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* ry 数据库表
|
||||
*
|
||||
|
|
@ -14,6 +16,7 @@ public class TableInfo extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 表名称 */
|
||||
@Id
|
||||
private String tableName;
|
||||
|
||||
/** 表描述 */
|
||||
|
|
|
|||
|
|
@ -27,112 +27,103 @@ import com.ruoyi.generator.util.VelocityInitializer;
|
|||
|
||||
/**
|
||||
* 代码生成 服务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class GenServiceImpl extends AbstractBaseServiceImpl<GenMapper,TableInfo> implements IGenService {
|
||||
private static final Logger log = LoggerFactory.getLogger(GenServiceImpl.class);
|
||||
public class GenServiceImpl extends AbstractBaseServiceImpl<GenMapper, TableInfo> implements IGenService {
|
||||
private static final Logger log = LoggerFactory.getLogger( GenServiceImpl.class );
|
||||
|
||||
|
||||
/**
|
||||
* 查询ry数据库表信息
|
||||
*
|
||||
*
|
||||
* @param tableInfo 表信息
|
||||
* @return 数据库表列表
|
||||
*/
|
||||
@Override
|
||||
public List<TableInfo> selectTableList(TableInfo tableInfo)
|
||||
{
|
||||
public List<TableInfo> selectTableList(TableInfo tableInfo) {
|
||||
startPage();
|
||||
return mapper.selectTableList(tableInfo);
|
||||
return mapper.selectTableList( tableInfo );
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成代码
|
||||
*
|
||||
*
|
||||
* @param tableName 表名称
|
||||
* @return 数据
|
||||
*/
|
||||
@Override
|
||||
public byte[] generatorCode(String tableName)
|
||||
{
|
||||
public byte[] generatorCode(String tableName) {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
||||
ZipOutputStream zip = new ZipOutputStream( outputStream );
|
||||
// 查询表信息
|
||||
TableInfo table = mapper.selectTableByName(tableName);
|
||||
TableInfo table = mapper.selectTableByName( tableName );
|
||||
// 查询列信息
|
||||
List<ColumnInfo> columns = mapper.selectTableColumnsByName(tableName);
|
||||
List<ColumnInfo> columns = mapper.selectTableColumnsByName( tableName );
|
||||
// 生成代码
|
||||
generatorCode(table, columns, zip);
|
||||
IOUtils.closeQuietly(zip);
|
||||
generatorCode( table, columns, zip );
|
||||
IOUtils.closeQuietly( zip );
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成代码
|
||||
*
|
||||
*
|
||||
* @param tableNames 表数组
|
||||
* @return 数据
|
||||
*/
|
||||
@Override
|
||||
public byte[] generatorCode(String[] tableNames)
|
||||
{
|
||||
public byte[] generatorCode(String[] tableNames) {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
||||
for (String tableName : tableNames)
|
||||
{
|
||||
ZipOutputStream zip = new ZipOutputStream( outputStream );
|
||||
for (String tableName : tableNames) {
|
||||
// 查询表信息
|
||||
TableInfo table = mapper.selectTableByName(tableName);
|
||||
TableInfo table = mapper.selectTableByName( tableName );
|
||||
// 查询列信息
|
||||
List<ColumnInfo> columns = mapper.selectTableColumnsByName(tableName);
|
||||
List<ColumnInfo> columns = mapper.selectTableColumnsByName( tableName );
|
||||
// 生成代码
|
||||
generatorCode(table, columns, zip);
|
||||
generatorCode( table, columns, zip );
|
||||
}
|
||||
IOUtils.closeQuietly(zip);
|
||||
IOUtils.closeQuietly( zip );
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成代码
|
||||
*/
|
||||
public void generatorCode(TableInfo table, List<ColumnInfo> columns, ZipOutputStream zip)
|
||||
{
|
||||
public void generatorCode(TableInfo table, List<ColumnInfo> columns, ZipOutputStream zip) {
|
||||
// 表名转换成Java属性名
|
||||
String className = GenUtils.tableToJava(table.getTableName());
|
||||
table.setClassName(className);
|
||||
table.setClassname(StringUtils.uncapitalize(className));
|
||||
String className = GenUtils.tableToJava( table.getTableName() );
|
||||
table.setClassName( className );
|
||||
table.setClassname( StringUtils.uncapitalize( className ) );
|
||||
// 列信息
|
||||
table.setColumns(GenUtils.transColums(columns));
|
||||
table.setColumns( GenUtils.transColums( columns ) );
|
||||
// 设置主键
|
||||
table.setPrimaryKey(table.getColumnsLast());
|
||||
table.setPrimaryKey( table.getColumnsLast() );
|
||||
|
||||
VelocityInitializer.initVelocity();
|
||||
|
||||
String packageName = Global.getPackageName();
|
||||
String moduleName = GenUtils.getModuleName(packageName);
|
||||
String moduleName = GenUtils.getModuleName( packageName );
|
||||
|
||||
VelocityContext context = GenUtils.getVelocityContext(table);
|
||||
VelocityContext context = GenUtils.getVelocityContext( table );
|
||||
|
||||
// 获取模板列表
|
||||
List<String> templates = GenUtils.getTemplates();
|
||||
for (String template : templates)
|
||||
{
|
||||
for (String template : templates) {
|
||||
// 渲染模板
|
||||
StringWriter sw = new StringWriter();
|
||||
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
||||
tpl.merge(context, sw);
|
||||
try
|
||||
{
|
||||
Template tpl = Velocity.getTemplate( template, Constants.UTF8 );
|
||||
tpl.merge( context, sw );
|
||||
try {
|
||||
// 添加到zip
|
||||
zip.putNextEntry(new ZipEntry(GenUtils.getFileName(template, table, moduleName)));
|
||||
IOUtils.write(sw.toString(), zip, Constants.UTF8);
|
||||
IOUtils.closeQuietly(sw);
|
||||
zip.putNextEntry( new ZipEntry( GenUtils.getFileName( template, table, moduleName ) ) );
|
||||
IOUtils.write( sw.toString(), zip, Constants.UTF8 );
|
||||
IOUtils.closeQuietly( sw );
|
||||
zip.closeEntry();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("渲染模板失败,表名:" + table.getTableName(), e);
|
||||
} catch (IOException e) {
|
||||
log.error( "渲染模板失败,表名:" + table.getTableName(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,32 @@
|
|||
package com.ruoyi.generator.util;
|
||||
|
||||
import java.util.Properties;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* VelocityEngine工厂
|
||||
*
|
||||
*
|
||||
* @author RuoYi
|
||||
*/
|
||||
public class VelocityInitializer
|
||||
{
|
||||
public class VelocityInitializer {
|
||||
/**
|
||||
* 初始化vm方法
|
||||
*/
|
||||
public static void initVelocity()
|
||||
{
|
||||
public static void initVelocity() {
|
||||
Properties p = new Properties();
|
||||
try
|
||||
{
|
||||
try {
|
||||
// 加载classpath目录下的vm文件
|
||||
p.setProperty("file.resource.loader.class",
|
||||
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
||||
p.setProperty( "file.resource.loader.class" ,
|
||||
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader" );
|
||||
// 定义字符集
|
||||
p.setProperty(Velocity.ENCODING_DEFAULT, Constants.UTF8);
|
||||
p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8);
|
||||
p.setProperty( Velocity.ENCODING_DEFAULT, Constants.UTF8 );
|
||||
p.setProperty( Velocity.OUTPUT_ENCODING, Constants.UTF8 );
|
||||
// 初始化Velocity引擎,指定配置Properties
|
||||
Velocity.init(p);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
Velocity.init( p );
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.agile.mapper.GenTableColumnMapper">
|
||||
<mapper namespace="com.ruoyi.agile.mapper.GenTableColumnAllMapper">
|
||||
|
||||
<resultMap type="GenTableColumn" id="GenTableColumnResult">
|
||||
<result property="id" column="id" />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.agile.mapper.GenTableMapper">
|
||||
<mapper namespace="com.ruoyi.agile.mapper.GenTableAllMapper">
|
||||
|
||||
<resultMap type="GenTable" id="GenTableResult">
|
||||
<result property="id" column="id" />
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class ${className}Controller extends BaseController
|
|||
@ResponseBody
|
||||
public TableDataInfo list(${className} ${classname})
|
||||
{
|
||||
List<${className}> list = ${classname}Service.select${className}List(${classname});
|
||||
List<${className}> list = ${classname}Service.select${className}Page(${classname});
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ public class ${className}Controller extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(${className} ${classname})
|
||||
{
|
||||
return toAjax(${classname}Service.insert${className}(${classname}));
|
||||
return toAjax(${classname}Service.insert(${classname}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -94,7 +94,7 @@ public class ${className}Controller extends BaseController
|
|||
@GetMapping("/edit/{${primaryKey.attrname}}")
|
||||
public String edit(@PathVariable("${primaryKey.attrname}") ${primaryKey.attrType} ${primaryKey.attrname}, ModelMap mmap)
|
||||
{
|
||||
${className} ${classname} = ${classname}Service.select${className}ById(${primaryKey.attrname});
|
||||
${className} ${classname} = ${classname}Service.selectById(${primaryKey.attrname});
|
||||
mmap.put("${classname}", ${classname});
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ public class ${className}Controller extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(${className} ${classname})
|
||||
{
|
||||
return toAjax(${classname}Service.update${className}(${classname}));
|
||||
return toAjax(${classname}Service.updateById(${classname}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -120,7 +120,7 @@ public class ${className}Controller extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(${classname}Service.delete${className}ByIds(ids));
|
||||
return toAjax(${classname}Service.deleteByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,14 +12,7 @@ import com.ruoyi.framework.web.base.MyMapper;
|
|||
*/
|
||||
public interface ${className}Mapper extends MyMapper<${className}>
|
||||
{
|
||||
/**
|
||||
* 查询${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return ${tableComment}信息
|
||||
*/
|
||||
public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname});
|
||||
|
||||
|
||||
/**
|
||||
* 查询${tableComment}列表
|
||||
*
|
||||
|
|
@ -28,36 +21,4 @@ public interface ${className}Mapper extends MyMapper<${className}>
|
|||
*/
|
||||
public List<${className}> select${className}List(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 新增${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 修改${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int update${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 删除${tableComment}
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname});
|
||||
|
||||
/**
|
||||
* 批量删除${tableComment}
|
||||
*
|
||||
* @param ${primaryKey.attrname}s 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int delete${className}ByIds(String[] ${primaryKey.attrname}s);
|
||||
|
||||
}
|
||||
|
|
@ -12,43 +12,19 @@ import com.ruoyi.framework.web.base.AbstractBaseService;
|
|||
public interface I${className}Service extends AbstractBaseService<${className}>
|
||||
{
|
||||
/**
|
||||
* 查询${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return ${tableComment}信息
|
||||
*/
|
||||
public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname});
|
||||
|
||||
/**
|
||||
* 查询${tableComment}列表
|
||||
*
|
||||
* 查询${tableComment}分页列表
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return ${tableComment}集合
|
||||
*/
|
||||
public List<${className}> select${className}List(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 新增${tableComment}
|
||||
*
|
||||
public List<${className}> select${className}Page(${className} ${classname});
|
||||
/**
|
||||
* 查询${tableComment}列表
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
* @return ${tableComment}集合
|
||||
*/
|
||||
public int insert${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 修改${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int update${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 删除${tableComment}信息
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int delete${className}ByIds(String ids);
|
||||
public List<${className}> select${className}List(${className} ${classname});
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,17 +20,6 @@ public class ${className}ServiceImpl extends AbstractBaseServiceImpl<${className
|
|||
@Autowired
|
||||
private ${className}Mapper ${classname}Mapper;
|
||||
|
||||
/**
|
||||
* 查询${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return ${tableComment}信息
|
||||
*/
|
||||
@Override
|
||||
public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname})
|
||||
{
|
||||
return ${classname}Mapper.select${className}ById(${primaryKey.attrname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询${tableComment}列表
|
||||
|
|
@ -41,44 +30,19 @@ public class ${className}ServiceImpl extends AbstractBaseServiceImpl<${className
|
|||
@Override
|
||||
public List<${className}> select${className}List(${className} ${classname})
|
||||
{
|
||||
startPage();
|
||||
return ${classname}Mapper.select${className}List(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增${tableComment}
|
||||
*
|
||||
* 查询${tableComment}分页列表
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
* @return ${tableComment}集合
|
||||
*/
|
||||
@Override
|
||||
public int insert${className}(${className} ${classname})
|
||||
{
|
||||
return ${classname}Mapper.insert${className}(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int update${className}(${className} ${classname})
|
||||
{
|
||||
return ${classname}Mapper.update${className}(${classname});
|
||||
}
|
||||
@Override
|
||||
public List<${className}> select${className}Page(${className} ${classname})
|
||||
{
|
||||
startPage();
|
||||
return ${classname}Mapper.select${className}List(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除${tableComment}对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int delete${className}ByIds(String ids)
|
||||
{
|
||||
return ${classname}Mapper.delete${className}ByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,44 +4,52 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
|||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
#foreach ($column in $columns)
|
||||
#if($column.attrType == 'Date')
|
||||
import java.util.Date;
|
||||
#break
|
||||
#end
|
||||
#if($column.attrType == 'Date')
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${tableComment}表 ${tableName}
|
||||
*
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
public class ${className}
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
#foreach ($column in $columns)
|
||||
/** $column.columnComment */
|
||||
private $column.attrType $column.attrname;
|
||||
#end
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
#foreach ($column in $columns)
|
||||
public void set${column.attrName}($column.attrType $column.attrname)
|
||||
{
|
||||
this.$column.attrname = $column.attrname;
|
||||
}
|
||||
|
||||
public $column.attrType get${column.attrName}()
|
||||
{
|
||||
return $column.attrname;
|
||||
}
|
||||
/** $column.columnComment */
|
||||
#if($column.columnName == $primaryKey.columnName)
|
||||
@Id
|
||||
private $column.attrType $column.attrname;
|
||||
#else
|
||||
private $column.attrType $column.attrname;
|
||||
#end
|
||||
#end
|
||||
|
||||
public String toString() {
|
||||
#foreach ($column in $columns)
|
||||
/** 设置$column.columnComment */
|
||||
public void set${column.attrName}($column.attrType $column.attrname)
|
||||
{
|
||||
this.$column.attrname = $column.attrname;
|
||||
}
|
||||
|
||||
/** 获取$column.columnComment */
|
||||
public $column.attrType get${column.attrName}()
|
||||
{
|
||||
return $column.attrname;
|
||||
}
|
||||
#end
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
#foreach ($column in $columns)
|
||||
#foreach ($column in $columns)
|
||||
.append("${column.attrname}", get${column.attrName}())
|
||||
#end
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
#end
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,62 +11,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="select${className}Vo">
|
||||
select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end from ${tableName}
|
||||
#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end
|
||||
</sql>
|
||||
|
||||
<select id="select${className}List" parameterType="${className}" resultMap="${className}Result">
|
||||
select
|
||||
<include refid="select${className}Vo"/>
|
||||
from ${tableName}
|
||||
<where>
|
||||
#foreach($column in $columns)
|
||||
<if test="$column.attrname != null #if($column.attrType == 'String' ) and $column.attrname.trim() != '' #end"> and $column.columnName = #{$column.attrname}</if>
|
||||
#end
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="select${className}ById" parameterType="${primaryKey.attrType}" resultMap="${className}Result">
|
||||
<include refid="select${className}Vo"/>
|
||||
where ${primaryKey.columnName} = #{${primaryKey.attrname}}
|
||||
</select>
|
||||
|
||||
<insert id="insert${className}" parameterType="${className}"#if($primaryKey.extra == 'auto_increment') useGeneratedKeys="true" keyProperty="$primaryKey.attrname"#end>
|
||||
insert into ${tableName}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName || $primaryKey.extra != 'auto_increment')
|
||||
<if test="$column.attrname != null #if($column.attrType == 'String' ) and $column.attrname != '' #end ">$column.columnName,</if>
|
||||
#end
|
||||
#end
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName || $primaryKey.extra != 'auto_increment')
|
||||
<if test="$column.attrname != null #if($column.attrType == 'String' ) and $column.attrname != '' #end ">#{$column.attrname},</if>
|
||||
#end
|
||||
#end
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="update${className}" parameterType="${className}">
|
||||
update ${tableName}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName)
|
||||
<if test="$column.attrname != null #if($column.attrType == 'String' ) and $column.attrname != '' #end ">$column.columnName = #{$column.attrname},</if>
|
||||
#end
|
||||
#end
|
||||
</trim>
|
||||
where ${primaryKey.columnName} = #{${primaryKey.attrname}}
|
||||
</update>
|
||||
|
||||
<delete id="delete${className}ById" parameterType="${primaryKey.attrType}">
|
||||
delete from ${tableName} where ${primaryKey.columnName} = #{${primaryKey.attrname}}
|
||||
</delete>
|
||||
|
||||
<delete id="delete${className}ByIds" parameterType="String">
|
||||
delete from ${tableName} where ${primaryKey.columnName} in
|
||||
<foreach item="${primaryKey.attrname}" collection="array" open="(" separator="," close=")">
|
||||
#{${primaryKey.attrname}}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
<version>3.0</version>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.quartz.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.framework.web.base.MyMapper;
|
||||
import com.ruoyi.quartz.domain.SysJob;
|
||||
import com.ruoyi.quartz.domain.SysJobLog;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
|
@ -11,8 +12,7 @@ import tk.mybatis.mapper.common.Mapper;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysJobLogMapper extends Mapper<SysJobLog>
|
||||
{
|
||||
public interface SysJobLogMapper extends Mapper<SysJobLog>,MyMapper<SysJobLog> {
|
||||
/**
|
||||
* 获取quartz调度器日志的计划任务
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.quartz.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.framework.web.base.MyMapper;
|
||||
import com.ruoyi.quartz.domain.SysJob;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
|
@ -10,8 +12,7 @@ import tk.mybatis.mapper.common.Mapper;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysJobMapper extends Mapper<SysJob>
|
||||
{
|
||||
public interface SysJobMapper extends Mapper<SysJob>,MyMapper<SysJob> {
|
||||
/**
|
||||
* 查询调度任务日志集合
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-train</artifactId>
|
||||
|
||||
<description>
|
||||
培训系统
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package com.ruoyi.course.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.course.domain.TrainCourseCategory;
|
||||
import com.ruoyi.course.service.ITrainCourseCategoryService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.framework.web.util.ShiroUtils;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 部门信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/train/course/category")
|
||||
public class TrainCourseCategoryController extends BaseController
|
||||
{
|
||||
private String prefix = "course/category";
|
||||
|
||||
@Autowired
|
||||
private ITrainCourseCategoryService trainCourseCategoryService;
|
||||
|
||||
@RequiresPermissions("train:course:category:view")
|
||||
@GetMapping()
|
||||
public String dept()
|
||||
{
|
||||
return prefix + "/dept";
|
||||
}
|
||||
|
||||
@RequiresPermissions("train:course:category:list")
|
||||
@GetMapping("/list")
|
||||
@ResponseBody
|
||||
public List<TrainCourseCategory> list(TrainCourseCategory dept)
|
||||
{
|
||||
List<TrainCourseCategory> deptList = trainCourseCategoryService.selectDeptList(dept);
|
||||
return deptList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
@GetMapping("/add/{parentId}")
|
||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dept", trainCourseCategoryService.selectDeptById(parentId));
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存部门
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@RequiresPermissions("train:course:category:add")
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(TrainCourseCategory dept)
|
||||
{
|
||||
dept.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(trainCourseCategoryService.insertDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@GetMapping("/edit/{deptId}")
|
||||
public String edit(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
TrainCourseCategory dept = trainCourseCategoryService.selectDeptById(deptId);
|
||||
if (StringUtils.isNotNull(dept) && 100L == deptId)
|
||||
{
|
||||
dept.setParentName("无");
|
||||
}
|
||||
mmap.put("dept", dept);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("train:course:category:edit")
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(TrainCourseCategory dept)
|
||||
{
|
||||
dept.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(trainCourseCategoryService.updateDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("train:course:category:remove")
|
||||
@PostMapping("/remove/{deptId}")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(@PathVariable("deptId") Long deptId)
|
||||
{
|
||||
if (trainCourseCategoryService.selectDeptCount(deptId) > 0)
|
||||
{
|
||||
return error(1, "存在下级部门,不允许删除");
|
||||
}
|
||||
if (trainCourseCategoryService.checkDeptExistUser(deptId))
|
||||
{
|
||||
return error(1, "部门存在用户,不允许删除");
|
||||
}
|
||||
return toAjax(trainCourseCategoryService.deleteDeptById(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验部门名称
|
||||
*/
|
||||
@PostMapping("/checkDeptNameUnique")
|
||||
@ResponseBody
|
||||
public String checkDeptNameUnique(TrainCourseCategory dept)
|
||||
{
|
||||
return trainCourseCategoryService.checkDeptNameUnique(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择部门树
|
||||
*/
|
||||
@GetMapping("/selectDeptTree/{deptId}")
|
||||
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dept", trainCourseCategoryService.selectDeptById(deptId));
|
||||
return prefix + "/tree";
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载部门列表树
|
||||
*/
|
||||
@GetMapping("/treeData")
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> treeData()
|
||||
{
|
||||
List<Map<String, Object>> tree = trainCourseCategoryService.selectDeptTree();
|
||||
return tree;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
package com.ruoyi.course.domain;
|
||||
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TrainCourseCategory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 分类ID */
|
||||
@Id
|
||||
private Long id;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private Long deptId;
|
||||
/** 父部门ID */
|
||||
private Long parentId;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String parentIds;
|
||||
|
||||
/** 部门名称 */
|
||||
private String name;
|
||||
|
||||
/** 显示顺序 */
|
||||
private String orderNum;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 父部门名称 */
|
||||
private String parentName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getParentIds() {
|
||||
return parentIds;
|
||||
}
|
||||
|
||||
public void setParentIds(String parentIds) {
|
||||
this.parentIds = parentIds;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(String orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getParentName()
|
||||
{
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName)
|
||||
{
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("parentId", getParentId())
|
||||
.append("ancestors", getParentIds())
|
||||
.append("deptName", getName())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.ruoyi.course.mapper;
|
||||
|
||||
import com.ruoyi.course.domain.TrainCourseCategory;
|
||||
import com.ruoyi.framework.web.base.MyMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface TrainCourseCategoryMapper extends MyMapper<TrainCourseCategory>
|
||||
{
|
||||
/**
|
||||
* 查询部门人数
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectDeptCount(TrainCourseCategory dept);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int checkDeptExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<TrainCourseCategory> selectDeptList(TrainCourseCategory dept);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 新增部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(TrainCourseCategory dept);
|
||||
|
||||
/**
|
||||
* 修改部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDept(TrainCourseCategory dept);
|
||||
|
||||
/**
|
||||
* 修改子元素关系
|
||||
*
|
||||
* @param depts 子元素
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeptChildren(@Param("depts") List<TrainCourseCategory> depts);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public TrainCourseCategory selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @param parentId 父部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public TrainCourseCategory checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 部门列表
|
||||
*/
|
||||
public List<String> selectRoleDeptTree(Long roleId);
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.ruoyi.course.service;
|
||||
|
||||
import com.ruoyi.course.domain.TrainCourseCategory;
|
||||
import com.ruoyi.framework.web.base.AbstractBaseService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 部门管理 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ITrainCourseCategoryService extends AbstractBaseService<TrainCourseCategory>
|
||||
{
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<TrainCourseCategory> selectDeptList(TrainCourseCategory dept);
|
||||
|
||||
/**
|
||||
* 查询部门管理树
|
||||
*
|
||||
* @return 所有部门信息
|
||||
*/
|
||||
public List<Map<String, Object>> selectDeptTree();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询部门人数
|
||||
*
|
||||
* @param parentId 父部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectDeptCount(Long parentId);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
public boolean checkDeptExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 新增保存部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(TrainCourseCategory dept);
|
||||
|
||||
/**
|
||||
* 修改保存部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDept(TrainCourseCategory dept);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public TrainCourseCategory selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkDeptNameUnique(TrainCourseCategory dept);
|
||||
}
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
package com.ruoyi.course.service.impl;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.course.domain.TrainCourseCategory;
|
||||
import com.ruoyi.course.mapper.TrainCourseCategoryMapper;
|
||||
import com.ruoyi.course.service.ITrainCourseCategoryService;
|
||||
import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<TrainCourseCategoryMapper, TrainCourseCategory> implements ITrainCourseCategoryService {
|
||||
@Autowired
|
||||
private TrainCourseCategoryMapper trainCourseCategoryMapper;
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
@Override
|
||||
@DataScope(tableAlias = "d")
|
||||
public List<TrainCourseCategory> selectDeptList(TrainCourseCategory dept) {
|
||||
return trainCourseCategoryMapper.selectDeptList( dept );
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门管理树
|
||||
*
|
||||
* @return 所有部门信息
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectDeptTree() {
|
||||
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
|
||||
List<TrainCourseCategory> deptList = selectDeptList( new TrainCourseCategory() );
|
||||
trees = getTrees( deptList, false, null );
|
||||
return trees;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对象转部门树
|
||||
*
|
||||
* @param deptList 部门列表
|
||||
* @param isCheck 是否需要选中
|
||||
* @param roleDeptList 角色已存在菜单列表
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> getTrees(List<TrainCourseCategory> deptList, boolean isCheck, List<String> roleDeptList) {
|
||||
|
||||
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
|
||||
for (TrainCourseCategory dept : deptList) {
|
||||
if (UserConstants.DEPT_NORMAL.equals( dept.getDelFlag() )) {
|
||||
Map<String, Object> deptMap = new HashMap<String, Object>();
|
||||
deptMap.put( "id", dept.getId() );
|
||||
deptMap.put( "pId", dept.getParentId() );
|
||||
deptMap.put( "name", dept.getName() );
|
||||
deptMap.put( "title", dept.getName() );
|
||||
if (isCheck) {
|
||||
deptMap.put( "checked", roleDeptList.contains( dept.getDeptId() + dept.getName() ) );
|
||||
} else {
|
||||
deptMap.put( "checked", false );
|
||||
}
|
||||
trees.add( deptMap );
|
||||
}
|
||||
}
|
||||
return trees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门人数
|
||||
*
|
||||
* @param parentId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int selectDeptCount(Long parentId) {
|
||||
TrainCourseCategory dept = new TrainCourseCategory();
|
||||
dept.setParentId( parentId );
|
||||
return trainCourseCategoryMapper.selectDeptCount( dept );
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
@Override
|
||||
public boolean checkDeptExistUser(Long deptId) {
|
||||
int result = trainCourseCategoryMapper.checkDeptExistUser( deptId );
|
||||
return result > 0 ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeptById(Long deptId) {
|
||||
return trainCourseCategoryMapper.deleteDeptById( deptId );
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDept(TrainCourseCategory dept) {
|
||||
TrainCourseCategory info = trainCourseCategoryMapper.selectDeptById( dept.getParentId() );
|
||||
dept.setParentIds( info.getParentIds() + "," + dept.getParentId() );
|
||||
return trainCourseCategoryMapper.insertDept( dept );
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDept(TrainCourseCategory dept) {
|
||||
TrainCourseCategory info = trainCourseCategoryMapper.selectDeptById( dept.getParentId() );
|
||||
if (StringUtils.isNotNull( info )) {
|
||||
String ancestors = info.getParentIds() + "," + dept.getParentId();
|
||||
dept.setParentIds( ancestors );
|
||||
updateDeptChildren( dept.getDeptId(), ancestors );
|
||||
}
|
||||
return trainCourseCategoryMapper.updateDept( dept );
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改子元素关系
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param ancestors 元素列表
|
||||
*/
|
||||
public void updateDeptChildren(Long deptId, String ancestors) {
|
||||
TrainCourseCategory dept = new TrainCourseCategory();
|
||||
dept.setParentId( deptId );
|
||||
List<TrainCourseCategory> childrens = trainCourseCategoryMapper.selectDeptList( dept );
|
||||
for (TrainCourseCategory children : childrens) {
|
||||
children.setParentIds( ancestors + "," + dept.getParentId() );
|
||||
}
|
||||
if (childrens.size() > 0) {
|
||||
trainCourseCategoryMapper.updateDeptChildren( childrens );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
@Override
|
||||
public TrainCourseCategory selectDeptById(Long deptId) {
|
||||
return trainCourseCategoryMapper.selectDeptById( deptId );
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkDeptNameUnique(TrainCourseCategory dept) {
|
||||
Long deptId = StringUtils.isNull( dept.getDeptId() ) ? -1L : dept.getDeptId();
|
||||
TrainCourseCategory info = trainCourseCategoryMapper.checkDeptNameUnique( dept.getName(), dept.getParentId() );
|
||||
if (StringUtils.isNotNull( info ) && info.getDeptId().longValue() != deptId.longValue()) {
|
||||
return UserConstants.DEPT_NAME_NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.DEPT_NAME_UNIQUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package com.ruoyi.courseware.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.courseware.domain.TrainCoursewareCategory;
|
||||
import com.ruoyi.courseware.service.ITrainCoursewareCategoryService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.framework.web.util.ShiroUtils;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 部门信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/train/courseware/category")
|
||||
public class TrainCoursewareCategoryController extends BaseController
|
||||
{
|
||||
private String prefix = "courseware/category";
|
||||
|
||||
@Autowired
|
||||
private ITrainCoursewareCategoryService trainCoursewareCategoryService;
|
||||
|
||||
@RequiresPermissions("train:courseware:category:view")
|
||||
@GetMapping()
|
||||
public String dept()
|
||||
{
|
||||
return prefix + "/dept";
|
||||
}
|
||||
|
||||
@RequiresPermissions("train:courseware:category:list")
|
||||
@GetMapping("/list")
|
||||
@ResponseBody
|
||||
public List<TrainCoursewareCategory> list(TrainCoursewareCategory dept)
|
||||
{
|
||||
List<TrainCoursewareCategory> deptList = trainCoursewareCategoryService.selectDeptList(dept);
|
||||
return deptList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
@GetMapping("/add/{parentId}")
|
||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dept", trainCoursewareCategoryService.selectDeptById(parentId));
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存部门
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@RequiresPermissions("train:courseware:category:add")
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(TrainCoursewareCategory dept)
|
||||
{
|
||||
dept.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(trainCoursewareCategoryService.insertDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@GetMapping("/edit/{deptId}")
|
||||
public String edit(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
TrainCoursewareCategory dept = trainCoursewareCategoryService.selectDeptById(deptId);
|
||||
if (StringUtils.isNotNull(dept) && 100L == deptId)
|
||||
{
|
||||
dept.setParentName("无");
|
||||
}
|
||||
mmap.put("dept", dept);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("train:courseware:category:edit")
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(TrainCoursewareCategory dept)
|
||||
{
|
||||
dept.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(trainCoursewareCategoryService.updateDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("train:courseware:category:remove")
|
||||
@PostMapping("/remove/{deptId}")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(@PathVariable("deptId") Long deptId)
|
||||
{
|
||||
if (trainCoursewareCategoryService.selectDeptCount(deptId) > 0)
|
||||
{
|
||||
return error(1, "存在下级部门,不允许删除");
|
||||
}
|
||||
if (trainCoursewareCategoryService.checkDeptExistUser(deptId))
|
||||
{
|
||||
return error(1, "部门存在用户,不允许删除");
|
||||
}
|
||||
return toAjax(trainCoursewareCategoryService.deleteDeptById(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验部门名称
|
||||
*/
|
||||
@PostMapping("/checkDeptNameUnique")
|
||||
@ResponseBody
|
||||
public String checkDeptNameUnique(TrainCoursewareCategory dept)
|
||||
{
|
||||
return trainCoursewareCategoryService.checkDeptNameUnique(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择部门树
|
||||
*/
|
||||
@GetMapping("/selectDeptTree/{deptId}")
|
||||
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dept", trainCoursewareCategoryService.selectDeptById(deptId));
|
||||
return prefix + "/tree";
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载部门列表树
|
||||
*/
|
||||
@GetMapping("/treeData")
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> treeData()
|
||||
{
|
||||
List<Map<String, Object>> tree = trainCoursewareCategoryService.selectDeptTree();
|
||||
return tree;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
package com.ruoyi.courseware.domain;
|
||||
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TrainCoursewareCategory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 分类ID */
|
||||
@Id
|
||||
private Long id;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private Long deptId;
|
||||
/** 父部门ID */
|
||||
private Long parentId;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String parentIds;
|
||||
|
||||
/** 部门名称 */
|
||||
private String name;
|
||||
|
||||
/** 显示顺序 */
|
||||
private String orderNum;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 父部门名称 */
|
||||
private String parentName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getParentIds() {
|
||||
return parentIds;
|
||||
}
|
||||
|
||||
public void setParentIds(String parentIds) {
|
||||
this.parentIds = parentIds;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(String orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getParentName()
|
||||
{
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName)
|
||||
{
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("parentId", getParentId())
|
||||
.append("ancestors", getParentIds())
|
||||
.append("deptName", getName())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.ruoyi.courseware.mapper;
|
||||
|
||||
import com.ruoyi.courseware.domain.TrainCoursewareCategory;
|
||||
import com.ruoyi.framework.web.base.MyMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface TrainCoursewareCategoryMapper extends MyMapper<TrainCoursewareCategory>
|
||||
{
|
||||
/**
|
||||
* 查询部门人数
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectDeptCount(TrainCoursewareCategory dept);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int checkDeptExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<TrainCoursewareCategory> selectDeptList(TrainCoursewareCategory dept);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 新增部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(TrainCoursewareCategory dept);
|
||||
|
||||
/**
|
||||
* 修改部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDept(TrainCoursewareCategory dept);
|
||||
|
||||
/**
|
||||
* 修改子元素关系
|
||||
*
|
||||
* @param depts 子元素
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeptChildren(@Param("depts") List<TrainCoursewareCategory> depts);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public TrainCoursewareCategory selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @param parentId 父部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public TrainCoursewareCategory checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 部门列表
|
||||
*/
|
||||
public List<String> selectRoleDeptTree(Long roleId);
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.ruoyi.courseware.service;
|
||||
|
||||
import com.ruoyi.courseware.domain.TrainCoursewareCategory;
|
||||
import com.ruoyi.framework.web.base.AbstractBaseService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 部门管理 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ITrainCoursewareCategoryService extends AbstractBaseService<TrainCoursewareCategory>
|
||||
{
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<TrainCoursewareCategory> selectDeptList(TrainCoursewareCategory dept);
|
||||
|
||||
/**
|
||||
* 查询部门管理树
|
||||
*
|
||||
* @return 所有部门信息
|
||||
*/
|
||||
public List<Map<String, Object>> selectDeptTree();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询部门人数
|
||||
*
|
||||
* @param parentId 父部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectDeptCount(Long parentId);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
public boolean checkDeptExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 新增保存部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(TrainCoursewareCategory dept);
|
||||
|
||||
/**
|
||||
* 修改保存部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDept(TrainCoursewareCategory dept);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public TrainCoursewareCategory selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkDeptNameUnique(TrainCoursewareCategory dept);
|
||||
}
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
package com.ruoyi.courseware.service.impl;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.courseware.domain.TrainCoursewareCategory;
|
||||
import com.ruoyi.courseware.mapper.TrainCoursewareCategoryMapper;
|
||||
import com.ruoyi.courseware.service.ITrainCoursewareCategoryService;
|
||||
import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<TrainCoursewareCategoryMapper, TrainCoursewareCategory> implements ITrainCoursewareCategoryService {
|
||||
@Autowired
|
||||
private TrainCoursewareCategoryMapper trainCoursewareCategoryMapper;
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
@Override
|
||||
@DataScope(tableAlias = "d")
|
||||
public List<TrainCoursewareCategory> selectDeptList(TrainCoursewareCategory dept) {
|
||||
return trainCoursewareCategoryMapper.selectDeptList( dept );
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门管理树
|
||||
*
|
||||
* @return 所有部门信息
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectDeptTree() {
|
||||
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
|
||||
List<TrainCoursewareCategory> deptList = selectDeptList( new TrainCoursewareCategory() );
|
||||
trees = getTrees( deptList, false, null );
|
||||
return trees;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对象转部门树
|
||||
*
|
||||
* @param deptList 部门列表
|
||||
* @param isCheck 是否需要选中
|
||||
* @param roleDeptList 角色已存在菜单列表
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> getTrees(List<TrainCoursewareCategory> deptList, boolean isCheck, List<String> roleDeptList) {
|
||||
|
||||
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
|
||||
for (TrainCoursewareCategory dept : deptList) {
|
||||
if (UserConstants.DEPT_NORMAL.equals( dept.getDelFlag() )) {
|
||||
Map<String, Object> deptMap = new HashMap<String, Object>();
|
||||
deptMap.put( "id", dept.getId() );
|
||||
deptMap.put( "pId", dept.getParentId() );
|
||||
deptMap.put( "name", dept.getName() );
|
||||
deptMap.put( "title", dept.getName() );
|
||||
if (isCheck) {
|
||||
deptMap.put( "checked", roleDeptList.contains( dept.getDeptId() + dept.getName() ) );
|
||||
} else {
|
||||
deptMap.put( "checked", false );
|
||||
}
|
||||
trees.add( deptMap );
|
||||
}
|
||||
}
|
||||
return trees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门人数
|
||||
*
|
||||
* @param parentId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int selectDeptCount(Long parentId) {
|
||||
TrainCoursewareCategory dept = new TrainCoursewareCategory();
|
||||
dept.setParentId( parentId );
|
||||
return trainCoursewareCategoryMapper.selectDeptCount( dept );
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
@Override
|
||||
public boolean checkDeptExistUser(Long deptId) {
|
||||
int result = trainCoursewareCategoryMapper.checkDeptExistUser( deptId );
|
||||
return result > 0 ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeptById(Long deptId) {
|
||||
return trainCoursewareCategoryMapper.deleteDeptById( deptId );
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDept(TrainCoursewareCategory dept) {
|
||||
TrainCoursewareCategory info = trainCoursewareCategoryMapper.selectDeptById( dept.getParentId() );
|
||||
dept.setParentIds( info.getParentIds() + "," + dept.getParentId() );
|
||||
return trainCoursewareCategoryMapper.insertDept( dept );
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDept(TrainCoursewareCategory dept) {
|
||||
TrainCoursewareCategory info = trainCoursewareCategoryMapper.selectDeptById( dept.getParentId() );
|
||||
if (StringUtils.isNotNull( info )) {
|
||||
String ancestors = info.getParentIds() + "," + dept.getParentId();
|
||||
dept.setParentIds( ancestors );
|
||||
updateDeptChildren( dept.getDeptId(), ancestors );
|
||||
}
|
||||
return trainCoursewareCategoryMapper.updateDept( dept );
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改子元素关系
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param ancestors 元素列表
|
||||
*/
|
||||
public void updateDeptChildren(Long deptId, String ancestors) {
|
||||
TrainCoursewareCategory dept = new TrainCoursewareCategory();
|
||||
dept.setParentId( deptId );
|
||||
List<TrainCoursewareCategory> childrens = trainCoursewareCategoryMapper.selectDeptList( dept );
|
||||
for (TrainCoursewareCategory children : childrens) {
|
||||
children.setParentIds( ancestors + "," + dept.getParentId() );
|
||||
}
|
||||
if (childrens.size() > 0) {
|
||||
trainCoursewareCategoryMapper.updateDeptChildren( childrens );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
@Override
|
||||
public TrainCoursewareCategory selectDeptById(Long deptId) {
|
||||
return trainCoursewareCategoryMapper.selectDeptById( deptId );
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkDeptNameUnique(TrainCoursewareCategory dept) {
|
||||
Long deptId = StringUtils.isNull( dept.getDeptId() ) ? -1L : dept.getDeptId();
|
||||
TrainCoursewareCategory info = trainCoursewareCategoryMapper.checkDeptNameUnique( dept.getName(), dept.getParentId() );
|
||||
if (StringUtils.isNotNull( info ) && info.getDeptId().longValue() != deptId.longValue()) {
|
||||
return UserConstants.DEPT_NAME_NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.DEPT_NAME_UNIQUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?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.course.mapper.TrainCourseCategoryMapper">
|
||||
|
||||
<resultMap type="TrainCourseCategory" id="TrainCourseCategoryResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="parentIds" column="parent_ids" />
|
||||
<result property="name" column="name" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
select d.id,d.dept_id, d.parent_id, d.parent_ids, d.name, d.order_num, d.del_flag, d.create_by, d.create_time
|
||||
from train_courseware_category d
|
||||
</sql>
|
||||
<select id="selectRoleDeptTree" parameterType="Long" resultType="String">
|
||||
select concat(d.id, d.name) as name
|
||||
from train_courseware_category d
|
||||
left join sys_role_dept rd on d.id = rd.id
|
||||
where d.del_flag = '0' and rd.role_id = #{roleId}
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptList" parameterType="TrainCourseCategory" resultMap="TrainCourseCategoryResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="parentId != null and parentId != 0">
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||
select count(1) from sys_user where id = #{id} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectDeptCount" parameterType="TrainCourseCategory" resultType="int">
|
||||
select count(1) from train_courseware_category
|
||||
where del_flag = '0'
|
||||
<if test="id != null and id != 0"> and id = #{id} </if>
|
||||
<if test="parentId != null and parentId != 0"> and parent_id = #{parentId} </if>
|
||||
</select>
|
||||
|
||||
<select id="checkDeptNameUnique" resultMap="TrainCourseCategoryResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where name=#{name} and parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="TrainCourseCategoryResult">
|
||||
select d.id, d.parent_id, d.parent_ids, d.name, d.order_num,
|
||||
(select name from train_courseware_category where id = d.parent_id) parent_name
|
||||
from train_courseware_category d
|
||||
where d.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="TrainCourseCategory">
|
||||
insert into train_courseware_category(
|
||||
<if test="id != null and id != 0">id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="parentIds != null and parentIds != ''">parent_ids,</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num,</if>
|
||||
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="id != null and id != 0">#{id},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="parentIds != null and parentIds != ''">#{parentIds},</if>
|
||||
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
|
||||
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="TrainCourseCategory">
|
||||
update train_courseware_category
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="parentIds != null and parentIds != ''">parent_ids = #{parentIds},</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
|
||||
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateDeptChildren" parameterType="java.util.List">
|
||||
update train_courseware_category set parent_ids =
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator=" " open="case id" close="end">
|
||||
when #{item.id} then #{item.parent_ids}
|
||||
</foreach>
|
||||
where id in
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeptById" parameterType="Long">
|
||||
update train_courseware_category set del_flag = '2' where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?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.courseware.mapper.TrainCoursewareCategoryMapper">
|
||||
|
||||
<resultMap type="TrainCourseCategory" id="TrainCoursewareCategoryResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="parentIds" column="parent_ids" />
|
||||
<result property="name" column="name" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
select d.id,d.dept_id, d.parent_id, d.parent_ids, d.name, d.order_num, d.del_flag, d.create_by, d.create_time
|
||||
from train_courseware_category d
|
||||
</sql>
|
||||
<select id="selectRoleDeptTree" parameterType="Long" resultType="String">
|
||||
select concat(d.id, d.name) as name
|
||||
from train_courseware_category d
|
||||
left join sys_role_dept rd on d.id = rd.id
|
||||
where d.del_flag = '0' and rd.role_id = #{roleId}
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptList" parameterType="TrainCourseCategory" resultMap="TrainCoursewareCategoryResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="parentId != null and parentId != 0">
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||
select count(1) from sys_user where id = #{id} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectDeptCount" parameterType="TrainCourseCategory" resultType="int">
|
||||
select count(1) from train_courseware_category
|
||||
where del_flag = '0'
|
||||
<if test="id != null and id != 0"> and id = #{id} </if>
|
||||
<if test="parentId != null and parentId != 0"> and parent_id = #{parentId} </if>
|
||||
</select>
|
||||
|
||||
<select id="checkDeptNameUnique" resultMap="TrainCoursewareCategoryResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where name=#{name} and parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="TrainCoursewareCategoryResult">
|
||||
select d.id, d.parent_id, d.parent_ids, d.name, d.order_num,
|
||||
(select name from train_courseware_category where id = d.parent_id) parent_name
|
||||
from train_courseware_category d
|
||||
where d.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="TrainCourseCategory">
|
||||
insert into train_courseware_category(
|
||||
<if test="id != null and id != 0">id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="parentIds != null and parentIds != ''">parent_ids,</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num,</if>
|
||||
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="id != null and id != 0">#{id},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="parentIds != null and parentIds != ''">#{parentIds},</if>
|
||||
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
|
||||
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="TrainCourseCategory">
|
||||
update train_courseware_category
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="parentIds != null and parentIds != ''">parent_ids = #{parentIds},</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
|
||||
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateDeptChildren" parameterType="java.util.List">
|
||||
update train_courseware_category set parent_ids =
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator=" " open="case id" close="end">
|
||||
when #{item.id} then #{item.parent_ids}
|
||||
</foreach>
|
||||
where id in
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeptById" parameterType="Long">
|
||||
update train_courseware_category set del_flag = '2' where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
|
||||
<settings>
|
||||
<setting name="cacheEnabled" value="true" /> <!-- 全局映射器启用缓存 -->
|
||||
<setting name="useGeneratedKeys" value="true" /> <!-- 允许 JDBC 支持自动生成主键 -->
|
||||
<setting name="defaultExecutorType" value="REUSE" /> <!-- 配置默认的执行器 -->
|
||||
<setting name="logImpl" value="SLF4J" /> <!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> 驼峰式命名 -->
|
||||
</settings>
|
||||
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-dept-add">
|
||||
<input id="treeId" name="parentId" type="hidden" th:value="${dept.deptId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">上级部门:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept.deptName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="deptName" id="deptName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">显示排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="orderNum">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">负责人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="leader">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系电话:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="phone">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "course/category";
|
||||
|
||||
$("#form-dept-add").validate({
|
||||
rules:{
|
||||
deptName:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: prefix + "/checkDeptNameUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"parentId": function() {
|
||||
return $("input[name='parentId']").val();
|
||||
},
|
||||
"deptName" : function() {
|
||||
return $.common.trim($("#deptName").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
orderNum:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
email:{
|
||||
email:true,
|
||||
},
|
||||
phone:{
|
||||
isPhone:true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"deptName": {
|
||||
remote: "部门已经存在"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-dept-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
/*部门管理-新增-选择父部门树*/
|
||||
function selectDeptTree() {
|
||||
var options = {
|
||||
title: '部门选择',
|
||||
width: "380",
|
||||
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="dept-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
部门名称:<input type="text" name="deptName"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add(100)" shiro:hasPermission="train:course:category:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary" onclick="$.operate.editTree()" shiro:hasPermission="train:course:category:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-info" id="expandAllBtn">
|
||||
<i class="fa fa-exchange"></i> 展开/折叠
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-tree-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script th:inline="javascript">
|
||||
var addFlag = [[${@permission.hasPermi('train:course:category:add')}]];
|
||||
var editFlag = [[${@permission.hasPermi('train:course:category:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('train:course:category:remove')}]];
|
||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
||||
var prefix = ctx + "train/course/category"
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
code: "id",
|
||||
parentCode: "parentId",
|
||||
uniqueId: "id",
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add/{id}",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove/{id}",
|
||||
modalName: "部门",
|
||||
columns: [{
|
||||
field: 'selectItem',
|
||||
radio: true
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '分类名称',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
field: 'orderNum',
|
||||
title: '排序',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'left',
|
||||
formatter: function(value, row, index) {
|
||||
if (row.parentId != 0) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit">编辑</i></a> ');
|
||||
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="#" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus">新增</i></a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.deptId + '\')"><i class="fa fa-remove">删除</i></a>');
|
||||
return actions.join('');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.treeTable.init(options);
|
||||
});
|
||||
|
||||
function remove(id) {
|
||||
$.modal.confirm("确定删除该条" + $.table._option.modalName + "信息吗?", function() {
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
url: prefix + "/remove/" + id,
|
||||
success : function(result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$.modal.msgSuccess(result.msg);
|
||||
$.treeTable.refresh();
|
||||
} else {
|
||||
$.modal.msgError(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-dept-edit" th:object="${dept}">
|
||||
<input name="deptId" type="hidden" th:field="*{deptId}" />
|
||||
<input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">上级部门:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" id="treeName" onclick="selectDeptTree()" readonly="true" th:field="*{parentName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="deptName" th:field="*{deptName}" id="deptName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">显示排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="orderNum" th:field="*{orderNum}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">负责人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="leader" th:field="*{leader}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系电话:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="phone" th:field="*{phone}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="email" th:field="*{email}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "course/category";
|
||||
|
||||
$("#form-dept-edit").validate({
|
||||
rules:{
|
||||
deptName:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: prefix + "/checkDeptNameUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"deptId": function() {
|
||||
return $("#deptId").val();
|
||||
},
|
||||
"parentId": function() {
|
||||
return $("input[name='parentId']").val();
|
||||
},
|
||||
"deptName": function() {
|
||||
return $.common.trim($("#deptName").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
orderNum:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
email:{
|
||||
email:true,
|
||||
},
|
||||
phone:{
|
||||
isPhone:true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"deptName": {
|
||||
remote: "部门已经存在"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-dept-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
/*部门管理-修改-选择部门树*/
|
||||
function selectDeptTree() {
|
||||
var deptId = $("#treeId").val();
|
||||
if(deptId > 0) {
|
||||
var options = {
|
||||
title: '部门选择',
|
||||
width: "380",
|
||||
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
} else {
|
||||
$.modal.alertError("父部门不能选择");
|
||||
}
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
|
||||
<style>
|
||||
body{height:auto;font-family: "Microsoft YaHei";}
|
||||
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
|
||||
</style>
|
||||
<body class="hold-transition box box-main">
|
||||
<input id="treeId" name="treeId" type="hidden" th:value="${dept.deptId}"/>
|
||||
<input id="treeName" name="treeName" type="hidden" th:value="${dept.deptName}"/>
|
||||
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
|
||||
<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
|
||||
<label id="btnHide" title="隐藏搜索">︽</label>
|
||||
</div>
|
||||
<div class="treeSearchInput" id="search">
|
||||
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
|
||||
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
|
||||
</div>
|
||||
<div class="treeExpandCollapse">
|
||||
<a href="#" onclick="$.tree.expand()">展开</a> /
|
||||
<a href="#" onclick="$.tree.collapse()">折叠</a>
|
||||
</div>
|
||||
<div id="tree" class="ztree treeselect"></div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
$(function() {
|
||||
var url = ctx + "course/category/treeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
onClick : zOnClick
|
||||
};
|
||||
$.tree.init(options);
|
||||
});
|
||||
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
var treeId = treeNode.id;
|
||||
var treeName = treeNode.name;
|
||||
$("#treeId").val(treeId);
|
||||
$("#treeName").val(treeName);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-dept-add">
|
||||
<input id="treeId" name="parentId" type="hidden" th:value="${dept.deptId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">上级部门:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept.name}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="name" id="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">显示排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="orderNum">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">负责人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="leader">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系电话:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="phone">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "courseware/category";
|
||||
|
||||
$("#form-dept-add").validate({
|
||||
rules:{
|
||||
name:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: prefix + "/checkDeptNameUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"parentId": function() {
|
||||
return $("input[name='parentId']").val();
|
||||
},
|
||||
"name" : function() {
|
||||
return $.common.trim($("#name").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
orderNum:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
email:{
|
||||
email:true,
|
||||
},
|
||||
phone:{
|
||||
isPhone:true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"name": {
|
||||
remote: "部门已经存在"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-dept-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
/*部门管理-新增-选择父部门树*/
|
||||
function selectDeptTree() {
|
||||
var options = {
|
||||
title: '部门选择',
|
||||
width: "380",
|
||||
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="dept-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
部门名称:<input type="text" name="deptName"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add(100)" shiro:hasPermission="train:courseware:category:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary" onclick="$.operate.editTree()" shiro:hasPermission="train:courseware:category:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-info" id="expandAllBtn">
|
||||
<i class="fa fa-exchange"></i> 展开/折叠
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-tree-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script th:inline="javascript">
|
||||
var addFlag = [[${@permission.hasPermi('train:courseware:category:add')}]];
|
||||
var editFlag = [[${@permission.hasPermi('train:courseware:category:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('train:courseware:category:remove')}]];
|
||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
||||
var prefix = ctx + "train/courseware/category"
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
code: "id",
|
||||
parentCode: "parentId",
|
||||
uniqueId: "id",
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add/{id}",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove/{id}",
|
||||
modalName: "部门",
|
||||
columns: [{
|
||||
field: 'selectItem',
|
||||
radio: true
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '分类名称',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
field: 'orderNum',
|
||||
title: '排序',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'left',
|
||||
formatter: function(value, row, index) {
|
||||
if (row.parentId != 0) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit">编辑</i></a> ');
|
||||
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="#" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus">新增</i></a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.deptId + '\')"><i class="fa fa-remove">删除</i></a>');
|
||||
return actions.join('');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.treeTable.init(options);
|
||||
});
|
||||
|
||||
function remove(id) {
|
||||
$.modal.confirm("确定删除该条" + $.table._option.modalName + "信息吗?", function() {
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
url: prefix + "/remove/" + id,
|
||||
success : function(result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$.modal.msgSuccess(result.msg);
|
||||
$.treeTable.refresh();
|
||||
} else {
|
||||
$.modal.msgError(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-dept-edit" th:object="${dept}">
|
||||
<input name="id" type="hidden" th:field="*{id}" />
|
||||
<input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">上级部门:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" id="treeName" onclick="selectDeptTree()" readonly="true" th:field="*{parentName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="name" th:field="*{name}" id="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">显示排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="orderNum" th:field="*{orderNum}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">负责人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="leader" th:field="*{leader}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系电话:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="phone" th:field="*{phone}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="email" th:field="*{email}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "courseware/category";
|
||||
|
||||
$("#form-dept-edit").validate({
|
||||
rules:{
|
||||
name:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: prefix + "/checkDeptNameUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"id": function() {
|
||||
return $("#id").val();
|
||||
},
|
||||
"parentId": function() {
|
||||
return $("input[name='parentId']").val();
|
||||
},
|
||||
"name": function() {
|
||||
return $.common.trim($("#name").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
orderNum:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
email:{
|
||||
email:true,
|
||||
},
|
||||
phone:{
|
||||
isPhone:true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"name": {
|
||||
remote: "部门已经存在"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-dept-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
/*部门管理-修改-选择部门树*/
|
||||
function selectDeptTree() {
|
||||
var id = $("#treeId").val();
|
||||
if(id > 0) {
|
||||
var options = {
|
||||
title: '部门选择',
|
||||
width: "380",
|
||||
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
} else {
|
||||
$.modal.alertError("父部门不能选择");
|
||||
}
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
|
||||
<style>
|
||||
body{height:auto;font-family: "Microsoft YaHei";}
|
||||
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
|
||||
</style>
|
||||
<body class="hold-transition box box-main">
|
||||
<input id="treeId" name="treeId" type="hidden" th:value="${dept.deptId}"/>
|
||||
<input id="treeName" name="treeName" type="hidden" th:value="${dept.deptName}"/>
|
||||
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
|
||||
<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
|
||||
<label id="btnHide" title="隐藏搜索">︽</label>
|
||||
</div>
|
||||
<div class="treeSearchInput" id="search">
|
||||
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
|
||||
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
|
||||
</div>
|
||||
<div class="treeExpandCollapse">
|
||||
<a href="#" onclick="$.tree.expand()">展开</a> /
|
||||
<a href="#" onclick="$.tree.collapse()">折叠</a>
|
||||
</div>
|
||||
<div id="tree" class="ztree treeselect"></div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
$(function() {
|
||||
var url = ctx + "courseware/category/treeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
onClick : zOnClick
|
||||
};
|
||||
$.tree.init(options);
|
||||
});
|
||||
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
var treeId = treeNode.id;
|
||||
var treeName = treeNode.name;
|
||||
$("#treeId").val(treeId);
|
||||
$("#treeName").val(treeName);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-vip</artifactId>
|
||||
|
||||
<description>
|
||||
会员管理
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
package com.ruoyi.vip.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.framework.web.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.vip.domain.VipDept;
|
||||
import com.ruoyi.vip.service.IVipDeptService;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 部门信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/vip/dept")
|
||||
public class VipDeptController extends BaseController
|
||||
{
|
||||
private String prefix = "vip/dept";
|
||||
|
||||
@Autowired
|
||||
private IVipDeptService deptService;
|
||||
|
||||
@RequiresPermissions("vip:dept:view")
|
||||
@GetMapping()
|
||||
public String dept()
|
||||
{
|
||||
return prefix + "/dept";
|
||||
}
|
||||
|
||||
@RequiresPermissions("vip:dept:list")
|
||||
@GetMapping("/list")
|
||||
@ResponseBody
|
||||
public List<VipDept> list(VipDept dept)
|
||||
{
|
||||
List<VipDept> deptList = deptService.selectDeptList(dept);
|
||||
return deptList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
@GetMapping("/add/{parentId}")
|
||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dept", deptService.selectDeptById(parentId));
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存部门
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@RequiresPermissions("vip:dept:add")
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(VipDept dept)
|
||||
{
|
||||
dept.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(deptService.insertDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@GetMapping("/edit/{deptId}")
|
||||
public String edit(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
VipDept dept = deptService.selectDeptById(deptId);
|
||||
if (StringUtils.isNotNull(dept) && 100L == deptId)
|
||||
{
|
||||
dept.setParentName("无");
|
||||
}
|
||||
mmap.put("dept", dept);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("vip:dept:edit")
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(VipDept dept)
|
||||
{
|
||||
dept.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("vip:dept:remove")
|
||||
@PostMapping("/remove/{deptId}")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(@PathVariable("deptId") Long deptId)
|
||||
{
|
||||
if (deptService.selectDeptCount(deptId) > 0)
|
||||
{
|
||||
return error(1, "存在下级部门,不允许删除");
|
||||
}
|
||||
if (deptService.checkDeptExistUser(deptId))
|
||||
{
|
||||
return error(1, "部门存在用户,不允许删除");
|
||||
}
|
||||
return toAjax(deptService.deleteDeptById(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验部门名称
|
||||
*/
|
||||
@PostMapping("/checkDeptNameUnique")
|
||||
@ResponseBody
|
||||
public String checkDeptNameUnique(VipDept dept)
|
||||
{
|
||||
return deptService.checkDeptNameUnique(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择部门树
|
||||
*/
|
||||
@GetMapping("/selectDeptTree/{deptId}")
|
||||
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dept", deptService.selectDeptById(deptId));
|
||||
return prefix + "/tree";
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载部门列表树
|
||||
*/
|
||||
@GetMapping("/treeData")
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> treeData()
|
||||
{
|
||||
List<Map<String, Object>> tree = deptService.selectDeptTree();
|
||||
return tree;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
package com.ruoyi.vip.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.vip.domain.VipUser;
|
||||
import com.ruoyi.vip.service.IVipUserService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/vip/user")
|
||||
public class VipUserController extends BaseController {
|
||||
private String prefix = "vip/user";
|
||||
|
||||
@Autowired
|
||||
private IVipUserService userService;
|
||||
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
@RequiresPermissions("vip:user:view")
|
||||
@GetMapping()
|
||||
public String user() {
|
||||
return prefix + "/user";
|
||||
}
|
||||
|
||||
@RequiresPermissions("vip:user:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(VipUser user) {
|
||||
|
||||
List<VipUser> list = userService.selectUserList( user );
|
||||
return getDataTable( list );
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("vip:user:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(VipUser user) {
|
||||
List<VipUser> list = userService.selectUserList( user );
|
||||
ExcelUtil<VipUser> util = new ExcelUtil<VipUser>( VipUser.class );
|
||||
return util.exportExcel( list, "user" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap) {
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存用户
|
||||
*/
|
||||
@RequiresPermissions("vip:user:add")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(VipUser user) {
|
||||
user.setSalt( ShiroUtils.randomSalt() );
|
||||
user.setPassword( passwordService.encryptPassword( user.getLoginName(), user.getPassword(), user.getSalt() ) );
|
||||
user.setCreateBy( ShiroUtils.getLoginName() );
|
||||
return toAjax( userService.insertUser( user ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@GetMapping("/edit/{userId}")
|
||||
public String edit(@PathVariable("userId") Long userId, ModelMap mmap) {
|
||||
mmap.put( "user", userService.selectUserById( userId ) );
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存用户
|
||||
*/
|
||||
@RequiresPermissions("vip:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(VipUser user) {
|
||||
|
||||
user.setUpdateBy( ShiroUtils.getLoginName() );
|
||||
return toAjax( userService.updateUser( user ) );
|
||||
}
|
||||
|
||||
@RequiresPermissions("vip:user:resetPwd")
|
||||
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/resetPwd/{userId}")
|
||||
public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap) {
|
||||
mmap.put( "user", userService.selectUserById( userId ) );
|
||||
return prefix + "/resetPwd";
|
||||
}
|
||||
|
||||
@RequiresPermissions("vip:user:resetPwd")
|
||||
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/resetPwd")
|
||||
@ResponseBody
|
||||
public AjaxResult resetPwdSave(VipUser user) {
|
||||
user.setSalt( ShiroUtils.randomSalt() );
|
||||
user.setPassword( passwordService.encryptPassword( user.getLoginName(), user.getPassword(), user.getSalt() ) );
|
||||
return toAjax( userService.resetUserPwd( user ) );
|
||||
}
|
||||
|
||||
@RequiresPermissions("vip:user:remove")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids) {
|
||||
try {
|
||||
return toAjax( userService.deleteUserByIds( ids ) );
|
||||
} catch (Exception e) {
|
||||
return error( e.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验用户名
|
||||
*/
|
||||
@PostMapping("/checkLoginNameUnique")
|
||||
@ResponseBody
|
||||
public String checkLoginNameUnique(VipUser user) {
|
||||
return userService.checkLoginNameUnique( user.getLoginName() );
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验手机号码
|
||||
*/
|
||||
@PostMapping("/checkPhoneUnique")
|
||||
@ResponseBody
|
||||
public String checkPhoneUnique(VipUser user) {
|
||||
return userService.checkPhoneUnique( user );
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验email邮箱
|
||||
*/
|
||||
@PostMapping("/checkEmailUnique")
|
||||
@ResponseBody
|
||||
public String checkEmailUnique(VipUser user) {
|
||||
return userService.checkEmailUnique( user );
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
package com.ruoyi.vip.domain;
|
||||
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class VipDept extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 部门ID */
|
||||
@Id
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID */
|
||||
private Long parentId;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String parentIds;
|
||||
|
||||
/** 部门名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 显示顺序 */
|
||||
private String orderNum;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 父部门名称 */
|
||||
private String parentName;
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getParentIds() {
|
||||
return parentIds;
|
||||
}
|
||||
|
||||
public void setParentIds(String parentIds) {
|
||||
this.parentIds = parentIds;
|
||||
}
|
||||
|
||||
public String getDeptName()
|
||||
{
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName)
|
||||
{
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(String orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getParentName()
|
||||
{
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName)
|
||||
{
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("deptId", getDeptId())
|
||||
.append("parentId", getParentId())
|
||||
.append("ancestors", getParentIds())
|
||||
.append("deptName", getDeptName())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
package com.ruoyi.vip.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class VipUser extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户序号")
|
||||
@Id
|
||||
private Long id;
|
||||
|
||||
/** 部门ID */
|
||||
private Long deptId;
|
||||
|
||||
/** 部门父ID */
|
||||
private Long parentId;
|
||||
|
||||
/** 登录名称 */
|
||||
@Excel(name = "登录名称")
|
||||
private String loginName;
|
||||
|
||||
/** 用户名称 */
|
||||
@Excel(name = "用户名称")
|
||||
private String userName;
|
||||
|
||||
/** 用户邮箱 */
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
private String phonenumber;
|
||||
|
||||
/** 用户性别 */
|
||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String sex;
|
||||
|
||||
/** 用户头像 */
|
||||
private String avatar;
|
||||
|
||||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/** 盐加密 */
|
||||
private String salt;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 最后登陆IP */
|
||||
@Excel(name = "最后登陆IP")
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登陆时间 */
|
||||
@Excel(name = "最后登陆时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date loginDate;
|
||||
|
||||
/** 部门对象 */
|
||||
private VipDept dept;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getLoginName()
|
||||
{
|
||||
return loginName;
|
||||
}
|
||||
|
||||
public void setLoginName(String loginName)
|
||||
{
|
||||
this.loginName = loginName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPhonenumber()
|
||||
{
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber)
|
||||
{
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public String getSex()
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex)
|
||||
{
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getAvatar()
|
||||
{
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar)
|
||||
{
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getSalt()
|
||||
{
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(String salt)
|
||||
{
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getLoginIp()
|
||||
{
|
||||
return loginIp;
|
||||
}
|
||||
|
||||
public void setLoginIp(String loginIp)
|
||||
{
|
||||
this.loginIp = loginIp;
|
||||
}
|
||||
|
||||
public Date getLoginDate()
|
||||
{
|
||||
return loginDate;
|
||||
}
|
||||
|
||||
public void setLoginDate(Date loginDate)
|
||||
{
|
||||
this.loginDate = loginDate;
|
||||
}
|
||||
|
||||
public VipDept getDept()
|
||||
{
|
||||
return dept;
|
||||
}
|
||||
|
||||
public void setDept(VipDept dept)
|
||||
{
|
||||
this.dept = dept;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("loginName", getLoginName())
|
||||
.append("userName", getUserName())
|
||||
.append("email", getEmail())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("sex", getSex())
|
||||
.append("avatar", getAvatar())
|
||||
.append("password", getPassword())
|
||||
.append("salt", getSalt())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("loginIp", getLoginIp())
|
||||
.append("loginDate", getLoginDate())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.ruoyi.vip.mapper;
|
||||
|
||||
import com.ruoyi.framework.web.base.MyMapper;
|
||||
import com.ruoyi.vip.domain.VipDept;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface VipDeptMapper extends MyMapper<VipDept>
|
||||
{
|
||||
/**
|
||||
* 查询部门人数
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectDeptCount(VipDept dept);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int checkDeptExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<VipDept> selectDeptList(VipDept dept);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 新增部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(VipDept dept);
|
||||
|
||||
/**
|
||||
* 修改部门信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDept(VipDept dept);
|
||||
|
||||
/**
|
||||
* 修改子元素关系
|
||||
*
|
||||
* @param depts 子元素
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeptChildren(@Param("depts") List<VipDept> depts);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public VipDept selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @param parentId 父部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public VipDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 部门列表
|
||||
*/
|
||||
public List<String> selectRoleDeptTree(Long roleId);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue