|
@@ -1,13 +1,21 @@
|
|
|
package com.qmth.sop.business.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.qmth.sop.business.bean.dto.OrgUserNameDto;
|
|
|
import com.qmth.sop.business.bean.result.TFFlowLogResult;
|
|
|
import com.qmth.sop.business.entity.TFFlowLog;
|
|
|
import com.qmth.sop.business.mapper.TFFlowLogMapper;
|
|
|
+import com.qmth.sop.business.service.SysUserService;
|
|
|
import com.qmth.sop.business.service.TFFlowLogService;
|
|
|
+import com.qmth.sop.common.contant.SystemConstant;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -20,6 +28,9 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class TFFlowLogServiceImpl extends ServiceImpl<TFFlowLogMapper, TFFlowLog> implements TFFlowLogService {
|
|
|
|
|
|
+ @Resource
|
|
|
+ SysUserService sysUserService;
|
|
|
+
|
|
|
/**
|
|
|
* 根据实体id查询
|
|
|
*
|
|
@@ -28,7 +39,22 @@ public class TFFlowLogServiceImpl extends ServiceImpl<TFFlowLogMapper, TFFlowLog
|
|
|
*/
|
|
|
@Override
|
|
|
public List<TFFlowLogResult> findByObjectId(Long objectId) {
|
|
|
- return this.baseMapper.findByObjectId(objectId);
|
|
|
+ List<TFFlowLogResult> tfFlowLogResultList = this.baseMapper.findByObjectId(objectId);
|
|
|
+ for (TFFlowLogResult t : tfFlowLogResultList) {
|
|
|
+ TFFlowLog tfFlowLog = this.baseMapper.findByLastFlowLog(t.getFlowId());
|
|
|
+ if (Objects.nonNull(tfFlowLog) && Objects.nonNull(tfFlowLog.getPendApproveId())) {
|
|
|
+ List<String> userList = Arrays.asList(tfFlowLog.getPendApproveId().split(SystemConstant.LIST_JOIN_SPLIT));
|
|
|
+ List<OrgUserNameDto> orgUserNameDtoList = sysUserService.findOrgUserName(userList.stream().map(s -> Long.parseLong(s)).collect(Collectors.toList()));
|
|
|
+ List<String> userName = orgUserNameDtoList.stream().map(s -> s.getOrgUserName()).collect(Collectors.toList());
|
|
|
+ t.setPendApproveUserName(StringUtils.join(userName, SystemConstant.LIST_JOIN_SPLIT));
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(tfFlowLog) && Objects.nonNull(tfFlowLog.getApproveId())) {
|
|
|
+ List<OrgUserNameDto> orgUserNameDtoList = sysUserService.findOrgUserName(Arrays.asList(tfFlowLog.getApproveId()));
|
|
|
+ List<String> userName = orgUserNameDtoList.stream().map(s -> s.getOrgUserName()).collect(Collectors.toList());
|
|
|
+ t.setApproveUserName(StringUtils.join(userName, SystemConstant.LIST_JOIN_SPLIT));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return tfFlowLogResultList;
|
|
|
}
|
|
|
|
|
|
/**
|