|
@@ -5,14 +5,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
|
|
|
import com.qmth.distributed.print.business.entity.TFFlow;
|
|
|
+import com.qmth.distributed.print.business.entity.TFFlowLog;
|
|
|
+import com.qmth.distributed.print.business.mapper.TExamTaskFlowMapper;
|
|
|
+import com.qmth.distributed.print.business.mapper.TFFlowLogMapper;
|
|
|
import com.qmth.distributed.print.business.mapper.TFFlowMapper;
|
|
|
import com.qmth.distributed.print.business.service.TFFlowService;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
+import com.qmth.teachcloud.common.enums.FlowApproveSetupEnum;
|
|
|
+import com.qmth.teachcloud.common.service.SysUserService;
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -28,6 +34,15 @@ public class TFFlowServiceImpl extends ServiceImpl<TFFlowMapper, TFFlow> impleme
|
|
|
@Resource
|
|
|
TFFlowMapper tfFlowMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TExamTaskFlowMapper tExamTaskFlowMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ TFFlowLogMapper tfFlowLogMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ SysUserService sysUserService;
|
|
|
+
|
|
|
/**
|
|
|
* 流程列表
|
|
|
*
|
|
@@ -53,8 +68,36 @@ public class TFFlowServiceImpl extends ServiceImpl<TFFlowMapper, TFFlow> impleme
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String startName, Long schoolId, Long orgId, Long flowId) {
|
|
|
- return tfFlowMapper.flowApproveList(iPage, startName, schoolId, orgId, flowId);
|
|
|
+ public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String status, String startName, Long createStartTime, Long createEndTime, Long schoolId, Long orgId, Long flowId) {
|
|
|
+ IPage<FlowApproveResult> flowApproveResultIPage = tfFlowMapper.flowApproveList(iPage, status, startName, createStartTime, createEndTime, schoolId, orgId, flowId);
|
|
|
+ for (FlowApproveResult record : flowApproveResultIPage.getRecords()) {
|
|
|
+ record.setStatusStr(record.getStatus().getTitle());
|
|
|
+ // FlowApproveSetupEnum
|
|
|
+ if (!(FlowApproveSetupEnum.END.getSetup() == record.getSetup())) {
|
|
|
+ record.setSetupStr("结束节点");
|
|
|
+ } else if (FlowApproveSetupEnum.SUBMIT.getSetup() == record.getSetup()) {
|
|
|
+ record.setSetupStr("开始节点");
|
|
|
+ } else {
|
|
|
+ record.setSetupStr("审批节点");
|
|
|
+ }
|
|
|
+
|
|
|
+ Long maxFlowId = tExamTaskFlowMapper.selectMaxFlowIdByExamTaskId(record.getTaskId());
|
|
|
+ if (Objects.nonNull(maxFlowId)) {
|
|
|
+ List<TFFlowLog> flowLogs = tfFlowLogMapper.findByFlowId(maxFlowId);
|
|
|
+ TFFlowLog tfFlowLog = flowLogs.stream().sorted(Comparator.comparingLong(TFFlowLog::getCreateTime).reversed()).findFirst().orElse(null);
|
|
|
+ if (Objects.nonNull(tfFlowLog)) {
|
|
|
+ String pendApproveId = tfFlowLog.getPendApproveId();
|
|
|
+ StringJoiner sj = new StringJoiner(",");
|
|
|
+ for (String id : pendApproveId.split(",")) {
|
|
|
+ SysUser sysUser = sysUserService.getById(id);
|
|
|
+ sj.add(sysUser.getRealName());
|
|
|
+ }
|
|
|
+ record.setCurrentApproveUserName(sj.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return flowApproveResultIPage;
|
|
|
}
|
|
|
|
|
|
/**
|