|
@@ -14,6 +14,7 @@ import com.fjhx.flow.enums.NodeTypeEnum;
|
|
|
import com.fjhx.flow.mapper.flow.FlowExampleMapper;
|
|
|
import com.fjhx.flow.service.flow.*;
|
|
|
import com.ruoyi.common.constant.StatusConstant;
|
|
|
+import com.ruoyi.common.core.domain.BaseIdPo;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.core.text.Convert;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
@@ -28,6 +29,7 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.function.BiConsumer;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -208,6 +210,27 @@ public class FlowExampleServiceImpl extends ServiceImpl<FlowExampleMapper, FlowE
|
|
|
updateById(flowExample);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public <T extends BaseIdPo> void setFlowId(List<T> list, BiConsumer<T, Long> fun) {
|
|
|
+
|
|
|
+ if (list.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Long> idList = list.stream().map(BaseIdPo::getId).distinct().collect(Collectors.toList());
|
|
|
+ List<FlowExample> flowExampleList = list(q -> q.in(FlowExample::getBusinessId, idList));
|
|
|
+
|
|
|
+ if (flowExampleList.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<Long, Long> map = flowExampleList.stream().collect(
|
|
|
+ Collectors.toMap(FlowExample::getBusinessId, BaseIdPo::getId));
|
|
|
+
|
|
|
+ list.forEach(item -> fun.accept(item, map.get(item.getId())));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private List<ApprovalRecordVo.ButtonInfo> getButtonInfoList(FlowExample flowExample,
|
|
|
List<FlowDefinitionNode> flowDefinitionNodeList) {
|
|
|
|