fix: 82013 企标更改流程--流程阻塞
This commit is contained in:
@@ -11,6 +11,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.crypto.asymmetric.KeyType;
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
import cn.hutool.crypto.asymmetric.RSA;
|
import cn.hutool.crypto.asymmetric.RSA;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
@@ -68,10 +69,14 @@ public class CommonUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断文件名是否带盘符,重新处理
|
* 判断文件名是否带盘符,重新处理
|
||||||
|
*
|
||||||
* @param fileName
|
* @param fileName
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getFileName(String fileName) {
|
public static String getFileName(String fileName) {
|
||||||
|
if (StrUtil.isBlank(fileName)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
//判断是否带有盘符信息
|
//判断是否带有盘符信息
|
||||||
// Check for Unix-style path
|
// Check for Unix-style path
|
||||||
int unixSep = fileName.lastIndexOf('/');
|
int unixSep = fileName.lastIndexOf('/');
|
||||||
@@ -103,6 +108,7 @@ public class CommonUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一全局上传
|
* 统一全局上传
|
||||||
|
*
|
||||||
* @Return: java.lang.String
|
* @Return: java.lang.String
|
||||||
*/
|
*/
|
||||||
public static String upload(MultipartFile file, String bizPath, String uploadType) {
|
public static String upload(MultipartFile file, String bizPath, String uploadType) {
|
||||||
@@ -117,6 +123,7 @@ public class CommonUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一全局上传 带桶
|
* 统一全局上传 带桶
|
||||||
|
*
|
||||||
* @Return: java.lang.String
|
* @Return: java.lang.String
|
||||||
*/
|
*/
|
||||||
public static String upload(MultipartFile file, String bizPath, String uploadType, String customBucket) {
|
public static String upload(MultipartFile file, String bizPath, String uploadType, String customBucket) {
|
||||||
@@ -128,8 +135,10 @@ public class CommonUtils {
|
|||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本地文件上传
|
* 本地文件上传
|
||||||
|
*
|
||||||
* @param mf 文件
|
* @param mf 文件
|
||||||
* @param bizPath 自定义路径
|
* @param bizPath 自定义路径
|
||||||
* @return
|
* @return
|
||||||
@@ -172,14 +181,18 @@ public class CommonUtils {
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
/** 当前系统数据库类型 */
|
|
||||||
|
/**
|
||||||
|
* 当前系统数据库类型
|
||||||
|
*/
|
||||||
private static String DB_TYPE = "";
|
private static String DB_TYPE = "";
|
||||||
private static DbType dbTypeEnum = null;
|
private static DbType dbTypeEnum = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局获取平台数据库类型(作废了)
|
* 全局获取平台数据库类型(作废了)
|
||||||
* @deprecated 不推荐
|
*
|
||||||
* @return
|
* @return
|
||||||
|
* @deprecated 不推荐
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static String getDatabaseType() {
|
public static String getDatabaseType() {
|
||||||
@@ -197,6 +210,7 @@ public class CommonUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局获取平台数据库类型(对应mybaisPlus枚举)
|
* 全局获取平台数据库类型(对应mybaisPlus枚举)
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static DbType getDatabaseTypeEnum() {
|
public static DbType getDatabaseTypeEnum() {
|
||||||
@@ -215,6 +229,7 @@ public class CommonUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取数据库类型
|
* 获取数据库类型
|
||||||
|
*
|
||||||
* @param dataSource
|
* @param dataSource
|
||||||
* @return
|
* @return
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
@@ -245,23 +260,27 @@ public class CommonUtils {
|
|||||||
return DB_TYPE;
|
return DB_TYPE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 黑名单限制文件
|
* 黑名单限制文件
|
||||||
* @date 2021/4/14 6:18
|
*
|
||||||
* @param fileName 文件名
|
* @param fileName 文件名
|
||||||
* @return boolean true:处于黑名单 false:不处于黑名单
|
* @return boolean true:处于黑名单 false:不处于黑名单
|
||||||
|
* @date 2021/4/14 6:18
|
||||||
*/
|
*/
|
||||||
public static boolean limitFileSuffix(String fileName, String[] fileSuffixLimits) {
|
public static boolean limitFileSuffix(String fileName, String[] fileSuffixLimits) {
|
||||||
final List<String> fileNameList = Arrays.asList(fileSuffixLimits);
|
final List<String> fileNameList = Arrays.asList(fileSuffixLimits);
|
||||||
boolean isExists = fileNameList.stream().anyMatch(name -> fileName.substring(0, fileName.lastIndexOf('.')).contains(name) || fileName.substring(fileName.lastIndexOf('.')).contains(name));
|
boolean isExists = fileNameList.stream().anyMatch(name -> fileName.substring(0, fileName.lastIndexOf('.')).contains(name) || fileName.substring(fileName.lastIndexOf('.')).contains(name));
|
||||||
return isExists;
|
return isExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RSA 使用私钥解密
|
* RSA 使用私钥解密
|
||||||
* @date 2021/4/15 16:11
|
*
|
||||||
* @param str 待解密的字符串
|
* @param str 待解密的字符串
|
||||||
* @param RSAPrivateKey 私钥
|
* @param RSAPrivateKey 私钥
|
||||||
* @return String 解密后的字符串
|
* @return String 解密后的字符串
|
||||||
|
* @date 2021/4/15 16:11
|
||||||
*/
|
*/
|
||||||
public static String decryptBtRsaPriKey(String str, String RSAPrivateKey) {
|
public static String decryptBtRsaPriKey(String str, String RSAPrivateKey) {
|
||||||
RSA rsa = new RSA(RSAPrivateKey, null);
|
RSA rsa = new RSA(RSAPrivateKey, null);
|
||||||
|
|||||||
+12
@@ -31,6 +31,8 @@ import com.jero.modules.activiti.service.ProcessAllService;
|
|||||||
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
||||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||||
|
import com.jero.modules.onlyoffice.service.IBusProcessModelHisService;
|
||||||
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
import com.jero.modules.sys.utils.UserUtils;
|
import com.jero.modules.sys.utils.UserUtils;
|
||||||
import com.jero.modules.system.service.ISysUserDepartService;
|
import com.jero.modules.system.service.ISysUserDepartService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -83,6 +85,9 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
|
|||||||
@Resource
|
@Resource
|
||||||
private ProcessAllService processAllService;
|
private ProcessAllService processAllService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProcessModelHisService busProcessModelHisService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startProcess(ESChangeDataVO changeData) {
|
public void startProcess(ESChangeDataVO changeData) {
|
||||||
// 执行流程发起前的操作
|
// 执行流程发起前的操作
|
||||||
@@ -111,6 +116,13 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
|
|||||||
actFlowCommonService.setProcessVariables(processInstanceId, actVariables);
|
actFlowCommonService.setProcessVariables(processInstanceId, actVariables);
|
||||||
// 设置流程实例Id
|
// 设置流程实例Id
|
||||||
esChange.setProcessInstanceId(processInstanceId);
|
esChange.setProcessInstanceId(processInstanceId);
|
||||||
|
// 设置替换文件id
|
||||||
|
OSSFile lastDocFileByStandardNo = busProcessModelHisService.findLastDocFileByStandardNo(esChange.getStandardNumber());
|
||||||
|
if (lastDocFileByStandardNo != null) {
|
||||||
|
esChange.setReplaceFileId(lastDocFileByStandardNo.getId());
|
||||||
|
} else {
|
||||||
|
esChange.setReplaceFileId(null);
|
||||||
|
}
|
||||||
// 保存到业务流程表
|
// 保存到业务流程表
|
||||||
saveOrUpdate(esChange);
|
saveOrUpdate(esChange);
|
||||||
if (opinionList != null && !opinionList.isEmpty()) {
|
if (opinionList != null && !opinionList.isEmpty()) {
|
||||||
|
|||||||
+3
@@ -3,6 +3,7 @@ package com.jero.modules.onlyoffice.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.modules.onlyoffice.entity.BusProcessModelHis;
|
import com.jero.modules.onlyoffice.entity.BusProcessModelHis;
|
||||||
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
||||||
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -42,4 +43,6 @@ public interface IBusProcessModelHisService extends IService<BusProcessModelHis>
|
|||||||
String saveProcessFileToOss(String hisId);
|
String saveProcessFileToOss(String hisId);
|
||||||
|
|
||||||
BusProcessModelHis findEditFileByStandardNo(String standardNo);
|
BusProcessModelHis findEditFileByStandardNo(String standardNo);
|
||||||
|
|
||||||
|
OSSFile findLastDocFileByStandardNo(String standardNo);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -387,7 +387,7 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
|||||||
MultipartFile multipartFile = BusProcessModelHisServiceImpl.convert(file);
|
MultipartFile multipartFile = BusProcessModelHisServiceImpl.convert(file);
|
||||||
String savePath = CommonUtils.upload(multipartFile, "", uploadType);
|
String savePath = CommonUtils.upload(multipartFile, "", uploadType);
|
||||||
OSSFile replaceFile = ossFileService.getById(replaceId);
|
OSSFile replaceFile = ossFileService.getById(replaceId);
|
||||||
if (oConvertUtils.isNotEmpty(savePath)) {
|
if (oConvertUtils.isNotEmpty(savePath) && replaceFile != null) {
|
||||||
// 文件名
|
// 文件名
|
||||||
String fileName = his.getFileName();
|
String fileName = his.getFileName();
|
||||||
fileName = CommonUtils.getFileName(fileName);
|
fileName = CommonUtils.getFileName(fileName);
|
||||||
@@ -437,7 +437,8 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
|||||||
return this.saveEditFileWithOss(lastDocFileByStandardNo.getId());
|
return this.saveEditFileWithOss(lastDocFileByStandardNo.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
private OSSFile findLastDocFileByStandardNo(String standardNo) {
|
@Override
|
||||||
|
public OSSFile findLastDocFileByStandardNo(String standardNo) {
|
||||||
LambdaQueryWrapper<LawsEnterpriseStandard> esWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsEnterpriseStandard> esWrapper = new LambdaQueryWrapper<>();
|
||||||
esWrapper.eq(LawsEnterpriseStandard::getStandardNumber, standardNo);
|
esWrapper.eq(LawsEnterpriseStandard::getStandardNumber, standardNo);
|
||||||
LawsEnterpriseStandard es = eSService.getOne(esWrapper);
|
LawsEnterpriseStandard es = eSService.getOne(esWrapper);
|
||||||
|
|||||||
Reference in New Issue
Block a user