|
@@ -21,9 +21,12 @@ import com.jeeplus.flowable.vo.ProcessStatus;
|
|
|
import com.jeeplus.flowable.vo.ProcessVo;
|
|
import com.jeeplus.flowable.vo.ProcessVo;
|
|
|
import com.jeeplus.flowable.vo.TaskVo;
|
|
import com.jeeplus.flowable.vo.TaskVo;
|
|
|
import com.jeeplus.sys.feign.IOfficeApi;
|
|
import com.jeeplus.sys.feign.IOfficeApi;
|
|
|
|
|
+import com.jeeplus.sys.feign.IRoleApi;
|
|
|
import com.jeeplus.sys.feign.ITenantApi;
|
|
import com.jeeplus.sys.feign.ITenantApi;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.service.dto.OfficeDTO;
|
|
import com.jeeplus.sys.service.dto.OfficeDTO;
|
|
|
|
|
+import com.jeeplus.sys.service.dto.RoleDTO;
|
|
|
|
|
+import com.jeeplus.sys.service.dto.TenantDTO;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
@@ -148,8 +151,31 @@ public class FlowProcessService {
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(type)) {
|
|
if (StringUtils.isNotBlank(type)) {
|
|
|
if (type.equals("ydd")) {
|
|
if (type.equals("ydd")) {
|
|
|
|
|
+ IUserApi userApi = SpringUtil.getBean(IUserApi.class);
|
|
|
|
|
+ UserDTO currentUser = userApi.getByToken(TokenProvider.getCurrentToken());
|
|
|
|
|
+ List<String> requiredNames;
|
|
|
|
|
+ if(currentUser != null){
|
|
|
|
|
+ TenantDTO tenantDTO = currentUser.getTenantDTO();
|
|
|
|
|
+ if(tenantDTO != null && tenantDTO.getId().equals("10009")){
|
|
|
|
|
+ IRoleApi roleApi = SpringUtil.getBean(IRoleApi.class);
|
|
|
|
|
+ // 只要有一个角色是“老板”,就返回true
|
|
|
|
|
+ boolean isBoss = currentUser.getRoleDTOList().stream()
|
|
|
|
|
+ .map(RoleDTO::getId)
|
|
|
|
|
+ .map(roleApi::getRoleDTOByIdForApp)
|
|
|
|
|
+ .filter(Objects::nonNull) // 过滤查询失败的null角色
|
|
|
|
|
+ .anyMatch(role -> "老板".equals(role.getName())); // 防空指针
|
|
|
|
|
+ if (isBoss) {
|
|
|
|
|
+ requiredNames = Arrays.asList("进销存-领用申请");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ requiredNames = Arrays.asList("");
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ requiredNames = Arrays.asList("物资管理-领用申请", "物资管理-采购申请", "日常办公-请假申请", "离职申请", "离职交接申请", "会计-报销审批", "会计-报销审批-电子发票", "会计-发票申请", "报销申请", "发票申请","会议室预约");
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ requiredNames = Arrays.asList("物资管理-领用申请", "物资管理-采购申请", "日常办公-请假申请", "离职申请", "离职交接申请", "会计-报销审批", "会计-报销审批-电子发票", "会计-发票申请", "报销申请", "发票申请","会议室预约");
|
|
|
|
|
+ }
|
|
|
// 创建一个包含需要保留的流程定义名称的集合
|
|
// 创建一个包含需要保留的流程定义名称的集合
|
|
|
- List<String> requiredNames = Arrays.asList("物资管理-领用申请", "物资管理-采购申请", "日常办公-请假申请", "离职申请", "离职交接申请", "会计-报销审批", "会计-报销审批-电子发票", "会计-发票申请", "报销申请", "发票申请","会议室预约");
|
|
|
|
|
/**
|
|
/**
|
|
|
* 移动端工作台数据处理
|
|
* 移动端工作台数据处理
|
|
|
*/
|
|
*/
|