清理 bpm 用不到的实体、与 convert 方法

This commit is contained in:
YunaiV 2023-07-26 20:53:10 +08:00
parent a0417f182e
commit 461c789492
3 changed files with 3 additions and 139 deletions

View File

@ -17,12 +17,9 @@ import org.flowable.task.api.Task;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;
import org.springframework.beans.BeanUtils;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Bpm 任务 Convert
@ -34,37 +31,9 @@ public interface BpmTaskConvert {
BpmTaskConvert INSTANCE = Mappers.getMapper(BpmTaskConvert.class);
/**
* 复制对象
*
* @param source 要复制的对象
* @param target 目标 复制到此对象
* @param <T>
*
* @return
*/
public static <T> T copy(Object source, Class<T> target) {
if (source == null || target == null) {
return null;
}
try {
T newInstance = target.getDeclaredConstructor().newInstance();
BeanUtils.copyProperties(source, newInstance);
return newInstance;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
default <T, K> List<K> copyList(List<T> source, Class<K> target) {
if (null == source || source.isEmpty()) {
return Collections.emptyList();
}
return source.stream().map(e -> copy(e, target)).collect(Collectors.toList());
}
default List<BpmTaskTodoPageItemRespVO> convertList1(List<Task> tasks,
Map<String, ProcessInstance> processInstanceMap, Map<Long, AdminUserRespDTO> userMap) {
Map<String, ProcessInstance> processInstanceMap,
Map<Long, AdminUserRespDTO> userMap) {
return CollectionUtils.convertList(tasks, task -> {
BpmTaskTodoPageItemRespVO respVO = convert1(task);
ProcessInstance processInstance = processInstanceMap.get(task.getProcessInstanceId());

View File

@ -1,105 +0,0 @@
package cn.iocoder.yudao.module.bpm.dal.dataobject.task;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
/**
* 任务流程关联表
*
* @author kemengkai
* @create 2022-05-09 10:33
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BpmActivityDO {
/**
* 任务流程关联id
*/
private String id;
/**
* 审批结果
*/
private Integer rev;
/**
* 任务流程部署id
*/
private String procDefId;
/**
* 任务流程id
*/
private String processInstanceId;
/**
* 任务执行id
*/
private String executionId;
/**
* 任务key
*/
private String activityId;
/**
* 任务id
*/
private String taskId;
/**
* 调用流程id
*/
private String callProcInstId;
/**
* 任务名称
*/
private String activityName;
/**
* 任务类型
*/
private String activityType;
/**
* 任务审批人id
*/
private String assignee;
/**
* 任务开始时间
*/
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private LocalDateTime startTime;
/**
* 任务结束时间
*/
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private LocalDateTime endTime;
private Integer transactionOrder;
private LocalDateTime duration;
/**
* 删除结果
*/
private String deleteReason;
/**
* 租户id
*/
private String tenantId;
}

View File

@ -29,8 +29,8 @@ public class ApiAccessLogPageReqVO extends PageParam {
@Schema(description = "请求地址,模糊匹配", example = "/xxx/yyy")
private String requestUrl;
@Schema(description = "开始时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@Schema(description = "开始请求时间")
private LocalDateTime[] beginTime;
@Schema(description = "执行时长,大于等于,单位:毫秒", example = "100")