mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-11 05:19:00 +08:00
➖ 删除fastjson2依赖
This commit is contained in:
1 parent
b69285c55b
commit
68da521f53
15 files changed
+82
-69
No files matched your search
@@ -18,11 +18,6 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>2.0.28</version>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
|
||||
+13
-3
@@ -3,12 +3,14 @@ package com.pig4cloud.pigx.flow.engine.node;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.flow.task.api.feign.RemoteFlowTaskService;
|
||||
import com.pig4cloud.pigx.flow.task.constant.ProcessInstanceConstant;
|
||||
import com.pig4cloud.pigx.flow.task.dto.Node;
|
||||
import com.pig4cloud.pigx.flow.task.dto.NodeUser;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl;
|
||||
@@ -29,11 +31,14 @@ public class MultiInstanceHandler {
|
||||
|
||||
private final Map<String, AssignUserStrategy> assignUserStrategyMap;
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
/**
|
||||
* 解析执行人
|
||||
* @param execution 流程执行对象
|
||||
* @return 执行人集合
|
||||
*/
|
||||
@SneakyThrows
|
||||
public List<Long> resolveAssignee(DelegateExecution execution) {
|
||||
// 执行人集合
|
||||
List<Long> assignList = new ArrayList<>();
|
||||
@@ -47,7 +52,9 @@ public class MultiInstanceHandler {
|
||||
|
||||
// 发起人
|
||||
Object rootUserObj = execution.getVariable("root");
|
||||
NodeUser rootUser = JSON.parseArray(JSON.toJSONString(rootUserObj), NodeUser.class).get(0);
|
||||
String rootUserJson = objectMapper.writeValueAsString(rootUserObj);
|
||||
NodeUser rootUser = objectMapper.readValue(rootUserJson, new TypeReference<List<NodeUser>>() {
|
||||
}).get(0);
|
||||
|
||||
// 节点数据
|
||||
Node node = remoteFlowTaskService.queryNodeOriData(flowId, nodeId).getData();
|
||||
@@ -62,7 +69,10 @@ public class MultiInstanceHandler {
|
||||
// 默认值
|
||||
String format = StrUtil.format("{}_assignee_default_list", nodeId);
|
||||
Object variable = execution.getVariable(format);
|
||||
List<NodeUser> nodeUserDtos = JSON.parseArray(JSON.toJSONString(variable), NodeUser.class);
|
||||
String variableJson = objectMapper.writeValueAsString(variable);
|
||||
|
||||
List<NodeUser> nodeUserDtos = objectMapper.readValue(variableJson, new TypeReference<>() {
|
||||
});
|
||||
if (CollUtil.isNotEmpty(nodeUserDtos)) {
|
||||
List<Long> collect = nodeUserDtos.stream().map(NodeUser::getId).toList();
|
||||
assignList.addAll(collect);
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.delegate.JavaDelegate;
|
||||
import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -75,7 +75,7 @@ public class CopyServiceTask implements JavaDelegate {
|
||||
for (String userIds : userIdList) {
|
||||
// 发送抄送任务
|
||||
ProcessCopyDto processCopyDto = new ProcessCopyDto();
|
||||
processCopyDto.setNodeTime(new Date());
|
||||
processCopyDto.setNodeTime(LocalDateTime.now());
|
||||
processCopyDto.setStartUserId(rootUser.getId());
|
||||
processCopyDto.setFlowId(flowId);
|
||||
processCopyDto.setProcessInstanceId(execution.getProcessInstanceId());
|
||||
|
||||
+2
-4
@@ -1,9 +1,8 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ProcessCopyDto {
|
||||
@@ -11,8 +10,7 @@ public class ProcessCopyDto {
|
||||
/**
|
||||
* 当前节点时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date nodeTime;
|
||||
private LocalDateTime nodeTime;
|
||||
|
||||
/**
|
||||
* 发起人
|
||||
|
||||
+3
-2
@@ -1,13 +1,13 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 表单
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
public class FormItemVO {
|
||||
|
||||
private String id;
|
||||
@@ -29,6 +29,7 @@ public class FormItemVO {
|
||||
private Props props;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class Props {
|
||||
|
||||
private Object value;
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 表单远程的下拉选项
|
||||
*/
|
||||
@Data
|
||||
public class FormRemoteSelectOptionParamVo {
|
||||
|
||||
/**
|
||||
* 远程请求地址
|
||||
*/
|
||||
private String remoteUrl;
|
||||
|
||||
}
|
||||
@@ -78,11 +78,6 @@
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>2.0.28</version>
|
||||
</dependency>
|
||||
<!--选配: druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@ package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.vo.ProcessVO;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import com.pig4cloud.pigx.flow.task.vo.ProcessVO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
+9
-4
@@ -4,9 +4,9 @@ import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.TypeReference;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.constant.FormTypeEnum;
|
||||
import com.pig4cloud.pigx.flow.task.constant.ProcessInstanceConstant;
|
||||
@@ -19,6 +19,7 @@ import com.pig4cloud.pigx.flow.task.service.IProcessNodeDataService;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessService;
|
||||
import com.pig4cloud.pigx.flow.task.vo.FormItemVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -37,6 +38,8 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
public class ProcessCopyServiceImpl extends ServiceImpl<ProcessCopyMapper, ProcessCopy> implements IProcessCopyService {
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
private final IProcessService processService;
|
||||
|
||||
private final IProcessNodeDataService nodeDataService;
|
||||
@@ -46,6 +49,7 @@ public class ProcessCopyServiceImpl extends ServiceImpl<ProcessCopyMapper, Proce
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public R querySingleDetail(long id) {
|
||||
ProcessCopy processCopy = this.getById(id);
|
||||
@@ -56,7 +60,7 @@ public class ProcessCopyServiceImpl extends ServiceImpl<ProcessCopyMapper, Proce
|
||||
}
|
||||
String formData = processCopy.getFormData();
|
||||
|
||||
Map<String, Object> variableMap = JSON.parseObject(formData, new TypeReference<>() {
|
||||
Map<String, Object> variableMap = objectMapper.readValue(formData, new TypeReference<>() {
|
||||
});
|
||||
|
||||
String nodeId = processCopy.getNodeId();
|
||||
@@ -64,7 +68,8 @@ public class ProcessCopyServiceImpl extends ServiceImpl<ProcessCopyMapper, Proce
|
||||
Node node = nodeDataService.getNodeData(flowId, nodeId).getData();
|
||||
Map<String, String> formPerms = node.getFormPerms();
|
||||
|
||||
List<FormItemVO> jsonObjectList = JSON.parseArray(oaForms.getFormItems(), FormItemVO.class);
|
||||
List<FormItemVO> jsonObjectList = objectMapper.readValue(oaForms.getFormItems(), new TypeReference<>() {
|
||||
});
|
||||
for (FormItemVO formItemVO : jsonObjectList) {
|
||||
String fid = formItemVO.getId();
|
||||
String perm = formPerms.get(fid);
|
||||
|
||||
+18
-12
@@ -7,9 +7,9 @@ import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.TypeReference;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteUserService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
@@ -22,17 +22,15 @@ import com.pig4cloud.pigx.flow.task.constant.NodeUserTypeEnum;
|
||||
import com.pig4cloud.pigx.flow.task.constant.ProcessInstanceConstant;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessCopy;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessInstanceRecord;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeRecord;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeRecordAssignUser;
|
||||
import com.pig4cloud.pigx.flow.task.entity.*;
|
||||
import com.pig4cloud.pigx.flow.task.service.*;
|
||||
import com.pig4cloud.pigx.flow.task.utils.NodeFormatUtil;
|
||||
import com.pig4cloud.pigx.flow.task.vo.FormItemVO;
|
||||
import com.pig4cloud.pigx.flow.task.vo.NodeFormatParamVo;
|
||||
import com.pig4cloud.pigx.flow.task.vo.ProcessCopyVo;
|
||||
import com.pig4cloud.pigx.flow.task.vo.NodeVo;
|
||||
import com.pig4cloud.pigx.flow.task.vo.ProcessCopyVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -61,6 +59,8 @@ public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
|
||||
private final IProcessNodeRecordAssignUserService processNodeRecordAssignUserService;
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
/**
|
||||
* 启动流程
|
||||
* @param processInstanceParamDto
|
||||
@@ -304,6 +304,7 @@ public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
* @param nodeFormatParamVo
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public R formatStartNodeShow(NodeFormatParamVo nodeFormatParamVo) {
|
||||
String flowId = nodeFormatParamVo.getFlowId();
|
||||
@@ -334,7 +335,8 @@ public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
.one();
|
||||
|
||||
String data = processNodeRecordAssignUser.getData();
|
||||
Map<String, Object> variableMap = JSON.parseObject(data, new TypeReference<>() {
|
||||
|
||||
Map<String, Object> variableMap = objectMapper.readValue(data, new TypeReference<>() {
|
||||
});
|
||||
variableMap.putAll(paramMap);
|
||||
paramMap.putAll(variableMap);
|
||||
@@ -362,7 +364,8 @@ public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
|
||||
Process oaForms = processService.getByFlowId(flowId);
|
||||
String process = oaForms.getProcess();
|
||||
Node nodeDto = JSON.parseObject(process, Node.class);
|
||||
Node nodeDto = objectMapper.readValue(process, new TypeReference<>() {
|
||||
});
|
||||
|
||||
List<NodeVo> processNodeShowDtos = NodeFormatUtil.formatProcessNodeShow(nodeDto, completeNodeSet,
|
||||
new HashSet<>(), processInstanceId, paramMap);
|
||||
@@ -375,6 +378,7 @@ public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public R detail(String processInstanceId) {
|
||||
ProcessInstanceRecord processInstanceRecord = processInstanceRecordService.lambdaQuery()
|
||||
@@ -388,14 +392,16 @@ public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
|
||||
// 发起人变量数据
|
||||
String formData = processInstanceRecord.getFormData();
|
||||
Map<String, Object> variableMap = JSON.parseObject(formData, new TypeReference<>() {
|
||||
Map<String, Object> variableMap = objectMapper.readValue(formData, new TypeReference<>() {
|
||||
});
|
||||
// 发起人表单权限
|
||||
String process = oaForms.getProcess();
|
||||
Node nodeDto = JSON.parseObject(process, Node.class);
|
||||
|
||||
Node nodeDto = objectMapper.readValue(process, Node.class);
|
||||
Map<String, String> formPerms1 = nodeDto.getFormPerms();
|
||||
|
||||
List<FormItemVO> jsonObjectList = JSON.parseArray(oaForms.getFormItems(), FormItemVO.class);
|
||||
List<FormItemVO> jsonObjectList = objectMapper.readValue(oaForms.getFormItems(), new TypeReference<>() {
|
||||
});
|
||||
for (FormItemVO formItemVO : jsonObjectList) {
|
||||
String id = formItemVO.getId();
|
||||
String perm = formPerms1.get(id);
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.constant.NodeStatusEnum;
|
||||
@@ -52,7 +51,7 @@ public class ProcessNodeRecordServiceImpl extends ServiceImpl<ProcessNodeRecordM
|
||||
@Override
|
||||
public R complete(ProcessNodeRecordParamDto processNodeRecordParamDto) {
|
||||
|
||||
log.info("节点结束---{}", JSON.toJSONString(processNodeRecordParamDto));
|
||||
log.info("节点结束---{}", processNodeRecordParamDto);
|
||||
|
||||
// TODO 完成节点和完成任务要区分下
|
||||
this.lambdaUpdate()
|
||||
|
||||
+12
-5
@@ -7,8 +7,9 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import com.pig4cloud.pigx.common.sequence.sequence.Sequence;
|
||||
@@ -25,8 +26,8 @@ import com.pig4cloud.pigx.flow.task.service.IProcessStarterService;
|
||||
import com.pig4cloud.pigx.flow.task.utils.NodeUtil;
|
||||
import com.pig4cloud.pigx.flow.task.vo.FormItemVO;
|
||||
import com.pig4cloud.pigx.flow.task.vo.ProcessVO;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -51,6 +52,8 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
|
||||
private final Sequence flowSequence;
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
/**
|
||||
* 获取详细数据
|
||||
* @param flowId
|
||||
@@ -68,15 +71,19 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
* @param flowId 流程ID
|
||||
* @return 流程详情
|
||||
*/
|
||||
@SneakyThrows
|
||||
private ProcessVO getProcessVO(String flowId) {
|
||||
|
||||
Process oaForms = getByFlowId(flowId);
|
||||
String process = oaForms.getProcess();
|
||||
String formItems = oaForms.getFormItems();
|
||||
Node startNode = JSON.parseObject(process, Node.class);
|
||||
Node startNode = objectMapper.readValue(process, new TypeReference<>() {
|
||||
});
|
||||
|
||||
Map<String, String> formPerms = startNode.getFormPerms();
|
||||
List<FormItemVO> formItemVOList = JSON.parseArray(formItems, FormItemVO.class);
|
||||
|
||||
List<FormItemVO> formItemVOList = objectMapper.readValue(formItems, new TypeReference<>() {
|
||||
});
|
||||
for (FormItemVO formItemVO : formItemVOList) {
|
||||
String perm = MapUtil.getStr(formPerms, formItemVO.getId(), ProcessInstanceConstant.FormPermClass.EDIT);
|
||||
formItemVO.setPerm(perm);
|
||||
@@ -106,7 +113,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
}
|
||||
|
||||
}
|
||||
oaForms.setFormItems(JSON.toJSONString(formItemVOList));
|
||||
oaForms.setFormItems(objectMapper.writeValueAsString(formItemVOList));
|
||||
|
||||
List<String> selectUserNodeId = NodeUtil.selectUserNodeId(startNode);
|
||||
|
||||
|
||||
+7
-3
@@ -6,8 +6,8 @@ import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.TypeReference;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import com.pig4cloud.pigx.flow.task.api.feign.RemoteFlowEngineService;
|
||||
@@ -23,6 +23,7 @@ import com.pig4cloud.pigx.flow.task.entity.ProcessNodeRecordAssignUser;
|
||||
import com.pig4cloud.pigx.flow.task.service.*;
|
||||
import com.pig4cloud.pigx.flow.task.vo.FormItemVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -47,12 +48,15 @@ public class TaskServiceImpl implements ITaskService {
|
||||
|
||||
private final IProcessInstanceRecordService processInstanceRecordService;
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
/**
|
||||
* 查询任务
|
||||
* @param taskId
|
||||
* @param view
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public R queryTask(String taskId, boolean view) {
|
||||
|
||||
@@ -82,7 +86,7 @@ public class TaskServiceImpl implements ITaskService {
|
||||
if (processNodeRecordAssignUser != null) {
|
||||
String data = processNodeRecordAssignUser.getData();
|
||||
if (StrUtil.isNotBlank(data)) {
|
||||
Map<String, Object> collect = JSON.parseObject(data, new TypeReference<Map<String, Object>>() {
|
||||
Map<String, Object> collect = objectMapper.readValue(data, new TypeReference<>() {
|
||||
});
|
||||
paramMap.putAll(collect);
|
||||
|
||||
|
||||
+13
-4
@@ -4,7 +4,8 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteUserService;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
@@ -21,6 +22,7 @@ import com.pig4cloud.pigx.flow.task.service.IProcessNodeRecordAssignUserService;
|
||||
import com.pig4cloud.pigx.flow.task.service.IRemoteService;
|
||||
import com.pig4cloud.pigx.flow.task.vo.NodeVo;
|
||||
import com.pig4cloud.pigx.flow.task.vo.UserVo;
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -38,6 +40,7 @@ public class NodeFormatUtil {
|
||||
* @param processInstanceId
|
||||
* @param paramMap
|
||||
*/
|
||||
@SneakyThrows
|
||||
public static List<NodeVo> formatProcessNodeShow(Node node, Set<String> completeNodeSet,
|
||||
Set<String> continueNodeSet, String processInstanceId, Map<String, Object> paramMap) {
|
||||
List<NodeVo> list = new ArrayList<>();
|
||||
@@ -116,7 +119,11 @@ public class NodeFormatUtil {
|
||||
if (assignedType == ProcessInstanceConstant.AssignedTypeClass.SELF_SELECT) {
|
||||
// 发起人自选
|
||||
Object variable = paramMap.get(StrUtil.format("{}_assignee_select", node.getId()));
|
||||
List<NodeUser> nodeUserDtos = JSON.parseArray(JSON.toJSONString(variable), NodeUser.class);
|
||||
|
||||
ObjectMapper objectMapper = SpringUtil.getBean(ObjectMapper.class);
|
||||
List<NodeUser> nodeUserDtos = objectMapper.readValue(objectMapper.writeValueAsString(variable),
|
||||
new TypeReference<>() {
|
||||
});
|
||||
|
||||
List<Long> collect = nodeUserDtos.stream().map(w -> Long.valueOf(w.getId())).toList();
|
||||
for (Long aLong : collect) {
|
||||
@@ -141,9 +148,11 @@ public class NodeFormatUtil {
|
||||
|
||||
Object o = paramMap.get(formUser);
|
||||
if (o != null) {
|
||||
String jsonString = JSON.toJSONString(o);
|
||||
ObjectMapper objectMapper = SpringUtil.getBean(ObjectMapper.class);
|
||||
String jsonString = objectMapper.writeValueAsString(o);
|
||||
if (StrUtil.isNotBlank(jsonString)) {
|
||||
List<NodeUser> nodeUserDtoList = JSON.parseArray(jsonString, NodeUser.class);
|
||||
List<NodeUser> nodeUserDtoList = objectMapper.readValue(jsonString, new TypeReference<>() {
|
||||
});
|
||||
List<Long> userIdList = nodeUserDtoList.stream().map(NodeUser::getId).toList();
|
||||
for (Long aLong : userIdList) {
|
||||
userVoList.addAll(CollUtil.newArrayList(buildUser(aLong)));
|
||||
|
||||
Reference in new issue
Block a user