diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java b/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java index 3df42e37..c889adf1 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java @@ -4,7 +4,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import javax.validation.constraints.NotBlank; import java.util.Date; import java.util.List; @@ -12,7 +11,7 @@ import java.util.List; * @author Jone */ @Data -@Api(tags="实例") +@Api(tags = "实例") public class ProcessInstanceDTO { private static final long serialVersionUID = 1L; @@ -63,7 +62,4 @@ public class ProcessInstanceDTO { private List currentTaskList; - - - } diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java index dafa65f3..c3d3aa2c 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java @@ -4,6 +4,8 @@ import io.renren.common.constant.Constant; import io.renren.common.page.PageData; import io.renren.modules.activiti.dto.ProcessInstanceDTO; 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.dto.SysUserDTO; import io.renren.modules.sys.service.SysUserService; @@ -66,6 +68,12 @@ public class ActHistoryService { @Autowired private SysUserService sysUserService; + @Autowired + private TAbilityApplicationService tAbilityApplicationService; + + @Autowired + private ProcessEngine processEngine_; + public void getProcessInstanceDiagram(String processInstanceId, HttpServletResponse response) throws Exception { if (StringUtils.isEmpty(processInstanceId)) { @@ -174,7 +182,6 @@ public class ActHistoryService { query.processDefinitionId((String) params.get("processDefinitionId")); } if (StringUtils.isNotEmpty((String) params.get("ended"))) { - logger.info("ended参数值为:" + (String) params.get("ended")); if ("true".equals((String) params.get("ended"))) { query.finished(); } else if ("false".equals((String) params.get("ended"))) { @@ -240,7 +247,17 @@ public class ActHistoryService { PageData pageData = this.getHistoryProcessInstancePage(params); List list = pageData.getList(); for (ProcessInstanceDTO dto : list) { - if (dto.isEnded()) { + logger.info(dto.toString()); + TAbilityApplicationDTO abilityApplicationDTO = tAbilityApplicationService.getByInstanceId(dto.getProcessInstanceId()); // 获取申请表单 + if (abilityApplicationDTO != null && StringUtils.isNotEmpty(abilityApplicationDTO.getSystem()) && StringUtils.isEmpty(dto.getName())) { + dto.setName(abilityApplicationDTO.getSystem()); + } else { + TAbilityApplicationDTO abilityApplicationDTO1 = tAbilityApplicationService.getByBusinessKey(dto.getBusinessKey()); + if (abilityApplicationDTO1 != null) { + dto.setName(abilityApplicationDTO1.getSystem()); + } + } + if (dto.isEnded()) { // 已结束 continue; } List listTask = taskService.createTaskQuery().processInstanceId(dto.getProcessInstanceId()).list(); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java index da738fea..c6272c99 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java @@ -13,4 +13,8 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface TAbilityApplicationDao extends BaseDao { void updateInstanceId(String instanceId, Long id); + + TAbilityApplicationEntity getByInstanceId(String instanceId); + + TAbilityApplicationEntity getByBusinessKey(String businessKey); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java index 00026f1c..62619bd7 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java @@ -13,4 +13,11 @@ import io.renren.modules.processForm.entity.TAbilityApplicationEntity; public interface TAbilityApplicationService extends CrudService { void updateInstanceId(String instanceId, Long id); + + /** 根据instanceId 获取申请内容 + * @param instanceId + * @return + */ + TAbilityApplicationDTO getByInstanceId(String instanceId); + TAbilityApplicationDTO getByBusinessKey(String businessKey); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java index c0b5fb24..268d1910 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java @@ -2,12 +2,11 @@ package io.renren.modules.processForm.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.renren.common.service.impl.CrudServiceImpl; -import io.renren.common.constant.Constant; +import io.renren.common.utils.ConvertUtils; import io.renren.modules.processForm.dao.TAbilityApplicationDao; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.entity.TAbilityApplicationEntity; import io.renren.modules.processForm.service.TAbilityApplicationService; -import io.renren.modules.security.user.SecurityUser; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -23,7 +22,7 @@ import java.util.Map; public class TAbilityApplicationServiceImpl extends CrudServiceImpl implements TAbilityApplicationService { @Override - public QueryWrapper getWrapper(Map params){ + public QueryWrapper getWrapper(Map params) { QueryWrapper wrapper = new QueryWrapper<>(); @@ -35,5 +34,23 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl - ${LOG_HOME}/service.log + ${LOG_HOME}/info.log - ${LOG_HOME}/service.%d{yyyy-MM-dd}.%i.log + ${LOG_HOME}/info.%d{yyyy-MM-dd}.%i.log 120 500MB diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index 6f09a180..b7103789 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -7,4 +7,21 @@ update t_ability_application set instance_id = #{instanceId} where id = #{id} + + + \ No newline at end of file