mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 10:13:28 +08:00
update list判空优化
This commit is contained in:
parent
c5441c0c46
commit
3b10fd59f6
@ -4,6 +4,7 @@ import cn.dev33.satoken.exception.NotLoginException;
|
|||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@ -352,7 +353,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
|||||||
rm.setMenuId(menuId);
|
rm.setMenuId(menuId);
|
||||||
list.add(rm);
|
list.add(rm);
|
||||||
}
|
}
|
||||||
if (list.size() > 0) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
rows = roleMenuMapper.insertBatch(list) ? list.size() : 0;
|
rows = roleMenuMapper.insertBatch(list) ? list.size() : 0;
|
||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
@ -373,7 +374,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
|||||||
rd.setDeptId(deptId);
|
rd.setDeptId(deptId);
|
||||||
list.add(rd);
|
list.add(rd);
|
||||||
}
|
}
|
||||||
if (list.size() > 0) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
rows = roleDeptMapper.insertBatch(list) ? list.size() : 0;
|
rows = roleDeptMapper.insertBatch(list) ? list.size() : 0;
|
||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
|
|||||||
@ -13,10 +13,12 @@
|
|||||||
|
|
||||||
package org.dromara.workflow.flowable;
|
package org.dromara.workflow.flowable;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import org.flowable.bpmn.model.Event;
|
import org.flowable.bpmn.model.Event;
|
||||||
import org.flowable.bpmn.model.Process;
|
import org.flowable.bpmn.model.Process;
|
||||||
import org.flowable.bpmn.model.*;
|
import org.flowable.bpmn.model.*;
|
||||||
import org.flowable.image.ProcessDiagramGenerator;
|
import org.flowable.image.ProcessDiagramGenerator;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
@ -69,9 +71,8 @@ public class CustomDefaultProcessDiagramGenerator implements ProcessDiagramGener
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<ExtensionElement> eventTypeElements = startEvent.getExtensionElements().get("eventType");
|
List<ExtensionElement> eventTypeElements = startEvent.getExtensionElements().get("eventType");
|
||||||
if (eventTypeElements != null && eventTypeElements.size() > 0) {
|
if (CollectionUtil.isNotEmpty(eventTypeElements)) {
|
||||||
processDiagramCanvas.drawEventRegistryStartEvent(graphicInfo, scaleFactor);
|
processDiagramCanvas.drawEventRegistryStartEvent(graphicInfo, scaleFactor);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
processDiagramCanvas.drawNoneStartEvent(graphicInfo);
|
processDiagramCanvas.drawNoneStartEvent(graphicInfo);
|
||||||
}
|
}
|
||||||
@ -350,7 +351,7 @@ public class CustomDefaultProcessDiagramGenerator implements ProcessDiagramGener
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
List<ExtensionElement> eventTypeElements = boundaryEvent.getExtensionElements().get("eventType");
|
List<ExtensionElement> eventTypeElements = boundaryEvent.getExtensionElements().get("eventType");
|
||||||
if (eventTypeElements != null && eventTypeElements.size() > 0) {
|
if (CollectionUtil.isNotEmpty(eventTypeElements)) {
|
||||||
processDiagramCanvas.drawCatchingEventRegistryEvent(flowNode.getName(), graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor);
|
processDiagramCanvas.drawCatchingEventRegistryEvent(flowNode.getName(), graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -634,7 +635,7 @@ public class CustomDefaultProcessDiagramGenerator implements ProcessDiagramGener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allGraphicInfos.size() > 0) {
|
if (CollectionUtil.isNotEmpty(allGraphicInfos)) {
|
||||||
|
|
||||||
boolean needsTranslationX = false;
|
boolean needsTranslationX = false;
|
||||||
boolean needsTranslationY = false;
|
boolean needsTranslationY = false;
|
||||||
@ -752,7 +753,7 @@ public class CustomDefaultProcessDiagramGenerator implements ProcessDiagramGener
|
|||||||
FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef);
|
FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef);
|
||||||
FlowElement targetElement = bpmnModel.getFlowElement(targetRef);
|
FlowElement targetElement = bpmnModel.getFlowElement(targetRef);
|
||||||
List<GraphicInfo> graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId());
|
List<GraphicInfo> graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId());
|
||||||
if (graphicInfoList != null && graphicInfoList.size() > 0) {
|
if (CollectionUtil.isNotEmpty(graphicInfoList)) {
|
||||||
graphicInfoList = connectionPerfectionizer(processDiagramCanvas, bpmnModel, sourceElement, targetElement, graphicInfoList);
|
graphicInfoList = connectionPerfectionizer(processDiagramCanvas, bpmnModel, sourceElement, targetElement, graphicInfoList);
|
||||||
int[] xPoints = new int[graphicInfoList.size()];
|
int[] xPoints = new int[graphicInfoList.size()];
|
||||||
int[] yPoints = new int[graphicInfoList.size()];
|
int[] yPoints = new int[graphicInfoList.size()];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user