mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 02:08:15 +08:00
新增一个module,用来做测试
This commit is contained in:
parent
8e091d712f
commit
463deb5982
8
pom.xml
8
pom.xml
@ -49,6 +49,7 @@
|
||||
<sms4j.version>2.2.0</sms4j.version>
|
||||
<!-- 限制框架中的fastjson版本 -->
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<p6spy.version>3.0.4.2</p6spy.version>
|
||||
|
||||
<!-- 插件版本 -->
|
||||
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
|
||||
@ -226,7 +227,6 @@
|
||||
<dependency>
|
||||
<groupId>p6spy</groupId>
|
||||
<artifactId>p6spy</artifactId>
|
||||
<version>${p6spy.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -339,6 +339,12 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.herodotus.engine</groupId>
|
||||
<artifactId>data-sdk-p6spy</artifactId>
|
||||
<version>${p6spy.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
@ -23,10 +23,17 @@
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!-- Oracle -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.oracle.database.jdbc</groupId>-->
|
||||
<!-- <artifactId>ojdbc8</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.oracle.database.jdbc</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
<groupId>cn.easyproject</groupId>
|
||||
<artifactId>ojdbc6</artifactId>
|
||||
<version>11.2.0.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- PostgreSql -->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
@ -56,11 +63,47 @@
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>springdoc-openapi-starter-common</artifactId>
|
||||
<groupId>org.springdoc</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<groupId>joda-time</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<groupId>commons-io</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>checker-qual</artifactId>
|
||||
<groupId>org.checkerframework</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<groupId>commons-logging</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-job</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成-->
|
||||
@ -103,6 +146,12 @@
|
||||
<!-- <version>${与你的agent探针版本保持一致}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!--增加业务依赖包 -->
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-imok-test</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -43,23 +43,23 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://192.168.56.100:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: root
|
||||
password: HEllo@123
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: true
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username:
|
||||
password:
|
||||
# oracle:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
||||
# username: ROOT
|
||||
# password: root
|
||||
url: jdbc:mysql://192.168.56.100:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: HEllo@123
|
||||
oracle:
|
||||
type: ${spring.datasource.type}
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@192.168.56.122:1521/oracledb
|
||||
username: cpad
|
||||
password: cpad
|
||||
# postgres:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: org.postgresql.Driver
|
||||
@ -98,7 +98,7 @@ spring.data:
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码(如没有密码请注释掉)
|
||||
# password:
|
||||
password: hello123
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启ssl
|
||||
|
||||
@ -122,7 +122,7 @@ security:
|
||||
# 多租户配置
|
||||
tenant:
|
||||
# 是否开启
|
||||
enable: true
|
||||
enable: false
|
||||
# 排除表
|
||||
excludes:
|
||||
- sys_menu
|
||||
|
||||
@ -45,14 +45,24 @@
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<groupId>org.mybatis</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- sql性能分析插件 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>p6spy</groupId>-->
|
||||
<!-- <artifactId>p6spy</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>p6spy</groupId>
|
||||
<artifactId>p6spy</artifactId>
|
||||
<groupId>cn.herodotus.engine</groupId>
|
||||
<artifactId>data-sdk-p6spy</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@ -2,9 +2,9 @@ oms.env=dev
|
||||
|
||||
####### Database properties(Configure according to the the environment) #######
|
||||
spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.core.jdbc-url=jdbc:mysql://192.168.56.100:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.core.username=root
|
||||
spring.datasource.core.password=root
|
||||
spring.datasource.core.password=HEllo@123
|
||||
spring.datasource.core.maximum-pool-size=20
|
||||
spring.datasource.core.minimum-idle=5
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-job</module>
|
||||
<module>ruoyi-system</module>
|
||||
<module>ruoyi-imok-test</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
|
||||
@ -379,6 +379,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
StringWriter sw = new StringWriter();
|
||||
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
||||
tpl.merge(context, sw);
|
||||
log.info("生成的文件======{}",sw.toString());
|
||||
try {
|
||||
// 添加到zip
|
||||
zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table)));
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
# 代码生成
|
||||
gen:
|
||||
# 作者
|
||||
author: Lion Li
|
||||
author: sungk
|
||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||
packageName: org.dromara.system
|
||||
packageName: org.dromara.imok
|
||||
# 自动去除表前缀,默认是false
|
||||
autoRemovePre: false
|
||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||
tablePrefix: sys_
|
||||
# tablePrefix: sys_
|
||||
tablePrefix:
|
||||
|
||||
100
ruoyi-modules/ruoyi-imok-test/pom.xml
Normal file
100
ruoyi-modules/ruoyi-imok-test/pom.xml
Normal file
@ -0,0 +1,100 @@
|
||||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>5.1.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ruoyi-imok-test</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-translation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- OSS功能模块 -->
|
||||
<!--<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-oss</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- excel-->
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SMS功能模块 -->
|
||||
<!--<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-sms</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-idempotent</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-sensitive</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-encrypt</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-websocket</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,7 @@
|
||||
package org.dromara;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
package org.dromara.imok.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.imok.domain.vo.TrainingCoursesVo;
|
||||
import org.dromara.imok.domain.bo.TrainingCoursesBo;
|
||||
import org.dromara.imok.service.ITrainingCoursesService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 培训课程管理
|
||||
*
|
||||
* @author sungk
|
||||
* @date 2024-04-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/imok/courses")
|
||||
public class TrainingCoursesController extends BaseController {
|
||||
|
||||
private final ITrainingCoursesService trainingCoursesService;
|
||||
|
||||
/**
|
||||
* 查询培训课程管理列表
|
||||
*/
|
||||
@SaCheckPermission("imok:courses:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<TrainingCoursesVo> list(TrainingCoursesBo bo, PageQuery pageQuery) {
|
||||
return trainingCoursesService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出培训课程管理列表
|
||||
*/
|
||||
@SaCheckPermission("imok:courses:export")
|
||||
@Log(title = "培训课程管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(TrainingCoursesBo bo, HttpServletResponse response) {
|
||||
List<TrainingCoursesVo> list = trainingCoursesService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "培训课程管理", TrainingCoursesVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取培训课程管理详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("imok:courses:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TrainingCoursesVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable String id) {
|
||||
return R.ok(trainingCoursesService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增培训课程管理
|
||||
*/
|
||||
@SaCheckPermission("imok:courses:add")
|
||||
@Log(title = "培训课程管理", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TrainingCoursesBo bo) {
|
||||
return toAjax(trainingCoursesService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改培训课程管理
|
||||
*/
|
||||
@SaCheckPermission("imok:courses:edit")
|
||||
@Log(title = "培训课程管理", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TrainingCoursesBo bo) {
|
||||
return toAjax(trainingCoursesService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除培训课程管理
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("imok:courses:remove")
|
||||
@Log(title = "培训课程管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable String[] ids) {
|
||||
return toAjax(trainingCoursesService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package org.dromara.imok.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 培训课程管理对象 training_courses
|
||||
*
|
||||
* @author sungk
|
||||
* @date 2024-04-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("training_courses")
|
||||
public class TrainingCourses extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主健
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 课程名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 课程类别
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 课程介绍
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 课程大纲
|
||||
*/
|
||||
private String syllabus;
|
||||
|
||||
/**
|
||||
* 授课讲师
|
||||
*/
|
||||
private String instructor;
|
||||
|
||||
/**
|
||||
* 讲师简介
|
||||
*/
|
||||
private String instructorProfile;
|
||||
|
||||
/**
|
||||
* 开课日期
|
||||
*/
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结课日期
|
||||
*/
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 上课地点
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 课程状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 课程编号
|
||||
*/
|
||||
private String courseId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
package org.dromara.imok.domain.bo;
|
||||
|
||||
import org.dromara.imok.domain.TrainingCourses;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 培训课程管理业务对象 training_courses
|
||||
*
|
||||
* @author sungk
|
||||
* @date 2024-04-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = TrainingCourses.class, reverseConvertGenerate = false)
|
||||
public class TrainingCoursesBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主健
|
||||
*/
|
||||
@NotBlank(message = "主健不能为空", groups = { EditGroup.class })
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 课程名称
|
||||
*/
|
||||
@NotBlank(message = "课程名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 课程类别
|
||||
*/
|
||||
@NotBlank(message = "课程类别不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 课程介绍
|
||||
*/
|
||||
@NotBlank(message = "课程介绍不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 课程大纲
|
||||
*/
|
||||
@NotBlank(message = "课程大纲不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String syllabus;
|
||||
|
||||
/**
|
||||
* 授课讲师
|
||||
*/
|
||||
@NotBlank(message = "授课讲师不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String instructor;
|
||||
|
||||
/**
|
||||
* 讲师简介
|
||||
*/
|
||||
@NotBlank(message = "讲师简介不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String instructorProfile;
|
||||
|
||||
/**
|
||||
* 开课日期
|
||||
*/
|
||||
@NotNull(message = "开课日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结课日期
|
||||
*/
|
||||
@NotNull(message = "结课日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 上课地点
|
||||
*/
|
||||
@NotBlank(message = "上课地点不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 课程状态
|
||||
*/
|
||||
@NotBlank(message = "课程状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotNull(message = "创建时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotNull(message = "更新时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 课程编号
|
||||
*/
|
||||
@NotBlank(message = "课程编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String courseId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,118 @@
|
||||
package org.dromara.imok.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.imok.domain.TrainingCourses;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 培训课程管理视图对象 training_courses
|
||||
*
|
||||
* @author sungk
|
||||
* @date 2024-04-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TrainingCourses.class)
|
||||
public class TrainingCoursesVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主健
|
||||
*/
|
||||
@ExcelProperty(value = "主健")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 课程名称
|
||||
*/
|
||||
@ExcelProperty(value = "课程名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 课程类别
|
||||
*/
|
||||
@ExcelProperty(value = "课程类别")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 课程介绍
|
||||
*/
|
||||
@ExcelProperty(value = "课程介绍")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 课程大纲
|
||||
*/
|
||||
@ExcelProperty(value = "课程大纲")
|
||||
private String syllabus;
|
||||
|
||||
/**
|
||||
* 授课讲师
|
||||
*/
|
||||
@ExcelProperty(value = "授课讲师")
|
||||
private String instructor;
|
||||
|
||||
/**
|
||||
* 讲师简介
|
||||
*/
|
||||
@ExcelProperty(value = "讲师简介")
|
||||
private String instructorProfile;
|
||||
|
||||
/**
|
||||
* 开课日期
|
||||
*/
|
||||
@ExcelProperty(value = "开课日期")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结课日期
|
||||
*/
|
||||
@ExcelProperty(value = "结课日期")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 上课地点
|
||||
*/
|
||||
@ExcelProperty(value = "上课地点")
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 课程状态
|
||||
*/
|
||||
@ExcelProperty(value = "课程状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ExcelProperty(value = "更新时间")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 课程编号
|
||||
*/
|
||||
@ExcelProperty(value = "课程编号")
|
||||
private String courseId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.imok.mapper;
|
||||
|
||||
import org.dromara.imok.domain.TrainingCourses;
|
||||
import org.dromara.imok.domain.vo.TrainingCoursesVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 培训课程管理Mapper接口
|
||||
*
|
||||
* @author sungk
|
||||
* @date 2024-04-19
|
||||
*/
|
||||
public interface TrainingCoursesMapper extends BaseMapperPlus<TrainingCourses, TrainingCoursesVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package org.dromara.imok.service;
|
||||
|
||||
import org.dromara.imok.domain.TrainingCourses;
|
||||
import org.dromara.imok.domain.vo.TrainingCoursesVo;
|
||||
import org.dromara.imok.domain.bo.TrainingCoursesBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 培训课程管理Service接口
|
||||
*
|
||||
* @author sungk
|
||||
* @date 2024-04-19
|
||||
*/
|
||||
public interface ITrainingCoursesService {
|
||||
|
||||
/**
|
||||
* 查询培训课程管理
|
||||
*/
|
||||
TrainingCoursesVo queryById(String id);
|
||||
|
||||
/**
|
||||
* 查询培训课程管理列表
|
||||
*/
|
||||
TableDataInfo<TrainingCoursesVo> queryPageList(TrainingCoursesBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询培训课程管理列表
|
||||
*/
|
||||
List<TrainingCoursesVo> queryList(TrainingCoursesBo bo);
|
||||
|
||||
/**
|
||||
* 新增培训课程管理
|
||||
*/
|
||||
Boolean insertByBo(TrainingCoursesBo bo);
|
||||
|
||||
/**
|
||||
* 修改培训课程管理
|
||||
*/
|
||||
Boolean updateByBo(TrainingCoursesBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除培训课程管理信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,125 @@
|
||||
package org.dromara.imok.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.imok.domain.bo.TrainingCoursesBo;
|
||||
import org.dromara.imok.domain.vo.TrainingCoursesVo;
|
||||
import org.dromara.imok.domain.TrainingCourses;
|
||||
import org.dromara.imok.mapper.TrainingCoursesMapper;
|
||||
import org.dromara.imok.service.ITrainingCoursesService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 培训课程管理Service业务层处理
|
||||
*
|
||||
* @author sungk
|
||||
* @date 2024-04-19
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@DS("oracle")
|
||||
public class TrainingCoursesServiceImpl implements ITrainingCoursesService {
|
||||
|
||||
@Resource
|
||||
private final TrainingCoursesMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询培训课程管理
|
||||
*/
|
||||
@Override
|
||||
public TrainingCoursesVo queryById(String id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询培训课程管理列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<TrainingCoursesVo> queryPageList(TrainingCoursesBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<TrainingCourses> lqw = buildQueryWrapper(bo);
|
||||
Page<TrainingCoursesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询培训课程管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<TrainingCoursesVo> queryList(TrainingCoursesBo bo) {
|
||||
LambdaQueryWrapper<TrainingCourses> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TrainingCourses> buildQueryWrapper(TrainingCoursesBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TrainingCourses> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), TrainingCourses::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCategory()), TrainingCourses::getCategory, bo.getCategory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDescription()), TrainingCourses::getDescription, bo.getDescription());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSyllabus()), TrainingCourses::getSyllabus, bo.getSyllabus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getInstructor()), TrainingCourses::getInstructor, bo.getInstructor());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getInstructorProfile()), TrainingCourses::getInstructorProfile, bo.getInstructorProfile());
|
||||
lqw.eq(bo.getStartDate() != null, TrainingCourses::getStartDate, bo.getStartDate());
|
||||
lqw.eq(bo.getEndDate() != null, TrainingCourses::getEndDate, bo.getEndDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLocation()), TrainingCourses::getLocation, bo.getLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), TrainingCourses::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getCreatedAt() != null, TrainingCourses::getCreatedAt, bo.getCreatedAt());
|
||||
lqw.eq(bo.getUpdatedAt() != null, TrainingCourses::getUpdatedAt, bo.getUpdatedAt());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCourseId()), TrainingCourses::getCourseId, bo.getCourseId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增培训课程管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(TrainingCoursesBo bo) {
|
||||
TrainingCourses add = MapstructUtils.convert(bo, TrainingCourses.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改培训课程管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TrainingCoursesBo bo) {
|
||||
TrainingCourses update = MapstructUtils.convert(bo, TrainingCourses.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(TrainingCourses entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除培训课程管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user