This commit is contained in:
18792927508
2024-03-06 17:05:22 +08:00
parent 80fd24e1c3
commit 2696ac1156
14 changed files with 867 additions and 54 deletions
@@ -1,10 +1,11 @@
package com.ruoyi.system.domain.entity.flow;
import javax.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.*;
@Getter
@Setter
@ToString
@@ -51,4 +52,9 @@ public class MsCaseFlow {
*/
@Column(name = "button_auth_flag")
private String buttonAuthFlag;
/**
* svg路径
*/
@Column(name = "file_name")
private String fileName;
}
@@ -5,7 +5,6 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import java.util.List;
@@ -57,6 +56,13 @@ public class MsCaseFlowVO {
* 按钮权限标识符
*/
private String buttonAuthFlag;
/**
* 角色名
*/
private String roleName;
/**
* svg图片路径
*/
private String fileName;
}
@@ -4,7 +4,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
@@ -14,12 +13,15 @@ import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
import com.ruoyi.system.mapper.flow.MsCaseFlowRoleRelatedMapper;
import com.ruoyi.system.util.NewStringUtil;
import com.ruoyi.system.util.TableDataUtil;
import org.bouncycastle.crypto.DataLengthException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
@@ -40,15 +42,12 @@ public class CaseFlowServiceImpl implements CaseFlowService {
*/
@Override
public Object queryCaseFlowInfo(MsCaseFlowSearchVO caseFlowSearchVO) {
//查询某个案件流程节点信息
if (caseFlowSearchVO.getId() != null) {
if (caseFlowSearchVO == null || caseFlowSearchVO.getPageNum() == null || caseFlowSearchVO.getPageSize() == null) {
//查询所有案件流程节点信息
return msCaseFlowMapper.selectAll();
} else if (caseFlowSearchVO.getId() != null) {
//查询某个案件流程节点信息
return msCaseFlowMapper.selectByPrimaryKey(caseFlowSearchVO.getId());
} else if (caseFlowSearchVO == null) {
//查询所有案件流程节点信息
return msCaseFlowMapper.selectAll();
} else if (caseFlowSearchVO.getPageNum() == null || caseFlowSearchVO.getPageSize() == null) {
//查询所有案件流程节点信息
return msCaseFlowMapper.selectAll();
} else {
//分页查询案件流程节点信息
Map<Integer, List<SysRole>> sysRoleMap = queryRoleByFlowId(null);
@@ -125,6 +124,27 @@ public class CaseFlowServiceImpl implements CaseFlowService {
return map;
}
/**
* 本地图片装64
* @param imgPath
* @return
* @throws Exception
*/
public static String convertToBase64( String imgPath) {
byte[] data = null;
// 读取图片字节数组
try {
imgPath=imgPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload/");
InputStream in = Files.newInputStream(Paths.get(imgPath));
data = new byte[in.available()];
in.read(data);
in.close();
} catch (IOException e) {
e.printStackTrace();
}
// 返回Base64编码过的字节数组字符串
return Base64.getEncoder().encodeToString(Objects.requireNonNull(data));
}
/**
* 新增或编辑案件流程节点信息
*
@@ -133,6 +153,7 @@ public class CaseFlowServiceImpl implements CaseFlowService {
*/
@Override
public Boolean saveCaseFlow(MsCaseFlowVO caseFlowVO) {
if (caseFlowVO.getId() != null) {
//更新案件流程信息
MsCaseFlow msCaseFlow = new MsCaseFlow();
@@ -228,6 +249,8 @@ public class CaseFlowServiceImpl implements CaseFlowService {
return false;
}
/**
* 排序案件流程节点
*