update 格式化全部代码
This commit is contained in:
+6
-6
@@ -39,9 +39,9 @@ public class MailSendController {
|
||||
/**
|
||||
* 发送邮件(带附件)
|
||||
*
|
||||
* @param to 接收人
|
||||
* @param subject 标题
|
||||
* @param text 内容
|
||||
* @param to 接收人
|
||||
* @param subject 标题
|
||||
* @param text 内容
|
||||
*/
|
||||
@GetMapping("/sendMessageWithAttachment")
|
||||
public R<Void> sendMessageWithAttachment(String to, String subject, String text) {
|
||||
@@ -53,9 +53,9 @@ public class MailSendController {
|
||||
/**
|
||||
* 发送邮件(多附件)
|
||||
*
|
||||
* @param to 接收人
|
||||
* @param subject 标题
|
||||
* @param text 内容
|
||||
* @param to 接收人
|
||||
* @param subject 标题
|
||||
* @param text 内容
|
||||
*/
|
||||
@GetMapping("/sendMessageWithAttachments")
|
||||
public R<Void> sendMessageWithAttachments(String to, String subject, String text) {
|
||||
|
||||
+5
-5
@@ -50,7 +50,7 @@ public class MqttController {
|
||||
/**
|
||||
* 订阅 QoS0 测试主题并打印原始消息。
|
||||
*
|
||||
* @param topic 消息主题
|
||||
* @param topic 消息主题
|
||||
* @param payload 消息内容
|
||||
*/
|
||||
@MqttClientSubscribe("/test/#")
|
||||
@@ -61,7 +61,7 @@ public class MqttController {
|
||||
/**
|
||||
* 订阅 QoS1 测试主题并打印原始消息。
|
||||
*
|
||||
* @param topic 消息主题
|
||||
* @param topic 消息主题
|
||||
* @param payload 消息内容
|
||||
*/
|
||||
@MqttClientSubscribe(value = "/qos1/#", qos = MqttQoS.QOS1)
|
||||
@@ -72,7 +72,7 @@ public class MqttController {
|
||||
/**
|
||||
* 订阅带产品和设备占位符的注册主题。
|
||||
*
|
||||
* @param topic 消息主题
|
||||
* @param topic 消息主题
|
||||
* @param payload 消息内容
|
||||
*/
|
||||
@MqttClientSubscribe("/sys/${productKey}/${deviceName}/thing/sub/register")
|
||||
@@ -85,9 +85,9 @@ public class MqttController {
|
||||
/**
|
||||
* 订阅 JSON 测试主题并演示自定义反序列化。
|
||||
*
|
||||
* @param topic 消息主题
|
||||
* @param topic 消息主题
|
||||
* @param message MQTT 原始消息
|
||||
* @param data 反序列化后的演示数据
|
||||
* @param data 反序列化后的演示数据
|
||||
*/
|
||||
@MqttClientSubscribe(
|
||||
value = "/test/json",
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
package org.dromara.demo.controller;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ public class SmsController {
|
||||
* @param phone 手机号
|
||||
*/
|
||||
@GetMapping("/addBlacklist")
|
||||
public R<Object> addBlacklist(String phone){
|
||||
public R<Object> addBlacklist(String phone) {
|
||||
SmsBlend smsBlend = SmsFactory.getSmsBlend("config1");
|
||||
smsBlend.joinInBlacklist(phone);
|
||||
return R.ok();
|
||||
@@ -73,7 +73,7 @@ public class SmsController {
|
||||
* @param phone 手机号
|
||||
*/
|
||||
@GetMapping("/removeBlacklist")
|
||||
public R<Object> removeBlacklist(String phone){
|
||||
public R<Object> removeBlacklist(String phone) {
|
||||
SmsBlend smsBlend = SmsFactory.getSmsBlend("config1");
|
||||
smsBlend.removeFromBlacklist(phone);
|
||||
return R.ok();
|
||||
|
||||
+10
-10
@@ -1,36 +1,36 @@
|
||||
package org.dromara.demo.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.PageResult;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.ValidatorUtils;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.PageResult;
|
||||
import org.dromara.common.excel.core.ExcelResult;
|
||||
import org.dromara.common.excel.utils.ExcelBuilder;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.demo.domain.TestDemo;
|
||||
import org.dromara.demo.domain.bo.TestDemoBo;
|
||||
import org.dromara.demo.domain.vo.TestDemoImportVo;
|
||||
import org.dromara.demo.domain.vo.TestDemoVo;
|
||||
import org.dromara.demo.service.ITestDemoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
||||
+3
-4
@@ -1,17 +1,16 @@
|
||||
package org.dromara.demo.controller;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.MessageUtils;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
|
||||
/**
|
||||
* 测试国际化
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
package org.dromara.demo.controller;
|
||||
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.sensitive.annotation.Sensitive;
|
||||
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.sensitive.annotation.Sensitive;
|
||||
import org.dromara.common.sensitive.core.SensitiveService;
|
||||
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
+6
-6
@@ -1,25 +1,25 @@
|
||||
package org.dromara.demo.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.excel.utils.ExcelBuilder;
|
||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.demo.domain.bo.TestTreeBo;
|
||||
import org.dromara.demo.domain.vo.TestTreeVo;
|
||||
import org.dromara.demo.service.ITestTreeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class WebSocketController {
|
||||
/**
|
||||
* 发布消息
|
||||
*
|
||||
* @param userId 目标用户
|
||||
* @param userId 目标用户
|
||||
* @param message 发送内容
|
||||
*/
|
||||
@GetMapping("/send")
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package org.dromara.demo.controller.queue;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.redis.utils.QueueUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.redis.utils.QueueUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package org.dromara.demo.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import org.dromara.common.encrypt.annotation.EncryptField;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.encrypt.annotation.EncryptField;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
|
||||
/**
|
||||
* 测试加密字段实体。
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package org.dromara.demo.domain.vo;
|
||||
|
||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||
import org.dromara.common.core.enums.UserStatus;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
|
||||
+2
-3
@@ -1,11 +1,10 @@
|
||||
package org.dromara.demo.domain.vo;
|
||||
|
||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||
import org.dromara.demo.domain.TestDemo;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.dromara.demo.domain.vo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||
import org.apache.fesod.sheet.annotation.format.DateTimeFormat;
|
||||
@@ -8,8 +10,6 @@ import org.dromara.common.excel.annotation.ExcelRequired;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.demo.domain.TestDemo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package org.dromara.demo.domain.vo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||
import org.dromara.demo.domain.TestTree;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class ExportDemoListener extends DefaultExcelListener<ExportDemoVo> {
|
||||
/**
|
||||
* 解析并校验一行下拉框演示数据。
|
||||
*
|
||||
* @param data 行数据
|
||||
* @param data 行数据
|
||||
* @param context 解析上下文
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface TestDemoMapper extends BaseMapperPlus<TestDemo, TestDemoVo> {
|
||||
/**
|
||||
* 自定义分页查询演示数据。
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param page 分页对象
|
||||
* @param wrapper 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ public interface TestDemoMapper extends BaseMapperPlus<TestDemo, TestDemoVo> {
|
||||
/**
|
||||
* 分页查询演示 VO 列表并应用数据权限。
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param page 分页对象
|
||||
* @param wrapper 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package org.dromara.demo.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.PageResult;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.demo.domain.TestDemo;
|
||||
import org.dromara.demo.domain.bo.TestDemoBo;
|
||||
import org.dromara.demo.domain.vo.TestDemoVo;
|
||||
@@ -28,7 +28,7 @@ public interface ITestDemoService {
|
||||
/**
|
||||
* 分页查询测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分页结果
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ public interface ITestDemoService {
|
||||
/**
|
||||
* 按自定义 SQL 分页查询测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分页结果
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package org.dromara.demo.service.impl;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.apache.fesod.sheet.write.metadata.WriteSheet;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fesod.sheet.write.metadata.WriteSheet;
|
||||
import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
@@ -115,7 +115,7 @@ public class ExportExcelServiceImpl implements IExportExcelService {
|
||||
* 构建下拉框显示值。
|
||||
*
|
||||
* @param cityDataList 城市演示数据列表
|
||||
* @param id 选项 id
|
||||
* @param id 选项 id
|
||||
* @return 下拉框显示值
|
||||
*/
|
||||
private String buildOptions(List<DemoCityData> cityDataList, Integer id) {
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
/**
|
||||
* 分页查询测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分页结果
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
/**
|
||||
* 通过自定义 SQL 分页查询测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分页结果
|
||||
*/
|
||||
@@ -139,7 +139,7 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
/**
|
||||
* 按主键集合删除测试单表数据,并按需执行删除前校验。
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否执行删除校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
|
||||
+2
-2
@@ -39,13 +39,13 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
||||
return treeMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
// @DS("slave") // 切换从库查询
|
||||
/**
|
||||
* 查询符合条件的测试树表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 结果列表
|
||||
*/
|
||||
// @DS("slave") // 切换从库查询
|
||||
@Override
|
||||
public List<TestTreeVo> queryList(TestTreeBo bo) {
|
||||
LambdaQueryWrapper<TestTree> lqw = buildQueryWrapper(bo);
|
||||
@@ -109,7 +109,7 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
||||
/**
|
||||
* 按主键集合删除测试树表数据,并按需执行删除前校验。
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否执行删除校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
|
||||
+2
-2
@@ -82,9 +82,9 @@ public class MyBatisDataSourceMonitor implements DataSourceMonitor {
|
||||
*/
|
||||
@Override
|
||||
public String key(DataRuntime runtime, Object datasource) {
|
||||
if(datasource instanceof JdbcTemplate jdbc){
|
||||
if (datasource instanceof JdbcTemplate jdbc) {
|
||||
DataSource ds = jdbc.getDataSource();
|
||||
if(ds instanceof DynamicRoutingDataSource){
|
||||
if (ds instanceof DynamicRoutingDataSource) {
|
||||
return DynamicDataSourceContextHolder.peek();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.lock.annotation.Lock4j;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.PageResult;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.PageResult;
|
||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.gen.domain.GenTable;
|
||||
import org.dromara.gen.domain.GenTableColumn;
|
||||
@@ -41,7 +41,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 分页查询代码生成业务列表。
|
||||
*
|
||||
* @param genTable 查询条件
|
||||
* @param genTable 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 代码生成列表
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 分页查询数据库表列表。
|
||||
*
|
||||
* @param genTable 查询条件
|
||||
* @param genTable 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 数据库表列表
|
||||
*/
|
||||
@@ -162,7 +162,7 @@ public class GenController extends BaseController {
|
||||
* 生成代码(下载方式)
|
||||
*
|
||||
* @param response HTTP 响应
|
||||
* @param tableId 表ID
|
||||
* @param tableId 表ID
|
||||
*/
|
||||
@SaCheckPermission("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@@ -190,7 +190,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 批量生成代码
|
||||
*
|
||||
* @param response HTTP 响应
|
||||
* @param response HTTP 响应
|
||||
* @param tableIdStr 表ID串
|
||||
*/
|
||||
@SaCheckPermission("tool:gen:code")
|
||||
@@ -206,7 +206,7 @@ public class GenController extends BaseController {
|
||||
* 将生成结果写出为 zip 文件流。
|
||||
*
|
||||
* @param response HTTP 响应
|
||||
* @param data zip 二进制数据
|
||||
* @param data zip 二进制数据
|
||||
*/
|
||||
private void genCode(HttpServletResponse response, byte[] data) throws IOException {
|
||||
response.reset();
|
||||
|
||||
@@ -3,13 +3,13 @@ package org.dromara.gen.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.gen.constant.GenConstants;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.gen.constant.GenConstants;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,7 +20,6 @@ public interface GenTableMapper extends BaseMapperPlus<GenTable, GenTable> {
|
||||
*
|
||||
* @param dataName 数据源名称,用于选择不同的数据源
|
||||
* @return 当前数据库中的表名列表
|
||||
*
|
||||
* @DS("") 使用默认数据源执行查询操作
|
||||
*/
|
||||
@DS("")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.dromara.gen.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.PageResult;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.gen.domain.GenTable;
|
||||
import org.dromara.gen.domain.GenTableColumn;
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class TestMapJobAnnotation {
|
||||
/**
|
||||
* 根 Map 任务,将示例数据拆分为多个分片任务。
|
||||
*
|
||||
* @param mapArgs Map 任务参数
|
||||
* @param mapArgs Map 任务参数
|
||||
* @param mapHandler 分片调度处理器
|
||||
* @return 分片调度结果
|
||||
*/
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class TestMapReduceAnnotation1 {
|
||||
/**
|
||||
* 根 Map 任务,将示例数据拆分为多个分片任务。
|
||||
*
|
||||
* @param mapArgs Map 任务参数
|
||||
* @param mapArgs Map 任务参数
|
||||
* @param mapHandler 分片调度处理器
|
||||
* @return 分片调度结果
|
||||
*/
|
||||
|
||||
+14
-13
@@ -37,18 +37,18 @@ public class CacheController {
|
||||
try {
|
||||
Properties commandStats = connection.commands().info("commandstats");
|
||||
List<Map<String, String>> pieList = new ArrayList<>();
|
||||
if (commandStats != null) {
|
||||
commandStats.stringPropertyNames().forEach(key -> {
|
||||
Map<String, String> data = new HashMap<>(2);
|
||||
String property = commandStats.getProperty(key);
|
||||
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
||||
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
||||
pieList.add(data);
|
||||
});
|
||||
}
|
||||
return R.ok(new CacheListInfoVo(
|
||||
connection.commands().info(),
|
||||
connection.commands().dbSize(), pieList));
|
||||
if (commandStats != null) {
|
||||
commandStats.stringPropertyNames().forEach(key -> {
|
||||
Map<String, String> data = new HashMap<>(2);
|
||||
String property = commandStats.getProperty(key);
|
||||
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
||||
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
||||
pieList.add(data);
|
||||
});
|
||||
}
|
||||
return R.ok(new CacheListInfoVo(
|
||||
connection.commands().info(),
|
||||
connection.commands().dbSize(), pieList));
|
||||
} finally {
|
||||
// 归还连接给连接池
|
||||
RedisConnectionUtils.releaseConnection(connection, connectionFactory);
|
||||
@@ -62,6 +62,7 @@ public class CacheController {
|
||||
* @param dbSize 数据库
|
||||
* @param commandStats 命令统计
|
||||
*/
|
||||
public record CacheListInfoVo(Properties info, Long dbSize, List<Map<String, String>> commandStats) {}
|
||||
public record CacheListInfoVo(Properties info, Long dbSize, List<Map<String, String>> commandStats) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class SysLoginInfoController extends BaseController {
|
||||
* 导出系统访问记录列表。
|
||||
*
|
||||
* @param loginInfo 查询条件
|
||||
* @param response HTTP 响应
|
||||
* @param response HTTP 响应
|
||||
*/
|
||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("monitor:logininfo:export")
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ public class SysOperlogController extends BaseController {
|
||||
/**
|
||||
* 分页查询操作日志记录。
|
||||
*
|
||||
* @param operLog 查询条件
|
||||
* @param operLog 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 操作日志分页结果
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ public class SysOperlogController extends BaseController {
|
||||
/**
|
||||
* 导出操作日志记录列表。
|
||||
*
|
||||
* @param operLog 查询条件
|
||||
* @param operLog 查询条件
|
||||
* @param response HTTP 响应
|
||||
*/
|
||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ public class SysClientController extends BaseController {
|
||||
/**
|
||||
* 分页查询客户端管理列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 客户端分页数据
|
||||
*/
|
||||
@@ -53,7 +53,7 @@ public class SysClientController extends BaseController {
|
||||
/**
|
||||
* 导出客户端管理列表,便于离线审计与配置核查。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param response 响应流
|
||||
*/
|
||||
@SaCheckPermission("system:client:export")
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class SysDictDataController extends BaseController {
|
||||
/**
|
||||
* 分页查询字典数据列表。
|
||||
*
|
||||
* @param dictData 查询条件
|
||||
* @param dictData 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 字典数据分页结果
|
||||
*/
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class SysDictTypeController extends BaseController {
|
||||
/**
|
||||
* 分页查询字典类型列表。
|
||||
*
|
||||
* @param dictType 查询条件
|
||||
* @param dictType 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 字典类型分页结果
|
||||
*/
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class SysNoticeController extends BaseController {
|
||||
/**
|
||||
* 分页查询通知公告列表。
|
||||
*
|
||||
* @param notice 查询条件
|
||||
* @param notice 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 公告分页结果
|
||||
*/
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class SysOssConfigController extends BaseController {
|
||||
/**
|
||||
* 分页查询对象存储配置列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 配置分页数据
|
||||
*/
|
||||
|
||||
+3
-3
@@ -40,7 +40,7 @@ public class SysOssController extends BaseController {
|
||||
/**
|
||||
* 分页查询 OSS 对象存储列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return OSS 分页结果
|
||||
*/
|
||||
@@ -108,9 +108,9 @@ public class SysOssController extends BaseController {
|
||||
/**
|
||||
* OSS 上传响应对象。
|
||||
*
|
||||
* @param url 文件访问地址
|
||||
* @param url 文件访问地址
|
||||
* @param fileName 原始文件名
|
||||
* @param ossId OSS 对象 ID
|
||||
* @param ossId OSS 对象 ID
|
||||
*/
|
||||
public record SysOssUploadVo(String url, String fileName, String ossId) {
|
||||
}
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ public class SysPostController extends BaseController {
|
||||
/**
|
||||
* 分页查询岗位列表。
|
||||
*
|
||||
* @param post 查询条件
|
||||
* @param post 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 岗位分页结果
|
||||
*/
|
||||
@@ -56,7 +56,7 @@ public class SysPostController extends BaseController {
|
||||
/**
|
||||
* 导出岗位列表。
|
||||
*
|
||||
* @param post 查询条件
|
||||
* @param post 查询条件
|
||||
* @param response HTTP 响应
|
||||
*/
|
||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||
|
||||
+2
-2
@@ -162,8 +162,8 @@ public class SysProfileController extends BaseController {
|
||||
* @param newPassword 新密码
|
||||
*/
|
||||
public record SysUserPasswordBo(
|
||||
@NotBlank(message = "旧密码不能为空") String oldPassword,
|
||||
@NotBlank(message = "新密码不能为空") String newPassword) {
|
||||
@NotBlank(message = "旧密码不能为空") String oldPassword,
|
||||
@NotBlank(message = "新密码不能为空") String newPassword) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public class SysMenu extends BaseEntity {
|
||||
}
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (Constants.TOP_PARENT_ID.equals(getParentId()) && SystemConstants.TYPE_DIR.equals(getMenuType())
|
||||
&& SystemConstants.NO.equals(getIsFrame())) {
|
||||
&& SystemConstants.NO.equals(getIsFrame())) {
|
||||
routerPath = "/" + this.path;
|
||||
}
|
||||
// 非外链并且是一级目录(类型为菜单)
|
||||
|
||||
+4
-4
@@ -28,7 +28,7 @@ public class SysClientBo implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotNull(message = "id不能为空", groups = { EditGroup.class })
|
||||
@NotNull(message = "id不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@@ -39,19 +39,19 @@ public class SysClientBo implements Serializable {
|
||||
/**
|
||||
* 客户端key
|
||||
*/
|
||||
@NotBlank(message = "客户端key不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "客户端key不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String clientKey;
|
||||
|
||||
/**
|
||||
* 客户端秘钥
|
||||
*/
|
||||
@NotBlank(message = "客户端秘钥不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "客户端秘钥不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 授权类型
|
||||
*/
|
||||
@NotNull(message = "授权类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotNull(message = "授权类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private List<String> grantTypeList;
|
||||
|
||||
/**
|
||||
|
||||
+5
-5
@@ -28,25 +28,25 @@ public class SysSocialBo implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 认证唯一ID
|
||||
*/
|
||||
@NotBlank(message = "认证唯一ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "认证唯一ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String authId;
|
||||
|
||||
/**
|
||||
* 用户来源
|
||||
*/
|
||||
@NotBlank(message = "用户来源不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "用户来源不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 用户的授权令牌
|
||||
*/
|
||||
@NotBlank(message = "用户的授权令牌不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "用户的授权令牌不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ public class SysSocialBo implements Serializable {
|
||||
/**
|
||||
* 用户的 ID
|
||||
*/
|
||||
@NotBlank(message = "用户的ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "用户的ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -10,8 +10,8 @@ import org.dromara.system.domain.SysDept;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
-1
@@ -13,7 +13,6 @@ import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 系统访问记录视图对象 sys_login_info
|
||||
*
|
||||
|
||||
+1
-1
@@ -6,8 +6,8 @@ import org.dromara.system.domain.SysMenu;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通知公告视图对象 sys_notice
|
||||
*
|
||||
|
||||
+5
-5
@@ -3,9 +3,9 @@ package org.dromara.system.event;
|
||||
/**
|
||||
* OSS 配置变更事件。
|
||||
*
|
||||
* @param configKey 当前配置 key
|
||||
* @param oldConfigKey 变更前配置 key
|
||||
* @param configJson 当前配置 JSON,为空表示清理缓存
|
||||
* @param configKey 当前配置 key
|
||||
* @param oldConfigKey 变更前配置 key
|
||||
* @param configJson 当前配置 JSON,为空表示清理缓存
|
||||
* @param defaultConfig 是否设置为默认配置
|
||||
*/
|
||||
public record OssConfigChangeEvent(
|
||||
@@ -18,9 +18,9 @@ public record OssConfigChangeEvent(
|
||||
/**
|
||||
* 创建保存 OSS 配置后的变更事件。
|
||||
*
|
||||
* @param configKey 当前配置 key
|
||||
* @param configKey 当前配置 key
|
||||
* @param oldConfigKey 变更前配置 key
|
||||
* @param configJson 当前配置 JSON
|
||||
* @param configJson 当前配置 JSON
|
||||
* @return OSS 配置变更事件
|
||||
*/
|
||||
public static OssConfigChangeEvent save(String configKey, String oldConfigKey, String configJson) {
|
||||
|
||||
+4
-4
@@ -59,8 +59,8 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo>, MPJBa
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
* @param user 查询条件
|
||||
* @param deptIds 部门ID集合
|
||||
* @param user 查询条件
|
||||
* @param deptIds 部门ID集合
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@DataPermission({
|
||||
@@ -87,8 +87,8 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo>, MPJBa
|
||||
/**
|
||||
* 根据条件分页查询已配用户角色列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param user 查询条件
|
||||
* @param page 分页信息
|
||||
* @param user 查询条件
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@DataPermission({
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ public interface ISysLoginInfoService {
|
||||
* 分页查询登录日志列表
|
||||
*
|
||||
* @param loginInfo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @param pageQuery 分页参数
|
||||
* @return 登录日志分页列表
|
||||
*/
|
||||
PageResult<SysLoginInfoVo> selectPageLoginInfoList(SysLoginInfoBo loginInfo, PageQuery pageQuery);
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public interface ISysOssService {
|
||||
/**
|
||||
* 文件下载方法,支持一次性下载完整文件
|
||||
*
|
||||
* @param ossId OSS对象ID
|
||||
* @param ossId OSS对象ID
|
||||
*/
|
||||
ResponseEntity<byte[]> download(Long ossId);
|
||||
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ public interface ISysPermissionService {
|
||||
/**
|
||||
* 获取角色数据权限
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param userId 用户id
|
||||
* @return 角色权限信息
|
||||
*/
|
||||
Set<String> getRolePermission(Long userId);
|
||||
@@ -24,7 +24,7 @@ public interface ISysPermissionService {
|
||||
/**
|
||||
* 获取菜单数据权限
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param userId 用户id
|
||||
* @return 菜单权限信息
|
||||
*/
|
||||
Set<String> getMenuPermission(Long userId);
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public interface ISysUserService {
|
||||
* 根据条件分页查询已分配用户角色列表
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @param pageQuery 分页
|
||||
* @param pageQuery 分页
|
||||
* @return 已分配角色的用户分页信息
|
||||
*/
|
||||
PageResult<SysUserVo> selectAllocatedList(SysUserBo user, PageQuery pageQuery);
|
||||
|
||||
+3
-3
@@ -213,8 +213,8 @@ public class SysClientServiceImpl implements ISysClientService {
|
||||
/**
|
||||
* 统一处理白名单与路径规则的入库格式。
|
||||
*
|
||||
* @param rawValue 原始字符串
|
||||
* @param listValue 列表值
|
||||
* @param rawValue 原始字符串
|
||||
* @param listValue 列表值
|
||||
* @param normalizer 单条规则归一化器
|
||||
* @return 逗号拼接后的规则串
|
||||
*/
|
||||
@@ -234,7 +234,7 @@ public class SysClientServiceImpl implements ISysClientService {
|
||||
/**
|
||||
* 将规则串转换为列表。
|
||||
*
|
||||
* @param value 规则串
|
||||
* @param value 规则串
|
||||
* @param normalizer 单条规则归一化器
|
||||
* @return 规则列表
|
||||
*/
|
||||
|
||||
+9
-10
@@ -14,8 +14,8 @@ import org.dromara.common.core.utils.ServletUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.ip.AddressUtils;
|
||||
import org.dromara.common.log.event.LoginInfoEvent;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.mapper.LambdaCrudChainWrapper;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.system.domain.SysLoginInfo;
|
||||
import org.dromara.system.domain.bo.SysLoginInfoBo;
|
||||
@@ -66,14 +66,13 @@ public class SysLoginInfoServiceImpl implements ISysLoginInfoService {
|
||||
}
|
||||
|
||||
String address = AddressUtils.getRealAddressByIP(ip);
|
||||
StringBuilder s = new StringBuilder();
|
||||
s.append(getBlock(ip));
|
||||
s.append(address);
|
||||
s.append(getBlock(loginInfoEvent.getUsername()));
|
||||
s.append(getBlock(loginInfoEvent.getStatus()));
|
||||
s.append(getBlock(loginInfoEvent.getMessage()));
|
||||
String s = getBlock(ip) +
|
||||
address +
|
||||
getBlock(loginInfoEvent.getUsername()) +
|
||||
getBlock(loginInfoEvent.getStatus()) +
|
||||
getBlock(loginInfoEvent.getMessage());
|
||||
// 打印信息到日志
|
||||
log.info(s.toString(), loginInfoEvent.getArgs());
|
||||
log.info(s, loginInfoEvent.getArgs());
|
||||
// 获取客户端操作系统
|
||||
String os = userAgent.getOs().getName();
|
||||
// 获取客户端浏览器
|
||||
@@ -110,14 +109,14 @@ public class SysLoginInfoServiceImpl implements ISysLoginInfoService {
|
||||
if (msg == null) {
|
||||
msg = "";
|
||||
}
|
||||
return "[" + msg.toString() + "]";
|
||||
return "[" + msg + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询登录日志列表
|
||||
*
|
||||
* @param loginInfo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @param pageQuery 分页参数
|
||||
* @return 登录日志分页列表
|
||||
*/
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -211,8 +211,8 @@ public class SysMessageServiceImpl implements ISysMessageService, MessageService
|
||||
// 全局消息 或 当前用户在接收人范围内
|
||||
.and(wrapper ->
|
||||
wrapper.eq(SysMessage::getSendUserIds, GLOBAL_USER_IDS)
|
||||
.or()
|
||||
.findInSet(userId, SysMessage::getSendUserIds)
|
||||
.or()
|
||||
.findInSet(userId, SysMessage::getSendUserIds)
|
||||
)
|
||||
.orderByDesc(SysMessage::getCreateTime, SysMessage::getMessageId)
|
||||
// 分页查询(只查第一页,最多100条)
|
||||
|
||||
+1
-5
@@ -11,11 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.constant.CacheNames;
|
||||
import org.dromara.common.core.domain.PageResult;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.ThreadUtils;
|
||||
import org.dromara.common.core.utils.*;
|
||||
import org.dromara.common.core.utils.file.FileUtils;
|
||||
import org.dromara.common.json.utils.JsonUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
-1
@@ -365,7 +365,6 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增角色菜单信息
|
||||
*
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import java.lang.annotation.Target;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@ConditionalOnProperty(value = "warm-flow.enabled", havingValue = "true")
|
||||
public @interface ConditionalOnEnable {
|
||||
}
|
||||
|
||||
-1
@@ -102,7 +102,6 @@ public enum TaskAssigneeEnum {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 获取所有办理人类型的代码列表,通常用于程序内部逻辑判断。
|
||||
*
|
||||
|
||||
+8
-10
@@ -77,21 +77,19 @@ public enum TaskStatusEnum {
|
||||
*/
|
||||
TIMEOUT("timeout", "超时");
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final String status;
|
||||
|
||||
/**
|
||||
* 状态描述。
|
||||
*/
|
||||
private final String desc;
|
||||
|
||||
/**
|
||||
* 状态编码与描述缓存。
|
||||
*/
|
||||
private static final Map<String, String> STATUS_DESC_MAP = Arrays.stream(values())
|
||||
.collect(Collectors.toConcurrentMap(TaskStatusEnum::getStatus, TaskStatusEnum::getDesc));
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final String status;
|
||||
/**
|
||||
* 状态描述。
|
||||
*/
|
||||
private final String desc;
|
||||
|
||||
/**
|
||||
* 根据状态编码获取任务业务状态描述。
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class FlwCategoryController extends BaseController {
|
||||
/**
|
||||
* 导出流程分类列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param response 响应流
|
||||
*/
|
||||
@SaCheckPermission("workflow:category:export")
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ public class FlwSpelController extends BaseController {
|
||||
/**
|
||||
* 分页查询流程 SpEL 表达式定义列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 表达式分页数据
|
||||
*/
|
||||
@@ -63,7 +63,7 @@ public class FlwSpelController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* /**
|
||||
* 新增流程 SpEL 表达式定义。
|
||||
*
|
||||
* @param bo 表达式信息
|
||||
|
||||
+6
-7
@@ -89,7 +89,7 @@ public class FlwTaskController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* /**
|
||||
* 查询全部待办任务。
|
||||
*
|
||||
* @param flowTaskBo 参数
|
||||
@@ -126,7 +126,7 @@ public class FlwTaskController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* /**
|
||||
* 根据任务 id 查询任务详情。
|
||||
*
|
||||
* @param taskId 任务id
|
||||
@@ -138,7 +138,7 @@ public class FlwTaskController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* /**
|
||||
* 获取流程下一节点信息。
|
||||
*
|
||||
* @param bo 参数
|
||||
@@ -150,7 +150,7 @@ public class FlwTaskController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* /**
|
||||
* 终止流程任务。
|
||||
*
|
||||
* @param bo 参数
|
||||
@@ -207,8 +207,8 @@ public class FlwTaskController extends BaseController {
|
||||
/**
|
||||
* 获取当前任务可驳回的前置节点。
|
||||
*
|
||||
* @param taskId 任务id
|
||||
* @param nowNodeCode 当前节点
|
||||
* @param taskId 任务id
|
||||
* @param nowNodeCode 当前节点
|
||||
* @return 可驳回节点列表
|
||||
*/
|
||||
@GetMapping("/getBackTaskNode/{taskId}/{nowNodeCode}")
|
||||
@@ -216,7 +216,6 @@ public class FlwTaskController extends BaseController {
|
||||
return R.ok(flwTaskService.getBackTaskNode(taskId, nowNodeCode));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 获取当前任务的所有办理人。
|
||||
*
|
||||
|
||||
+3
-3
@@ -42,7 +42,7 @@ public class TestLeaveController extends BaseController {
|
||||
/**
|
||||
* 分页查询请假列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 请假分页数据
|
||||
*/
|
||||
@@ -53,10 +53,10 @@ public class TestLeaveController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* /**
|
||||
* 导出请假列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param response 响应流
|
||||
*/
|
||||
@SaCheckPermission("workflow:leave:export")
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class FlowCategoryBo implements Serializable {
|
||||
/**
|
||||
* 流程分类ID
|
||||
*/
|
||||
@NotNull(message = "流程分类ID不能为空", groups = { EditGroup.class })
|
||||
@NotNull(message = "流程分类ID不能为空", groups = {EditGroup.class})
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -48,13 +48,13 @@ public class FlowSpelBo implements Serializable {
|
||||
/**
|
||||
* 预览spel值
|
||||
*/
|
||||
@NotBlank(message = "预览spel值不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "预览spel值不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String viewSpel;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@NotBlank(message = "状态(0正常 1停用)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "状态(0正常 1停用)不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String status;
|
||||
|
||||
/**
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
package org.dromara.workflow.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.warm.flow.core.entity.User;
|
||||
|
||||
+11
-11
@@ -26,11 +26,11 @@ public class FlowProcessEventHandler {
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成等)
|
||||
*
|
||||
* @param flowCode 流程定义编码
|
||||
* @param instance 实例数据
|
||||
* @param status 流程状态
|
||||
* @param params 办理参数
|
||||
* @param submit 当为true时为申请人节点办理
|
||||
* @param flowCode 流程定义编码
|
||||
* @param instance 实例数据
|
||||
* @param status 流程状态
|
||||
* @param params 办理参数
|
||||
* @param submit 当为true时为申请人节点办理
|
||||
*/
|
||||
public void processHandler(String flowCode, Instance instance, String status, Map<String, Object> params, boolean submit) {
|
||||
log.info("【流程事件发布】流程编码: {}, 业务ID: {}, 流程状态: {}, 节点类型: {}, 节点编码: {}, 节点名称: {}, 是否申请人节点: {}, 参数: {}",
|
||||
@@ -51,10 +51,10 @@ public class FlowProcessEventHandler {
|
||||
/**
|
||||
* 执行创建任务监听
|
||||
*
|
||||
* @param flowCode 流程定义编码
|
||||
* @param instance 实例数据
|
||||
* @param nextTask 任务
|
||||
* @param params 上一个任务的办理参数
|
||||
* @param flowCode 流程定义编码
|
||||
* @param instance 实例数据
|
||||
* @param nextTask 任务
|
||||
* @param params 上一个任务的办理参数
|
||||
*/
|
||||
public void processTaskHandler(String flowCode, Instance instance, Task nextTask, Map<String, Object> params) {
|
||||
log.info("【流程任务事件发布】流程编码: {}, 业务ID: {}, 节点类型: {}, 节点编码: {}, 节点名称: {}, 任务ID: {}",
|
||||
@@ -75,8 +75,8 @@ public class FlowProcessEventHandler {
|
||||
/**
|
||||
* 删除流程监听
|
||||
*
|
||||
* @param flowCode 流程定义编码
|
||||
* @param businessId 业务ID
|
||||
* @param flowCode 流程定义编码
|
||||
* @param businessId 业务ID
|
||||
*/
|
||||
public void processDeleteHandler(String flowCode, String businessId) {
|
||||
log.info("【流程删除事件发布】流程编码: {}, 业务ID: {}", flowCode, businessId);
|
||||
|
||||
+5
-5
@@ -207,7 +207,7 @@ public class WorkflowGlobalListener implements GlobalListener {
|
||||
}
|
||||
if (!BusinessStatusEnum.initialState(instance.getFlowStatus())) {
|
||||
if (task != null && CollUtil.isNotEmpty(nextTasks) && nextTasks.size() == 1
|
||||
&& flwCommonService.applyNodeCode(definition.getId()).equals(nextTasks.get(0).getNodeCode())) {
|
||||
&& flwCommonService.applyNodeCode(definition.getId()).equals(nextTasks.get(0).getNodeCode())) {
|
||||
// 如果为画线指定驳回 线条指定为驳回 驳回得节点为申请人节点 则修改流程状态为退回
|
||||
flowProcessEventHandler.processHandler(definition.getFlowCode(), instance, BusinessStatusEnum.BACK.getStatus(), params, false);
|
||||
notifyInitiatorIfNeeded(definition, instance, BusinessStatusEnum.BACK.getStatus(), variable);
|
||||
@@ -250,10 +250,10 @@ public class WorkflowGlobalListener implements GlobalListener {
|
||||
}
|
||||
}
|
||||
FlowEngine.insService().removeVariables(instance.getId(),
|
||||
FlowConstant.FLOW_COPY_LIST,
|
||||
FlowConstant.MESSAGE_TYPE,
|
||||
FlowConstant.MESSAGE_NOTICE,
|
||||
FlowConstant.SUBMIT
|
||||
FlowConstant.FLOW_COPY_LIST,
|
||||
FlowConstant.MESSAGE_TYPE,
|
||||
FlowConstant.MESSAGE_NOTICE,
|
||||
FlowConstant.SUBMIT
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -27,10 +27,10 @@ public interface FlwHisTaskMapper extends BaseMapperPlus<FlowHisTask, FlowHisTas
|
||||
/**
|
||||
* 分页查询已办任务列表。
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param bo 查询条件
|
||||
* @param page 分页对象
|
||||
* @param bo 查询条件
|
||||
* @param categoryIds 流程分类 ID 集合
|
||||
* @param userId 当前用户 ID
|
||||
* @param userId 当前用户 ID
|
||||
* @return 已办任务分页结果
|
||||
*/
|
||||
default Page<FlowHisTaskVo> getListFinishTask(Page<FlowHisTaskVo> page, FlowTaskBo bo, List<String> categoryIds, String userId) {
|
||||
|
||||
+6
-6
@@ -25,10 +25,10 @@ public interface FlwTaskMapper extends BaseMapperPlus<FlowTask, FlowTaskVo>, MPJ
|
||||
/**
|
||||
* 分页查询运行中的待办任务。
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param bo 查询条件
|
||||
* @param page 分页对象
|
||||
* @param bo 查询条件
|
||||
* @param categoryIds 流程分类 id 列表
|
||||
* @param userId 当前用户 id
|
||||
* @param userId 当前用户 id
|
||||
* @return 待办任务分页结果
|
||||
*/
|
||||
default Page<FlowTaskVo> getListRunTask(Page<FlowTaskVo> page, FlowTaskBo bo, List<String> categoryIds, String userId) {
|
||||
@@ -66,10 +66,10 @@ public interface FlwTaskMapper extends BaseMapperPlus<FlowTask, FlowTaskVo>, MPJ
|
||||
/**
|
||||
* 分页查询抄送任务。
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param bo 查询条件
|
||||
* @param page 分页对象
|
||||
* @param bo 查询条件
|
||||
* @param categoryIds 流程分类 id 列表
|
||||
* @param userId 当前用户 id
|
||||
* @param userId 当前用户 id
|
||||
* @return 抄送任务分页结果
|
||||
*/
|
||||
default Page<FlowTaskVo> getTaskCopyByPage(Page<FlowTaskVo> page, FlowTaskBo bo, List<String> categoryIds, String userId) {
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
|
||||
/**
|
||||
* spel表达式规则组件
|
||||
* <p>
|
||||
* 通过该组件统一管理流程定义中的spel表达式
|
||||
* 通过该组件统一管理流程定义中的spel表达式
|
||||
* </p>
|
||||
*
|
||||
* @author Michelle.Chung
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public interface ITestLeaveService {
|
||||
/**
|
||||
* 分页查询请假列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 请假分页数据
|
||||
*/
|
||||
|
||||
+3
-3
@@ -32,7 +32,7 @@ public class CategoryNameTranslationImpl implements TranslationInterface<String>
|
||||
/**
|
||||
* 将流程分类 ID 翻译为分类名称。
|
||||
*
|
||||
* @param key 流程分类 ID
|
||||
* @param key 流程分类 ID
|
||||
* @param other 额外参数
|
||||
* @return 流程分类名称
|
||||
*/
|
||||
@@ -44,7 +44,7 @@ public class CategoryNameTranslationImpl implements TranslationInterface<String>
|
||||
/**
|
||||
* 批量将流程分类 ID 翻译为分类名称。
|
||||
*
|
||||
* @param keys 流程分类 ID 集合
|
||||
* @param keys 流程分类 ID 集合
|
||||
* @param other 额外参数
|
||||
* @return 流程分类 ID 与分类名称映射
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ public class CategoryNameTranslationImpl implements TranslationInterface<String>
|
||||
/**
|
||||
* 根据原始键构建流程分类名称翻译值。
|
||||
*
|
||||
* @param source 原始键
|
||||
* @param source 原始键
|
||||
* @param categoryNames 流程分类 ID 与分类名称映射
|
||||
* @return 流程分类名称
|
||||
*/
|
||||
|
||||
+3
-3
@@ -49,7 +49,7 @@ public class FlwSpelServiceImpl implements IFlwSpelService {
|
||||
* @return 流程spel表达式定义
|
||||
*/
|
||||
@Override
|
||||
public FlowSpelVo queryById(Long id){
|
||||
public FlowSpelVo queryById(Long id) {
|
||||
return spelMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class FlwSpelServiceImpl implements IFlwSpelService {
|
||||
*
|
||||
* @param entity 待保存的 SpEL 表达式实体
|
||||
*/
|
||||
private void validEntityBeforeSave(FlowSpel entity){
|
||||
private void validEntityBeforeSave(FlowSpel entity) {
|
||||
if (StringUtils.isNotBlank(entity.getViewSpel())) {
|
||||
boolean exists = spelMapper.lambda()
|
||||
.eq(FlowSpel::getViewSpel, entity.getViewSpel())
|
||||
@@ -153,7 +153,7 @@ public class FlwSpelServiceImpl implements IFlwSpelService {
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return spelMapper.deleteByIds(ids) > 0;
|
||||
|
||||
+27
-27
@@ -106,14 +106,14 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
Map<TaskAssigneeEnum, Map<String, String>> nameMap = this.getNamesByTypes(typeIdMap);
|
||||
// 组装返回结果,保持原始顺序
|
||||
return parsedMap.entrySet().stream()
|
||||
.map(entry -> {
|
||||
String storageId = entry.getKey();
|
||||
Pair<TaskAssigneeEnum, String> parsed = entry.getValue();
|
||||
String handlerName = (parsed == null) ? null
|
||||
: nameMap.getOrDefault(parsed.getKey(), Collections.emptyMap())
|
||||
.get(parsed.getValue());
|
||||
return new HandlerFeedBackVo(storageId, handlerName);
|
||||
}).toList();
|
||||
.map(entry -> {
|
||||
String storageId = entry.getKey();
|
||||
Pair<TaskAssigneeEnum, String> parsed = entry.getValue();
|
||||
String handlerName = (parsed == null) ? null
|
||||
: nameMap.getOrDefault(parsed.getKey(), Collections.emptyMap())
|
||||
.get(parsed.getValue());
|
||||
return new HandlerFeedBackVo(storageId, handlerName);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,9 +171,9 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
*/
|
||||
private TreeFunDto<DeptDTO> buildDeptTree(List<DeptDTO> depts) {
|
||||
return new TreeFunDto<>(depts)
|
||||
.setId(dept -> Convert.toStr(dept.getDeptId()))
|
||||
.setName(DeptDTO::getDeptName)
|
||||
.setParentId(dept -> Convert.toStr(dept.getParentId()));
|
||||
.setId(dept -> Convert.toStr(dept.getDeptId()))
|
||||
.setName(DeptDTO::getDeptName)
|
||||
.setParentId(dept -> Convert.toStr(dept.getParentId()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,11 +185,11 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
*/
|
||||
private HandlerFunDto<TaskAssigneeDTO.TaskHandler> buildHandlerData(TaskAssigneeDTO dto, TaskAssigneeEnum type) {
|
||||
return new HandlerFunDto<>(dto.getList(), dto.getTotal())
|
||||
.setStorageId(assignee -> type.getCode() + assignee.getStorageId())
|
||||
.setHandlerCode(assignee -> StringUtils.blankToDefault(assignee.getHandlerCode(), "无"))
|
||||
.setHandlerName(assignee -> StringUtils.blankToDefault(assignee.getHandlerName(), "无"))
|
||||
.setGroupName(assignee -> this.getGroupName(type, assignee.getGroupName()))
|
||||
.setCreateTime(assignee -> DateUtils.formatDateTime(assignee.getCreateTime()));
|
||||
.setStorageId(assignee -> type.getCode() + assignee.getStorageId())
|
||||
.setHandlerCode(assignee -> StringUtils.blankToDefault(assignee.getHandlerCode(), "无"))
|
||||
.setHandlerName(assignee -> StringUtils.blankToDefault(assignee.getHandlerName(), "无"))
|
||||
.setGroupName(assignee -> this.getGroupName(type, assignee.getGroupName()))
|
||||
.setCreateTime(assignee -> DateUtils.formatDateTime(assignee.getCreateTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,8 +213,8 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
}
|
||||
}
|
||||
return this.getUsersByTypes(typeIdMap).stream()
|
||||
.distinct()
|
||||
.toList();
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,10 +225,10 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
*/
|
||||
private List<UserDTO> getUsersByTypes(Map<TaskAssigneeEnum, List<String>> typeIdMap) {
|
||||
return typeIdMap.entrySet().stream()
|
||||
.map(entry -> this.getUsersByType(entry.getKey(), entry.getValue()))
|
||||
.filter(CollUtil::isNotEmpty)
|
||||
.flatMap(Collection::stream)
|
||||
.toList();
|
||||
.map(entry -> this.getUsersByType(entry.getKey(), entry.getValue()))
|
||||
.filter(CollUtil::isNotEmpty)
|
||||
.flatMap(Collection::stream)
|
||||
.toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -291,11 +291,11 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
return rawMap.entrySet()
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
e -> Convert.toStr(e.getKey()),
|
||||
Map.Entry::getValue
|
||||
));
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
e -> Convert.toStr(e.getKey()),
|
||||
Map.Entry::getValue
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+79
-79
@@ -121,8 +121,8 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
|
||||
// 获取已有流程实例
|
||||
FlowInstance flowInstance = flowInstanceMapper.selectOne(QueryBuilder.lambda(FlowInstance.class)
|
||||
.eq(FlowInstance::getBusinessId, businessId)
|
||||
.build());
|
||||
.eq(FlowInstance::getBusinessId, businessId)
|
||||
.build());
|
||||
|
||||
if (ObjectUtil.isNotNull(flowInstance)) {
|
||||
// 已存在流程
|
||||
@@ -149,10 +149,10 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
variables.put(AUTO_PASS, autoPass);
|
||||
variables.put(BUSINESS_CODE, this.generateBusinessCode(bizExt));
|
||||
FlowParams flowParams = FlowParams.build()
|
||||
.handler(startProcessBo.getHandler())
|
||||
.flowCode(startProcessBo.getFlowCode())
|
||||
.variable(startProcessBo.getVariables())
|
||||
.flowStatus(BusinessStatusEnum.DRAFT.getStatus());
|
||||
.handler(startProcessBo.getHandler())
|
||||
.flowCode(startProcessBo.getFlowCode())
|
||||
.variable(startProcessBo.getVariables())
|
||||
.flowStatus(BusinessStatusEnum.DRAFT.getStatus());
|
||||
Instance instance = insService.start(businessId, flowParams);
|
||||
// 保存流程实例业务信息
|
||||
this.buildFlowInstanceBizExt(instance, bizExt);
|
||||
@@ -240,16 +240,16 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
}
|
||||
// 构建流程参数,包括变量、跳转类型、消息、处理人、权限等信息
|
||||
FlowParams flowParams = FlowParams.build()
|
||||
.handler(completeTaskBo.getHandler())
|
||||
.variable(variables)
|
||||
.ignore(Convert.toBool(variables.getOrDefault(VAR_IGNORE, false)))
|
||||
.ignoreDepute(Convert.toBool(variables.getOrDefault(VAR_IGNORE_DEPUTE, false)))
|
||||
.ignoreCooperate(Convert.toBool(variables.getOrDefault(VAR_IGNORE_COOPERATE, false)))
|
||||
.skipType(SkipType.PASS.getKey())
|
||||
.message(completeTaskBo.getMessage())
|
||||
.flowStatus(BusinessStatusEnum.WAITING.getStatus())
|
||||
.hisStatus(TaskStatusEnum.PASS.getStatus())
|
||||
.hisTaskExt(completeTaskBo.getFileId());
|
||||
.handler(completeTaskBo.getHandler())
|
||||
.variable(variables)
|
||||
.ignore(Convert.toBool(variables.getOrDefault(VAR_IGNORE, false)))
|
||||
.ignoreDepute(Convert.toBool(variables.getOrDefault(VAR_IGNORE_DEPUTE, false)))
|
||||
.ignoreCooperate(Convert.toBool(variables.getOrDefault(VAR_IGNORE_COOPERATE, false)))
|
||||
.skipType(SkipType.PASS.getKey())
|
||||
.message(completeTaskBo.getMessage())
|
||||
.flowStatus(BusinessStatusEnum.WAITING.getStatus())
|
||||
.hisStatus(TaskStatusEnum.PASS.getStatus())
|
||||
.hisTaskExt(completeTaskBo.getFileId());
|
||||
Boolean autoPass = Convert.toBool(insVariableMap.getOrDefault(AUTO_PASS, false));
|
||||
skipTask(taskId, flowParams, flowTask.getInstanceId(), autoPass);
|
||||
return true;
|
||||
@@ -271,7 +271,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
return;
|
||||
}
|
||||
List<User> userList = FlowEngine.userService()
|
||||
.getByAssociateds(StreamUtils.toList(flowTaskList, FlowTask::getId));
|
||||
.getByAssociateds(StreamUtils.toList(flowTaskList, FlowTask::getId));
|
||||
if (CollUtil.isEmpty(userList)) {
|
||||
return;
|
||||
}
|
||||
@@ -282,11 +282,11 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
continue;
|
||||
}
|
||||
flowParams.
|
||||
message("流程引擎自动审批!").
|
||||
variable(Map.of(
|
||||
SUBMIT, false,
|
||||
FLOW_COPY_LIST, Collections.emptyList(),
|
||||
MESSAGE_NOTICE, StringUtils.EMPTY));
|
||||
message("流程引擎自动审批!").
|
||||
variable(Map.of(
|
||||
SUBMIT, false,
|
||||
FLOW_COPY_LIST, Collections.emptyList(),
|
||||
MESSAGE_NOTICE, StringUtils.EMPTY));
|
||||
skipTask(task.getId(), flowParams, instanceId, true);
|
||||
}
|
||||
}
|
||||
@@ -339,9 +339,9 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
}
|
||||
// 添加抄送人记录
|
||||
FlowHisTask flowHisTask = flowHisTaskMapper.selectList(
|
||||
QueryBuilder.lambda(FlowHisTask.class)
|
||||
.eq(FlowHisTask::getTaskId, task.getId())
|
||||
.build()).get(0);
|
||||
QueryBuilder.lambda(FlowHisTask.class)
|
||||
.eq(FlowHisTask::getTaskId, task.getId())
|
||||
.build()).get(0);
|
||||
FlowNode flowNode = new FlowNode();
|
||||
flowNode.setNodeCode(flowHisTask.getTargetNodeCode());
|
||||
flowNode.setNodeName(flowHisTask.getTargetNodeName());
|
||||
@@ -351,27 +351,27 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
task.setNodeName("【抄送】" + task.getNodeName());
|
||||
Date updateTime = new Date(flowHisTask.getUpdateTime().getTime() - 1000);
|
||||
FlowParams flowParams = FlowParams.build()
|
||||
.skipType(SkipType.NONE.getKey())
|
||||
.hisStatus(TaskStatusEnum.COPY.getStatus())
|
||||
.message("【抄送给】" + StreamUtils.join(flowCopyList, FlowCopyBo::getNickName));
|
||||
.skipType(SkipType.NONE.getKey())
|
||||
.hisStatus(TaskStatusEnum.COPY.getStatus())
|
||||
.message("【抄送给】" + StreamUtils.join(flowCopyList, FlowCopyBo::getNickName));
|
||||
HisTask hisTask = hisTaskService.setSkipHisTask(task, flowNode, flowParams);
|
||||
hisTask.setCreateTime(updateTime);
|
||||
hisTask.setUpdateTime(updateTime);
|
||||
hisTaskService.save(hisTask);
|
||||
List<User> userList = StreamUtils.toList(flowCopyList, x ->
|
||||
new FlowUser()
|
||||
.setType(TaskAssigneeType.COPY.getCode())
|
||||
.setProcessedBy(Convert.toStr(x.getUserId()))
|
||||
.setAssociated(taskId));
|
||||
new FlowUser()
|
||||
.setType(TaskAssigneeType.COPY.getCode())
|
||||
.setProcessedBy(Convert.toStr(x.getUserId()))
|
||||
.setAssociated(taskId));
|
||||
// 批量保存抄送人员
|
||||
FlowEngine.userService().saveBatch(userList);
|
||||
// 抄送消息进入“我的抄送”,不和待办列表混用。
|
||||
flwCommonService.sendMessage(
|
||||
List.of(org.dromara.workflow.common.enums.MessageTypeEnum.SYSTEM_MESSAGE.getCode()),
|
||||
"您收到一条新的流程抄送,请及时查看。",
|
||||
"单据抄送提醒",
|
||||
userService.selectListByIds(StreamUtils.toList(flowCopyList, FlowCopyBo::getUserId)),
|
||||
PATH_TASK_COPY
|
||||
List.of(org.dromara.workflow.common.enums.MessageTypeEnum.SYSTEM_MESSAGE.getCode()),
|
||||
"您收到一条新的流程抄送,请及时查看。",
|
||||
"单据抄送提醒",
|
||||
userService.selectListByIds(StreamUtils.toList(flowCopyList, FlowCopyBo::getUserId)),
|
||||
PATH_TASK_COPY
|
||||
);
|
||||
}
|
||||
|
||||
@@ -506,13 +506,13 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
variable.put(MESSAGE_NOTICE, notice);
|
||||
|
||||
FlowParams flowParams = FlowParams.build()
|
||||
.nodeCode(bo.getNodeCode())
|
||||
.variable(variable)
|
||||
.message(message)
|
||||
.skipType(SkipType.REJECT.getKey())
|
||||
.flowStatus(applyNodeCode.equals(bo.getNodeCode()) ? TaskStatusEnum.BACK.getStatus() : TaskStatusEnum.WAITING.getStatus())
|
||||
.hisStatus(TaskStatusEnum.BACK.getStatus())
|
||||
.hisTaskExt(bo.getFileId());
|
||||
.nodeCode(bo.getNodeCode())
|
||||
.variable(variable)
|
||||
.message(message)
|
||||
.skipType(SkipType.REJECT.getKey())
|
||||
.flowStatus(applyNodeCode.equals(bo.getNodeCode()) ? TaskStatusEnum.BACK.getStatus() : TaskStatusEnum.WAITING.getStatus())
|
||||
.hisStatus(TaskStatusEnum.BACK.getStatus())
|
||||
.hisTaskExt(bo.getFileId());
|
||||
taskService.skip(task.getId(), flowParams);
|
||||
return true;
|
||||
}
|
||||
@@ -535,7 +535,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
return nodeCodes;
|
||||
}
|
||||
List<User> userList = FlowEngine.userService()
|
||||
.getByAssociateds(Collections.singletonList(task.getId()), UserType.DEPUTE.getKey());
|
||||
.getByAssociateds(Collections.singletonList(task.getId()), UserType.DEPUTE.getKey());
|
||||
if (CollUtil.isNotEmpty(userList)) {
|
||||
return nodeCodes;
|
||||
}
|
||||
@@ -554,8 +554,8 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
for (HisTask hisTask : hisTaskList) {
|
||||
Node nodeValue = nodeMap.get(hisTask.getNodeCode());
|
||||
if (nodeValue != null
|
||||
&& NodeType.BETWEEN.getKey().equals(nodeValue.getNodeType())
|
||||
&& added.add(nodeValue.getNodeCode())) {
|
||||
&& NodeType.BETWEEN.getKey().equals(nodeValue.getNodeType())
|
||||
&& added.add(nodeValue.getNodeCode())) {
|
||||
backNodeList.add(nodeValue);
|
||||
}
|
||||
}
|
||||
@@ -585,9 +585,9 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
BusinessStatusEnum.checkInvalidStatus(instance.getFlowStatus());
|
||||
}
|
||||
FlowParams flowParams = FlowParams.build()
|
||||
.message(bo.comment())
|
||||
.flowStatus(BusinessStatusEnum.TERMINATION.getStatus())
|
||||
.hisStatus(TaskStatusEnum.TERMINATION.getStatus());
|
||||
.message(bo.comment())
|
||||
.flowStatus(BusinessStatusEnum.TERMINATION.getStatus())
|
||||
.hisStatus(TaskStatusEnum.TERMINATION.getStatus());
|
||||
taskService.termination(taskId, flowParams);
|
||||
return true;
|
||||
}
|
||||
@@ -601,8 +601,8 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
@Override
|
||||
public List<FlowTask> selectByIdList(Collection<Long> taskIdList) {
|
||||
return flowTaskMapper.selectList(QueryBuilder.lambda(FlowTask.class)
|
||||
.in(FlowTask::getId, taskIdList)
|
||||
.build());
|
||||
.in(FlowTask::getId, taskIdList)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -696,13 +696,13 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
ExpressionUtil.evalVariable(buildNextTaskList, FlowParams.build().variable(mergeVariable));
|
||||
for (FlowNode flowNode : nextFlowNodes) {
|
||||
StreamUtils.findFirst(buildNextTaskList, t -> t.getNodeCode().equals(flowNode.getNodeCode()))
|
||||
.ifPresent(first -> {
|
||||
List<UserDTO> users;
|
||||
if (CollUtil.isNotEmpty(first.getPermissionList())
|
||||
&& CollUtil.isNotEmpty(users = flwTaskAssigneeService.fetchUsersByStorageIds(StringUtils.joinComma(first.getPermissionList())))) {
|
||||
flowNode.setPermissionFlag(StreamUtils.join(users, e -> Convert.toStr(e.getUserId())));
|
||||
}
|
||||
});
|
||||
.ifPresent(first -> {
|
||||
List<UserDTO> users;
|
||||
if (CollUtil.isNotEmpty(first.getPermissionList())
|
||||
&& CollUtil.isNotEmpty(users = flwTaskAssigneeService.fetchUsersByStorageIds(StringUtils.joinComma(first.getPermissionList())))) {
|
||||
flowNode.setPermissionFlag(StreamUtils.join(users, e -> Convert.toStr(e.getUserId())));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return nextFlowNodes;
|
||||
@@ -717,8 +717,8 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
@Override
|
||||
public FlowHisTask selectHisTaskById(Long taskId) {
|
||||
return flowHisTaskMapper.selectOne(QueryBuilder.lambda(FlowHisTask.class)
|
||||
.eq(FlowHisTask::getId, taskId)
|
||||
.build());
|
||||
.eq(FlowHisTask::getId, taskId)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -730,8 +730,8 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
@Override
|
||||
public List<FlowTask> selectByInstId(Long instanceId) {
|
||||
return flowTaskMapper.selectList(QueryBuilder.lambda(FlowTask.class)
|
||||
.eq(FlowTask::getInstanceId, instanceId)
|
||||
.build());
|
||||
.eq(FlowTask::getInstanceId, instanceId)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -743,8 +743,8 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
@Override
|
||||
public List<FlowTask> selectByInstIds(Collection<Long> instanceIds) {
|
||||
return flowTaskMapper.selectList(QueryBuilder.lambda(FlowTask.class)
|
||||
.in(FlowTask::getInstanceId, instanceIds)
|
||||
.build());
|
||||
.in(FlowTask::getInstanceId, instanceIds)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -756,8 +756,8 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
@Override
|
||||
public boolean isTaskEnd(Long instanceId) {
|
||||
boolean exists = flowTaskMapper.exists(QueryBuilder.lambda(FlowTask.class)
|
||||
.eq(FlowTask::getInstanceId, instanceId)
|
||||
.build());
|
||||
.eq(FlowTask::getInstanceId, instanceId)
|
||||
.build());
|
||||
return !exists;
|
||||
}
|
||||
|
||||
@@ -846,11 +846,11 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
if (CollUtil.isNotEmpty(userIdList)) {
|
||||
// 转办、委托、加减签等运行时操作,消息接收人统一从“我的待办”进入处理。
|
||||
flwCommonService.sendMessage(
|
||||
bo.getMessageType(),
|
||||
StringUtils.isNotBlank(bo.getMessage()) ? bo.getMessage() : "单据「" + op.getDesc() + "」通知",
|
||||
"单据「" + op.getDesc() + "」提醒",
|
||||
userService.selectListByIds(userIdList),
|
||||
PATH_TASK_WAITING
|
||||
bo.getMessageType(),
|
||||
StringUtils.isNotBlank(bo.getMessage()) ? bo.getMessage() : "单据「" + op.getDesc() + "」通知",
|
||||
"单据「" + op.getDesc() + "」提醒",
|
||||
userService.selectListByIds(userIdList),
|
||||
PATH_TASK_WAITING
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -874,10 +874,10 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
if (CollUtil.isNotEmpty(flowTasks)) {
|
||||
FlowEngine.userService().deleteByTaskIds(StreamUtils.toList(flowTasks, FlowTask::getId));
|
||||
List<User> userList = StreamUtils.toList(flowTasks, flowTask ->
|
||||
new FlowUser()
|
||||
.setType(TaskAssigneeType.APPROVER.getCode())
|
||||
.setProcessedBy(userId)
|
||||
.setAssociated(flowTask.getId()));
|
||||
new FlowUser()
|
||||
.setType(TaskAssigneeType.APPROVER.getCode())
|
||||
.setProcessedBy(userId)
|
||||
.setAssociated(flowTask.getId()));
|
||||
if (CollUtil.isNotEmpty(userList)) {
|
||||
FlowEngine.userService().saveBatch(userList);
|
||||
}
|
||||
@@ -909,9 +909,9 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
@Override
|
||||
public FlowNode getByNodeCode(String nodeCode, Long definitionId) {
|
||||
return flowNodeMapper.selectOne(QueryBuilder.lambda(FlowNode.class)
|
||||
.eq(FlowNode::getNodeCode, nodeCode)
|
||||
.eq(FlowNode::getDefinitionId, definitionId)
|
||||
.build());
|
||||
.eq(FlowNode::getNodeCode, nodeCode)
|
||||
.eq(FlowNode::getDefinitionId, definitionId)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-4
@@ -60,10 +60,7 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean eval(Integer leaveDays) {
|
||||
if (leaveDays <= 2) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return leaveDays <= 2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user