Commit 511b48b7 by 赵剑炜

解决评论乱码问题

parent 2199d824
......@@ -79,6 +79,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
......@@ -765,6 +766,8 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
}
else if("userTask".equals(historicActivityInstance.getActivityType())){
List<Comment> comments = commentsMap.get(historicActivityInstance.getTaskId());
if(CollUtil.isNotEmpty(comments)){
for (Comment comment : comments) {
if("opinion".equals(comment.getType())){
......@@ -801,6 +804,8 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
taskDetailVO.setSignImage(comment1.getFullMessage());
}
}
Object a= comments.get(0).getFullMessage().getBytes(StandardCharsets.UTF_8);
// Object comMsg= taskService.getProcessInstanceComments(processInstanceId);
taskDetailVO.setComment(comments.get(0).getFullMessage());
taskDetailVO.setAttachmentVOList(attachmentVOList);
taskDetailVOS.add(taskDetailVO);
......
......@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.junmp.junmpProcess.common.utils.HttpStatus;
import com.junmp.junmpProcess.common.utils.ResponseResult;
......@@ -51,6 +52,7 @@ import org.flowable.engine.TaskService;
import org.flowable.engine.history.HistoricActivityInstance;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.history.HistoricProcessInstanceQuery;
import org.flowable.engine.impl.persistence.entity.CommentEntity;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.runtime.ActivityInstance;
import org.flowable.engine.runtime.ProcessInstance;
......@@ -68,6 +70,9 @@ import springfox.documentation.spring.web.json.Json;
import javax.annotation.Resource;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.function.Function;
......@@ -718,7 +723,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
else if("userTask".equals(historicActivityInstance.getActivityType())){
List<Comment> comments = commentsMap.get(historicActivityInstance.getTaskId());
if(CollUtil.isNotEmpty(comments)){
for (Comment comment : comments) {
if("opinion".equals(comment.getType())){
......@@ -759,9 +763,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskDetailVO.setSignImage(comment1.getFullMessage());
}
}
String s = new String(comments.get(0).getFullMessage().getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8);
System.out.println("s = " + s);
taskDetailVO.setComment(new String(comments.get(0).getFullMessage().getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8));
CommentEntity commentTransfer = (CommentEntity) comment;
taskDetailVO.setComment(commentTransfer.getMessage());
taskDetailVO.setAttachmentVOList(attachmentVOList);
taskDetailVOS.add(taskDetailVO);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论