重新发起和取消流程接口优化
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.njcn.supervision.utils;
|
||||
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
|
||||
/**
|
||||
* 处理流程实例的工具类
|
||||
*/
|
||||
public class InstanceUtil {
|
||||
|
||||
/**
|
||||
* 处理历史流程实例的id
|
||||
*
|
||||
* @param lastId 最近一次流程实例id
|
||||
* @param historyIds 之前历史id列表
|
||||
* @return 最新的历史id列表
|
||||
*/
|
||||
public static String dealHistoryId(String lastId, String historyIds) {
|
||||
if (StrUtil.isBlank(historyIds)) {
|
||||
return lastId;
|
||||
}
|
||||
return historyIds.concat(StrPool.COMMA).concat(lastId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断用户是否有权限操作
|
||||
* @param userId 当前用户id
|
||||
* @param createBy 数据创建用户id
|
||||
*/
|
||||
public static void judgeUserPower(String userId,String createBy){
|
||||
if(!userId.equalsIgnoreCase(createBy)){
|
||||
throw new BusinessException(SupervisionResponseEnum.NO_POWER);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user