审批详情返回分配人的所属部门

This commit is contained in:
wangliwen 2022-10-11 19:36:06 +08:00
parent 50fed6862d
commit 2c40cace07
3 changed files with 31 additions and 1 deletions

View File

@ -19,7 +19,9 @@ import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO; import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO;
import io.renren.modules.resourceMountApply.service.TResourceMountApplyService; import io.renren.modules.resourceMountApply.service.TResourceMountApplyService;
import io.renren.modules.sys.dao.SysUserDao; import io.renren.modules.sys.dao.SysUserDao;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysUserService; import io.renren.modules.sys.service.SysUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@ -45,6 +47,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors;
/** /**
* 流程的历史信息 * 流程的历史信息
@ -80,6 +83,8 @@ public class HistoryController {
protected RepositoryService repositoryService; protected RepositoryService repositoryService;
@Autowired @Autowired
protected RuntimeService runtimeService; protected RuntimeService runtimeService;
@Autowired
private SysDeptService sysDeptService;
@Autowired @Autowired
private SysUserDao sysUserDao; private SysUserDao sysUserDao;
@ -213,6 +218,16 @@ public class HistoryController {
list = taskHandleDetailInfo_; list = taskHandleDetailInfo_;
} }
} }
list = list.stream().map(index_ -> { // 补充审核人部门名称
if (StringUtils.isNumeric(index_.getAssignee())) {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(index_.getAssignee()));
Optional<SysDeptDTO> sysDeptDTOOptional = Optional.ofNullable(sysDeptService.get(userDTO.getDeptId()));
if (sysDeptDTOOptional.isPresent()) {
index_.setAssigneeDeptName(sysDeptDTOOptional.get().getName());
}
}
return index_;
}).collect(Collectors.toList());
return new Result().ok(list); return new Result().ok(list);
} }

View File

@ -53,4 +53,7 @@ public class HistoryDetailDTO {
@ApiModelProperty(value = "受理人姓名") @ApiModelProperty(value = "受理人姓名")
private String assigneeName; private String assigneeName;
@ApiModelProperty(value = "受理人部门名称")
private String assigneeDeptName;
} }

View File

@ -27,6 +27,7 @@ import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail; import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.enums.SuperAdminEnum;
import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysUserService; import io.renren.modules.sys.service.SysUserService;
@ -213,7 +214,7 @@ public class TAbilityApplicationController {
} }
}; };
// 非超级管理员只出本人 // 非超级管理员只出本人
if(user.getSuperAdmin() == SuperAdminEnum.NO.value()){ if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) {
params.put("user_id", user == null ? null : user.getId()); params.put("user_id", user == null ? null : user.getId());
} }
List<TAbilityApplicationDTO> applicationDTOS = tAbilityApplicationService.list(params); List<TAbilityApplicationDTO> applicationDTOS = tAbilityApplicationService.list(params);
@ -247,6 +248,17 @@ public class TAbilityApplicationController {
.map(tAbilityApplicationDTO -> resourceService.get(Long.valueOf(tAbilityApplicationDTO.getResourceId()))).collect(Collectors.toList()); .map(tAbilityApplicationDTO -> resourceService.get(Long.valueOf(tAbilityApplicationDTO.getResourceId()))).collect(Collectors.toList());
List<HistoryDetailDTO> taskHandleDetailInfo = activitiService.getTaskHandleDetailInfo(tAbilityApplicationDTOList.get(0).getInstanceId()); List<HistoryDetailDTO> taskHandleDetailInfo = activitiService.getTaskHandleDetailInfo(tAbilityApplicationDTOList.get(0).getInstanceId());
taskHandleDetailInfo = taskHandleDetailInfo.stream().map(index_ -> { // 补充审核人部门名称
if (StringUtils.isNumeric(index_.getAssignee())) {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(index_.getAssignee()));
Optional<SysDeptDTO> sysDeptDTOOptional = Optional.ofNullable(sysDeptService.get(userDTO.getDeptId()));
if (sysDeptDTOOptional.isPresent()) {
index_.setAssigneeDeptName(sysDeptDTOOptional.get().getName());
}
}
return index_;
}).collect(Collectors.toList());
List<Object> camera; List<Object> camera;
ArrayList cameraList = new ArrayList(); ArrayList cameraList = new ArrayList();
QueryWrapper<TAbilityApplicationEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<TAbilityApplicationEntity> queryWrapper = new QueryWrapper<>();