我的代办加上 申请时的表单信息

This commit is contained in:
wangliwen 2022-04-22 17:29:25 +08:00
parent d7735a4fdf
commit 5f2317e6fa
1 changed files with 77 additions and 56 deletions

View File

@ -8,9 +8,14 @@ import io.renren.common.page.PageData;
import io.renren.common.service.impl.BaseServiceImpl;
import io.renren.common.utils.MessageUtils;
import io.renren.modules.activiti.dto.TaskDTO;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.sys.service.SysRoleUserService;
import org.activiti.engine.*;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
@ -30,6 +35,7 @@ import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskInfo;
import org.activiti.engine.task.TaskQuery;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -54,6 +60,9 @@ public class ActTaskService extends BaseServiceImpl {
@Autowired
private SysRoleUserService sysRoleUserService;
@Autowired
private TAbilityApplicationService tAbilityApplicationService;
/**
* 根据参数获取当前运行的任务信息
*
@ -96,6 +105,13 @@ public class ActTaskService extends BaseServiceImpl {
for (Task task : list) {
TaskDTO dto = new TaskDTO();
this.convertTaskInfo(task, dto);
TAbilityApplicationDTO abilityApplicationDTO =
tAbilityApplicationService.get(Long.valueOf(dto.getBusinessKey()));
if (abilityApplicationDTO != null) {
ObjectMapper oMapper = new ObjectMapper();
Map<String, Object> variables = oMapper.convertValue(abilityApplicationDTO, Map.class);
dto.setParams(variables);
}
listDto.add(dto);
}
return new PageData<>(listDto, (int) taskQuery.count());
@ -211,6 +227,7 @@ public class ActTaskService extends BaseServiceImpl {
/**
* 更新任务变量
*
* @param taskDTO
*/
public void updateTaskVariable(TaskDTO taskDTO) {
@ -220,6 +237,7 @@ public class ActTaskService extends BaseServiceImpl {
/**
* 根据任务ID判断是否为多实例任务
*
* @param taskId
* @return
*/
@ -269,6 +287,7 @@ public class ActTaskService extends BaseServiceImpl {
/**
* 任务回退至上一用户任务节点
*
* @param taskId
* @return
*/
@ -458,6 +477,7 @@ public class ActTaskService extends BaseServiceImpl {
/**
* 转换Task对象
*
* @param task
* @param dto
*/
@ -481,6 +501,7 @@ public class ActTaskService extends BaseServiceImpl {
/**
* 驳回至第一个用户任务
*
* @param taskId
*/
@Transactional(rollbackFor = Exception.class)