|
@@ -1,14 +1,18 @@
|
|
|
package com.qmth.distributed.print.business.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.approvalForm.ApprovalInfo;
|
|
|
import com.qmth.distributed.print.business.bean.result.TFFlowLogResult;
|
|
|
import com.qmth.distributed.print.business.entity.TFFlowLog;
|
|
|
import com.qmth.distributed.print.business.mapper.TFFlowLogMapper;
|
|
|
import com.qmth.distributed.print.business.service.TFFlowLogService;
|
|
|
import com.qmth.teachcloud.common.enums.FlowApproveOperationEnum;
|
|
|
+import com.qmth.teachcloud.common.service.SysUserService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
@@ -25,6 +29,8 @@ public class TFFlowLogServiceImpl extends ServiceImpl<TFFlowLogMapper, TFFlowLog
|
|
|
|
|
|
@Resource
|
|
|
TFFlowLogMapper tfFlowLogMapper;
|
|
|
+ @Resource
|
|
|
+ SysUserService sysUserService;
|
|
|
|
|
|
/**
|
|
|
* 根据流程id查询流程状态
|
|
@@ -61,4 +67,22 @@ public class TFFlowLogServiceImpl extends ServiceImpl<TFFlowLogMapper, TFFlowLog
|
|
|
public TFFlowLog findByLast(Long flowId, Long schoolId, FlowApproveOperationEnum flowApproveOperationEnum) {
|
|
|
return tfFlowLogMapper.findByLast(flowId, schoolId, Objects.nonNull(flowApproveOperationEnum) ? flowApproveOperationEnum.name() : null);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ApprovalInfo> findApprovalInfoByFlowId(Long flowId) {
|
|
|
+ List<ApprovalInfo> approvalInfoList = new ArrayList<>();
|
|
|
+ List<TFFlowLog> tfFlowLogList = this.list(new QueryWrapper<TFFlowLog>().lambda()
|
|
|
+ .eq(TFFlowLog::getFlowId,flowId)
|
|
|
+ .ne(TFFlowLog::getApproveOperation,FlowApproveOperationEnum.SUBMIT));
|
|
|
+ for (TFFlowLog tfFlowLog : tfFlowLogList) {
|
|
|
+ ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
|
+ Long approveId = tfFlowLog.getApproveId();
|
|
|
+ approvalInfo.setApproveId(approveId);
|
|
|
+ approvalInfo.setApproveName(sysUserService.getById(approveId).getRealName());
|
|
|
+ approvalInfo.setTime(tfFlowLog.getUpdateTime());
|
|
|
+ approvalInfo.setRemark(tfFlowLog.getApproveRemark());
|
|
|
+ approvalInfoList.add(approvalInfo);
|
|
|
+ }
|
|
|
+ return approvalInfoList;
|
|
|
+ }
|
|
|
}
|