update - REQ-2324-调整设置待办为执行中代码,设置成功记录日志表

This commit is contained in:
yangqicheng 2024-05-13 11:48:28 +08:00
parent 58bbaab61e
commit 4e30d009f8
2 changed files with 22 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import cn.axzo.msg.center.service.util.JSONUtils;
import cn.axzo.msg.center.utils.DateFormatUtil;
import cn.axzo.msg.center.utils.QueryFormatter;
import cn.axzo.msg.center.utils.UUIDUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.google.common.base.Supplier;
@ -137,6 +138,8 @@ public class TodoManager {
if (CollectionUtils.isNotEmpty(routeButtons)) {
supportBatchProcess = YesOrNo.YES;
}
} else if (template.getMsgCategory().equals(MessageCategoryEnum.APPROVAL_PENDING_MESSAGE)) {
//todo 审批代办判断是否存在"同意""驳回"按钮才支持批量审批需要合并2393代码根据按钮进行判断
}
request.setSupportBatchProcess(supportBatchProcess);
List<Todo> todos = todoRecordBuilder.buildTodos(
@ -390,8 +393,18 @@ public class TodoManager {
*/
@Transactional(rollbackFor = Exception.class)
public Boolean batchSetProcessing(List<String> identityCodes) {
log.info("batch set processing...,request:{}", JSONUtil.toJsonStr(identityCodes));
if (CollectionUtils.isEmpty(identityCodes)) {
return false;
}
BizAssertions.assertTrue(CollectionUtils.isNotEmpty(identityCodes), "identityCodes列表不能为空");
return todoDao.setExecutableProcessing(identityCodes);
Boolean updated = todoDao.batchSetExecutableProcessing(identityCodes);
if (updated) {
List<Todo> updatedTodos = todoDao.getByIdentityCodes(identityCodes);
TodoRequestContext ctx = TodoRequestContext.create("batchSetProcessing", identityCodes);
todoLogger.logTodosUpdated(ctx, updatedTodos);
}
return updated;
}
/**

View File

@ -49,6 +49,13 @@ public class TodoDao extends ServiceImpl<TodoMapper, Todo> {
.list();
}
public List<Todo> getByIdentityCodes(List<String> identityCodes) {
return lambdaQuery()
.eq(Todo::getIdentityCode, identityCodes)
.eq(Todo::getIsDelete, TableIsDeleteEnum.NORMAL.value)
.list();
}
public Optional<Todo> getLatestByBiz(
@Nullable String templateCode, String bizCode, String subBizCode, TodoType todoType) {
if (StringUtils.isBlank(bizCode) && StringUtils.isBlank(subBizCode))
@ -98,7 +105,7 @@ public class TodoDao extends ServiceImpl<TodoMapper, Todo> {
return new SampleTodos(todos);
}
public Boolean setExecutableProcessing(List<String> identityCodes) {
public Boolean batchSetExecutableProcessing(List<String> identityCodes) {
return lambdaUpdate()
.eq(Todo::getType, TodoType.EXECUTABLE)
.in(Todo::getIdentityCode, identityCodes)