getMyProcessInstancePage接口字段的补充

This commit is contained in:
wangliwen 2022-04-20 16:51:15 +08:00
parent cc1778e40b
commit db9a819aba
7 changed files with 70 additions and 12 deletions

View File

@ -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<TaskDTO> currentTaskList;
}

View File

@ -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<ProcessInstanceDTO> pageData = this.getHistoryProcessInstancePage(params);
List<ProcessInstanceDTO> 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<Task> listTask = taskService.createTaskQuery().processInstanceId(dto.getProcessInstanceId()).list();

View File

@ -13,4 +13,8 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TAbilityApplicationDao extends BaseDao<TAbilityApplicationEntity> {
void updateInstanceId(String instanceId, Long id);
TAbilityApplicationEntity getByInstanceId(String instanceId);
TAbilityApplicationEntity getByBusinessKey(String businessKey);
}

View File

@ -13,4 +13,11 @@ import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
public interface TAbilityApplicationService extends CrudService<TAbilityApplicationEntity, TAbilityApplicationDTO> {
void updateInstanceId(String instanceId, Long id);
/** 根据instanceId 获取申请内容
* @param instanceId
* @return
*/
TAbilityApplicationDTO getByInstanceId(String instanceId);
TAbilityApplicationDTO getByBusinessKey(String businessKey);
}

View File

@ -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<TAbilityApplicationDao, TAbilityApplicationEntity, TAbilityApplicationDTO> implements TAbilityApplicationService {
@Override
public QueryWrapper<TAbilityApplicationEntity> getWrapper(Map<String, Object> params){
public QueryWrapper<TAbilityApplicationEntity> getWrapper(Map<String, Object> params) {
QueryWrapper<TAbilityApplicationEntity> wrapper = new QueryWrapper<>();
@ -35,5 +34,23 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
baseDao.updateInstanceId(instanceId, id);
}
@Override
public TAbilityApplicationDTO getByInstanceId(String instanceId) {
if (StringUtils.isEmpty(instanceId)) {
return null;
}
TAbilityApplicationEntity entity = baseDao.getByInstanceId(instanceId);
return ConvertUtils.sourceToTarget(entity, TAbilityApplicationDTO.class);
}
@Override
public TAbilityApplicationDTO getByBusinessKey(String businessKey) {
if (StringUtils.isEmpty(businessKey)) {
return null;
}
TAbilityApplicationEntity entity = baseDao.getByBusinessKey(businessKey);
return ConvertUtils.sourceToTarget(entity, TAbilityApplicationDTO.class);
}
}

View File

@ -9,9 +9,9 @@
<appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/service.log</file>
<file>${LOG_HOME}/info.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_HOME}/service.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<fileNamePattern>${LOG_HOME}/info.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<MaxHistory>120</MaxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>500MB</maxFileSize>

View File

@ -7,4 +7,21 @@
update t_ability_application set instance_id = #{instanceId} where id = #{id}
</update>
<select id="getByInstanceId" resultType="io.renren.modules.processForm.entity.TAbilityApplicationEntity">
SELECT
t1.*
FROM
t_ability_application t1
WHERE
t1.instance_id = #{instanceId}
</select>
<select id="getByBusinessKey" resultType="io.renren.modules.processForm.entity.TAbilityApplicationEntity">
SELECT
t1.*
FROM
t_ability_application t1
WHERE
t1.id = #{businessKey}
</select>
</mapper>