REQ-2324: 添加一些方法
This commit is contained in:
parent
fdeae8937b
commit
fcb613d65a
5
changelog/REQ-2324.md
Normal file
5
changelog/REQ-2324.md
Normal file
@ -0,0 +1,5 @@
|
||||
# DDL
|
||||
```mysql
|
||||
ALTER TABLE todo
|
||||
ADD support_batch_process VARCHAR(10) DEFAULT 'NO' NOT NULL COMMENT '是否支持批量处理. YES: 支持, NO: 不支持';
|
||||
```
|
||||
@ -4,6 +4,7 @@ import cn.axzo.core.utils.converter.BeanConverter;
|
||||
import cn.axzo.msg.center.api.request.v3.PendingSendInfo;
|
||||
import cn.axzo.msg.center.service.dto.PersonDTO;
|
||||
import cn.axzo.msg.center.service.enums.OrganizationTypeEnum;
|
||||
import cn.axzo.msg.center.service.enums.YesOrNo;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessagePushRequest;
|
||||
import cn.axzo.msg.center.service.util.JSONUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@ -78,6 +79,11 @@ public class PendingMessagePushParam extends PendingSendInfo implements Serializ
|
||||
*/
|
||||
private String routerParams;
|
||||
|
||||
/**
|
||||
* 是否支持批量处理
|
||||
*/
|
||||
private YesOrNo supportBatchProcess;
|
||||
|
||||
public static PendingMessagePushParam from(PendingMessagePushRequest request) {
|
||||
return BeanConverter.convert(request, PendingMessagePushParam.class);
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp
|
||||
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@ -41,6 +43,24 @@ class StateAdvanceBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
StateAdvanceBuilder in(SFunction<Todo, ?> column, Object... values) {
|
||||
query.in(column, values);
|
||||
update.in(column, values);
|
||||
boolean statePresent = Stream.of(values).anyMatch(v -> v instanceof PendingMessageStateEnum);
|
||||
if (!statePresent)
|
||||
noStateQuery.in(column, values);
|
||||
return this;
|
||||
}
|
||||
|
||||
StateAdvanceBuilder in(boolean condition, SFunction<Todo, ?> column, Object... values) {
|
||||
query.in(condition, column, values);
|
||||
update.in(condition, column, values);
|
||||
boolean statePresent = Stream.of(values).anyMatch(v -> v instanceof PendingMessageStateEnum);
|
||||
if (!statePresent)
|
||||
noStateQuery.in(condition, column, values);
|
||||
return this;
|
||||
}
|
||||
|
||||
StateAdvanceBuilder set(SFunction<Todo, ?> column, Object val) {
|
||||
update.set(column, val);
|
||||
return this;
|
||||
|
||||
@ -531,7 +531,9 @@ public class TodoManager {
|
||||
return new StateAdvanceBuilder(todoDao)
|
||||
.set(Todo::getHideUntil, null)
|
||||
.eq(Todo::getType, TodoType.EXECUTABLE)
|
||||
.eq(Todo::getState, PendingMessageStateEnum.HAS_BEEN_SENT)
|
||||
.in(Todo::getState,
|
||||
PendingMessageStateEnum.HAS_BEEN_SENT,
|
||||
PendingMessageStateEnum.PROCESSING)
|
||||
.eq(Todo::getIsDelete, TableIsDeleteEnum.NORMAL.value);
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@ public enum PendingMessageStateEnum {
|
||||
RETRACT(6, "已撤回"),
|
||||
DELETED(7, "已删除"),
|
||||
READ(8, "已读"),
|
||||
PROCESSING(9, "处理中")
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user