修复一些问题

This commit is contained in:
fengcheng
2025-01-08 16:55:26 +08:00
parent 082aaf5b8b
commit 393a430e83
8 changed files with 420 additions and 3657 deletions

View File

@@ -10,9 +10,9 @@ spring:
username: root
password: haoxin
# master:
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: ry-vue
# password: Y8cTTmrLh8D3F6sE
# url: jdbc:mysql://localhost:3306/ry-vue-tenant?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: ry-vue-tenant
# password: 6W2rGdaFPTpSbz4r
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@@ -7,8 +7,8 @@ ruoyi:
# 版权年份
copyrightYear: 2024
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
# profile: /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
profile: /home/ruoyi/uploadPath
# profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
@@ -115,7 +115,7 @@ spring:
# 数据库索引
database: 5
# 密码
# password: ruoyi123
# password: admin123
password:
# 连接超时时间
timeout: 10s

View File

@@ -0,0 +1,17 @@
package com.ruoyi.system.api.service;
/**
* 参数配置API 服务层
*
* @author fengcheng
*/
public interface ISysConfigServiceApi {
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数键名
* @return 参数键值
*/
public String selectConfigByKey(String configKey);
}

View File

@@ -1,47 +1,80 @@
package com.ruoyi.common.core.controller;
import java.beans.PropertyEditorSupport;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.exception.DemoModeException;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.sql.SqlUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.beans.PropertyEditorSupport;
import java.io.IOException;
import java.util.Date;
import java.util.List;
/**
* web层通用数据处理
*
*
* @author fengcheng
*/
public class BaseController
{
public class BaseController {
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
@ModelAttribute
public void init(HttpServletRequest httpServletRequest, HttpServletResponse response) throws IOException {
// try {
// if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
// this.verificationRequest(httpServletRequest, response);
// }
// } catch (Exception e) {
// this.verificationRequest(httpServletRequest, response);
// }
}
/**
* 校验请假
*/
private void verificationRequest(HttpServletRequest httpServletRequest, HttpServletResponse response) {
String url = ServletUtils.getRequest().getRequestURI();
// 需要拦截的url
if (StringUtils.isNotEmpty(url) && (url.indexOf("/genCode") >= 0 || url.indexOf("/export") >= 0)) {
throw new DemoModeException();
}
// 需要放开的url
if (StringUtils.isNotEmpty(url) && (url.contains("/demo") || url.contains("/tool/gen"))) {
return;
}
// 增删改 请求
if ("DELETE".equals(httpServletRequest.getMethod()) || "POST".equals(httpServletRequest.getMethod())
|| "PUT".equals(httpServletRequest.getMethod())) {
throw new DemoModeException();
}
}
/**
* 将前台传递过来的日期格式的字符串自动转化为Date类型
*/
@InitBinder
public void initBinder(WebDataBinder binder)
{
public void initBinder(WebDataBinder binder) {
// Date 类型转换
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
{
binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
@Override
public void setAsText(String text)
{
public void setAsText(String text) {
setValue(DateUtils.parseDate(text));
}
});
@@ -50,19 +83,16 @@ public class BaseController
/**
* 设置请求分页数据
*/
protected void startPage()
{
protected void startPage() {
PageUtils.startPage();
}
/**
* 设置请求排序数据
*/
protected void startOrderBy()
{
protected void startOrderBy() {
PageDomain pageDomain = TableSupport.buildPageRequest();
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
{
if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) {
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper.orderBy(orderBy);
}
@@ -71,17 +101,15 @@ public class BaseController
/**
* 清理分页的线程变量
*/
protected void clearPage()
{
protected void clearPage() {
PageUtils.clearPage();
}
/**
* 响应请求分页数据
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
protected TableDataInfo getDataTable(List<?> list)
{
@SuppressWarnings({"rawtypes", "unchecked"})
protected TableDataInfo getDataTable(List<?> list) {
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
@@ -93,110 +121,97 @@ public class BaseController
/**
* 返回成功
*/
public AjaxResult success()
{
public AjaxResult success() {
return AjaxResult.success();
}
/**
* 返回失败消息
*/
public AjaxResult error()
{
public AjaxResult error() {
return AjaxResult.error();
}
/**
* 返回成功消息
*/
public AjaxResult success(String message)
{
public AjaxResult success(String message) {
return AjaxResult.success(message);
}
/**
* 返回成功消息
*/
public AjaxResult success(Object data)
{
public AjaxResult success(Object data) {
return AjaxResult.success(data);
}
/**
* 返回失败消息
*/
public AjaxResult error(String message)
{
public AjaxResult error(String message) {
return AjaxResult.error(message);
}
/**
* 返回警告消息
*/
public AjaxResult warn(String message)
{
public AjaxResult warn(String message) {
return AjaxResult.warn(message);
}
/**
* 响应返回结果
*
*
* @param rows 影响行数
* @return 操作结果
*/
protected AjaxResult toAjax(int rows)
{
protected AjaxResult toAjax(int rows) {
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
/**
* 响应返回结果
*
*
* @param result 结果
* @return 操作结果
*/
protected AjaxResult toAjax(boolean result)
{
protected AjaxResult toAjax(boolean result) {
return result ? success() : error();
}
/**
* 页面跳转
*/
public String redirect(String url)
{
public String redirect(String url) {
return StringUtils.format("redirect:{}", url);
}
/**
* 获取用户缓存信息
*/
public LoginUser getLoginUser()
{
public LoginUser getLoginUser() {
return SecurityUtils.getLoginUser();
}
/**
* 获取登录用户id
*/
public Long getUserId()
{
public Long getUserId() {
return getLoginUser().getUserId();
}
/**
* 获取登录部门id
*/
public Long getDeptId()
{
public Long getDeptId() {
return getLoginUser().getDeptId();
}
/**
* 获取登录用户名
*/
public String getUsername()
{
public String getUsername() {
return getLoginUser().getUsername();
}
}

View File

@@ -0,0 +1,29 @@
package com.ruoyi.system.api.impl;
import com.ruoyi.system.api.service.ISysConfigServiceApi;
import com.ruoyi.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 参数配置API 服务实现
*
* @author fengcheng
*/
@Service
public class SysConfigServiceApiImpl implements ISysConfigServiceApi {
@Autowired
private ISysConfigService configService;
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数键名
* @return 参数键值
*/
@Override
public String selectConfigByKey(String configKey) {
return configService.selectConfigByKey(configKey);
}
}

View File

@@ -87,6 +87,7 @@
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="updater != null and updater != ''">and updater = #{updater}</if>
and del_flag = '0'
</where>
</select>

View File

@@ -2,7 +2,7 @@
<div class="app-container home">
<el-row :gutter="20">
<el-col :sm="24" :lg="12" style="padding-left: 20px">
<h2>基于RuoYi-Vue+Flowable的工作流管理平台</h2>
<h2>基于RuoYi-Vue+Flowable的多租户工作流管理平台</h2>
<p>
我看咯蛮多工作流开源项目的发现不合适我们公司产品所有我直接仿照别人做咯一个新增咯模型模板流程菜单等功能希望对大家有帮助谢谢
</p>
@@ -98,7 +98,7 @@
<el-collapse accordion v-model="activeNames">
<el-collapse-item title="v1.0.0 - 2024-12-31" name="1">
<ol>
<li>RuoYi-Vue+Flowable的工作流管理平台系统正式发布</li>
<li>RuoYi-Vue+Flowable的多租户工作流管理平台系统正式发布</li>
</ol>
</el-collapse-item>
</el-collapse>

File diff suppressed because one or more lines are too long