update - 调整获取分类名称的逻辑

This commit is contained in:
wangli 2023-11-30 10:37:29 +08:00
parent d97a33d97c
commit 125bfdb19c
3 changed files with 8 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import java.util.Optional;
public interface CategoryService {
Optional<CategoryItemVO> getById(Long id);
/**
* 获取指定分类
*

View File

@ -38,6 +38,12 @@ public class CategoryServiceImpl extends ServiceImpl<ExtAxDictMapper, ExtAxDict>
private final CategoryConverter categoryConverter;
@Override
public Optional<CategoryItemVO> getById(Long id) {
ExtAxDict extAxDict = dictMapper.selectById(id);
return Optional.ofNullable(categoryConverter.toVo(extAxDict));
}
@Override
public Optional<CategoryItemVO> get(String type, String value) {
List<ExtAxDict> list = this.lambdaQuery().eq(ExtAxDict::getType, type)

View File

@ -31,7 +31,6 @@ import java.util.Map;
import java.util.Objects;
import static cn.axzo.workflow.common.constant.BpmnConstants.BIZ_ORG_RELATION;
import static cn.axzo.workflow.common.constant.BpmnConstants.BPM_MODEL_CATEGORY;
import static cn.axzo.workflow.common.constant.BpmnConstants.COUNTERSIGN_ORIGIN_ASSIGNER;
import static cn.axzo.workflow.common.constant.BpmnConstants.COUNTERSIGN_REMAIN_ASSIGNER_LIST;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG;
@ -177,7 +176,7 @@ public class RocketMqMessagePushEventListener implements BpmnMessagePushEventLis
variables.put(VAR_TASK_START_TIME, sdf.format(tasks.get(0).getCreateTime()));
// TODO 操作类型 同意驳回加签评论转交等
variables.put(VAR_OPERATOR_TYPE, "");
categoryService.get(BPM_MODEL_CATEGORY, processInstance.getCategory()).ifPresent(category -> {
categoryService.getById(Long.valueOf(processInstance.getCategory())).ifPresent(category -> {
variables.put(VAR_BUSINESS_NAME, category.getLabel());
});