管理系统-工作台-部门待办列表查询及部门已办列表查询新增申请用户所在部门及申请内容字段

This commit is contained in:
dinggang 2022-08-08 15:36:33 +08:00
parent 1e8c970c39
commit a94fce5066
7 changed files with 53 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import io.renren.modules.resource.dto.ResourceDTO;
import io.renren.modules.resource.service.ResourceService; 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.dto.SysUserDTO; import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.service.SysUserService; import io.renren.modules.sys.service.SysUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -79,6 +80,9 @@ public class HistoryController {
@Autowired @Autowired
protected RuntimeService runtimeService; protected RuntimeService runtimeService;
@Autowired
private SysUserDao sysUserDao;
@GetMapping("getInstImage") @GetMapping("getInstImage")
@ApiOperation(value = "获取流程活动图", produces = "application/octet-stream") @ApiOperation(value = "获取流程活动图", produces = "application/octet-stream")
@LogOperation("获取流程活动图") @LogOperation("获取流程活动图")
@ -195,6 +199,7 @@ public class HistoryController {
if (StringUtils.isNotEmpty(activityDTO.getStartUserId())) { if (StringUtils.isNotEmpty(activityDTO.getStartUserId())) {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getStartUserId())); SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getStartUserId()));
activityDTO.setStartUserName(userDTO != null ? userDTO.getRealName() : ""); activityDTO.setStartUserName(userDTO != null ? userDTO.getRealName() : "");
activityDTO.setStartUserDeptName(sysUserDao.getDeptNameByUserId(userDTO.getId().toString()));
} }
if (StringUtils.isNotEmpty(activityDTO.getAssignee())) { if (StringUtils.isNotEmpty(activityDTO.getAssignee())) {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getAssignee())); SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getAssignee()));
@ -212,7 +217,7 @@ public class HistoryController {
} }
if (abilityApplicationDTOS != null && !abilityApplicationDTOS.isEmpty()) { if (abilityApplicationDTOS != null && !abilityApplicationDTOS.isEmpty()) {
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
abilityApplicationDTOS.stream().map(TAbilityApplicationDTO::getSystem).filter(index -> StringUtils.isNotEmpty(index)).forEach(index -> { abilityApplicationDTOS.stream().map(TAbilityApplicationDTO::getSystem).filter(StringUtils::isNotEmpty).forEach(index -> {
stringBuffer.append(index); stringBuffer.append(index);
stringBuffer.append(","); stringBuffer.append(",");
}); });

View File

@ -41,6 +41,9 @@ public class ProcessActivityDTO {
@ApiModelProperty(value = "发起人姓名") @ApiModelProperty(value = "发起人姓名")
private String startUserName; private String startUserName;
@ApiModelProperty(value = "发起人部门名称")
private String startUserDeptName;
@ApiModelProperty(value = "受理人") @ApiModelProperty(value = "受理人")
private String assignee; private String assignee;

View File

@ -29,6 +29,12 @@ public class TaskDTO {
@ApiModelProperty(value = "用户名称") @ApiModelProperty(value = "用户名称")
private String userName; private String userName;
@ApiModelProperty(value = "用户部门名称")
private String userDeptName;
@ApiModelProperty(value = "申请内容")
private String applyTitle;
@ApiModelProperty(value = "任务参数") @ApiModelProperty(value = "任务参数")
private Map<String, Object> params; private Map<String, Object> params;

View File

@ -17,12 +17,17 @@ import io.renren.modules.demandComment.dto.TDemandCommentDTO;
import io.renren.modules.demandComment.service.TDemandCommentService; import io.renren.modules.demandComment.service.TDemandCommentService;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.resource.dao.ResourceDao;
import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.dto.ResourceDTO;
import io.renren.modules.resource.entity.ResourceEntity;
import io.renren.modules.resource.service.ResourceService; 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.security.user.SecurityUser; import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.sys.dao.SysDeptDao;
import io.renren.modules.sys.dao.SysUserDao;
import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.entity.SysDeptEntity;
import io.renren.modules.sys.entity.SysUserEntity; import io.renren.modules.sys.entity.SysUserEntity;
import io.renren.modules.sys.service.SysRoleUserService; import io.renren.modules.sys.service.SysRoleUserService;
import io.renren.modules.sys.service.SysUserService; import io.renren.modules.sys.service.SysUserService;
@ -108,6 +113,12 @@ public class ActTaskService extends BaseServiceImpl {
private ResourceService resourceService; private ResourceService resourceService;
@Autowired @Autowired
private SysUserService sysUserService; private SysUserService sysUserService;
@Autowired
private SysUserDao sysUserDao;
@Autowired
private SysDeptDao sysDeptDao;
@Autowired
private ResourceDao resourceDao;
/** /**
* 根据参数获取当前运行的任务信息 * 根据参数获取当前运行的任务信息
@ -210,13 +221,18 @@ public class ActTaskService extends BaseServiceImpl {
TaskDTO dto = new TaskDTO(); TaskDTO dto = new TaskDTO();
this.convertTaskInfo(task, dto); this.convertTaskInfo(task, dto);
Map<String, Object> processVariable = new LinkedHashMap<>(); Map<String, Object> processVariable = new LinkedHashMap<>();
if (task.getProcessVariables().containsKey("tAbilityApplicationDTOList")) { if (task.getProcessVariables().containsKey("tAbilityApplicationDTOList")) {
processVariable.putAll(task.getProcessVariables()); processVariable.putAll(task.getProcessVariables());
dto.setParams(processVariable); dto.setParams(processVariable);
List<TAbilityApplicationDTO> dtoList = (List<TAbilityApplicationDTO>) task.getProcessVariables().get("tAbilityApplicationDTOList"); List<TAbilityApplicationDTO> dtoList = (List<TAbilityApplicationDTO>) task.getProcessVariables().get("tAbilityApplicationDTOList");
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(dtoList.get(0))); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(dtoList.get(0)));
if (jsonObject != null) { if (jsonObject != null) {
dto.setUserName(jsonObject.containsKey("user") ? jsonObject.getString("user") : ""); dto.setUserName(jsonObject.containsKey("user") ? jsonObject.getString("user") : "");
dto.setUserDeptName(sysUserDao.getDeptNameByUserId(jsonObject.containsKey("userId") ? jsonObject.getString("userId") : null));
dto.setApplyTitle(jsonObject.containsKey("title") ? jsonObject.getString("title") : "");
} }
listDto.add(dto); listDto.add(dto);
continue; continue;
@ -227,6 +243,8 @@ public class ActTaskService extends BaseServiceImpl {
dto.setParams(processVariable); dto.setParams(processVariable);
Optional<SysUserEntity> creator = Optional.ofNullable(sysUserService.selectById(Long.parseLong(processVariable.get("creator").toString()))); Optional<SysUserEntity> creator = Optional.ofNullable(sysUserService.selectById(Long.parseLong(processVariable.get("creator").toString())));
dto.setUserName(creator.get().getRealName()); dto.setUserName(creator.get().getRealName());
dto.setApplyTitle("");
dto.setUserDeptName(creator.get().getDeptName());
listDto.add(dto); listDto.add(dto);
continue; continue;
} }
@ -239,6 +257,9 @@ public class ActTaskService extends BaseServiceImpl {
processVariable.putAll(task.getProcessVariables()); processVariable.putAll(task.getProcessVariables());
dto.setParams(processVariable); dto.setParams(processVariable);
dto.setUserName(abilityApplicationDTO.getUser()); dto.setUserName(abilityApplicationDTO.getUser());
ResourceEntity resourceEntity = resourceDao.selectById(abilityApplicationDTO.getResourceId());
dto.setApplyTitle(resourceEntity == null ? "" : resourceEntity.getName());
dto.setUserDeptName(abilityApplicationDTO.getUnit());
listDto.add(dto); listDto.add(dto);
continue; continue;
} }
@ -249,6 +270,9 @@ public class ActTaskService extends BaseServiceImpl {
processVariable.putAll(task.getProcessVariables()); processVariable.putAll(task.getProcessVariables());
dto.setParams(processVariable); dto.setParams(processVariable);
dto.setUserName(resourceMountApplyDTO.getUserName()); dto.setUserName(resourceMountApplyDTO.getUserName());
SysDeptEntity dept = sysDeptDao.getById(Long.parseLong(resourceMountApplyDTO.getDeptId()));
dto.setUserDeptName(dept == null ? "" : dept.getName());
dto.setApplyTitle(resourceMountApplyDTO.getResourceDTO().getName());
listDto.add(dto); listDto.add(dto);
continue; continue;
} }
@ -259,6 +283,8 @@ public class ActTaskService extends BaseServiceImpl {
processVariable.putAll(task.getProcessVariables()); processVariable.putAll(task.getProcessVariables());
dto.setParams(processVariable); dto.setParams(processVariable);
dto.setUserName(tDemandDataDTO.getApplyUserName()); dto.setUserName(tDemandDataDTO.getApplyUserName());
dto.setUserDeptName(tDemandDataDTO.getApplyUserDeptName());
dto.setApplyTitle(tDemandDataDTO.getDemandSubject());
listDto.add(dto); listDto.add(dto);
continue; continue;
} }
@ -269,6 +295,9 @@ public class ActTaskService extends BaseServiceImpl {
processVariable.putAll(task.getProcessVariables()); processVariable.putAll(task.getProcessVariables());
dto.setParams(processVariable); dto.setParams(processVariable);
dto.setUserName(resourceDTO.getUndercarriageUserName()); dto.setUserName(resourceDTO.getUndercarriageUserName());
dto.setApplyTitle(resourceDTO.getName());
SysDeptEntity dept = sysDeptDao.getById(resourceDTO.getUpdater());
dto.setUserDeptName(dept == null ? "" : dept.getName());
listDto.add(dto); listDto.add(dto);
continue; continue;
} }
@ -280,6 +309,8 @@ public class ActTaskService extends BaseServiceImpl {
processVariable.putAll(task.getProcessVariables()); processVariable.putAll(task.getProcessVariables());
dto.setParams(processVariable); dto.setParams(processVariable);
dto.setUserName(tDemandCommentDTO.getName()); dto.setUserName(tDemandCommentDTO.getName());
dto.setApplyTitle(tDemandCommentDTO.getComment());
dto.setUserDeptName(tDemandCommentDTO.getCreateDeptName());
listDto.add(dto); listDto.add(dto);
continue; continue;
} }

View File

@ -45,4 +45,6 @@ public interface SysUserDao extends BaseDao<SysUserEntity> {
void batchSaveUser(@Param("list")List<Map> list); void batchSaveUser(@Param("list")List<Map> list);
SysUserEntity getUserByName(@Param("username") String username); SysUserEntity getUserByName(@Param("username") String username);
String getDeptNameByUserId(@Param("id") String id);
} }

View File

@ -5,6 +5,7 @@ import io.renren.common.service.BaseService;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.entity.SysUserEntity; import io.renren.modules.sys.entity.SysUserEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;

View File

@ -96,4 +96,8 @@
SELECT id,username FROM sys_user WHERE username = #{username} limit 1 SELECT id,username FROM sys_user WHERE username = #{username} limit 1
</select> </select>
<select id="getDeptNameByUserId" resultType="java.lang.String">
SELECT name FROM sys_dept LEFT JOIN sys_user ON sys_user.dept_id = sys_dept.id WHERE sys_user.id = #{id}
</select>
</mapper> </mapper>