| | |
| | | import com.ycl.entity.caseHandler.BaseCase; |
| | | import com.ycl.entity.caseHandler.DisposeRecord; |
| | | import com.ycl.entity.caseHandler.WorkflowConfigStep; |
| | | import com.ycl.entity.user.UmsAdminRoleRelation; |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.mapper.caseHandler.BaseCaseMapper; |
| | | import com.ycl.mapper.caseHandler.DisposeRecordMapper; |
| | | import com.ycl.mapper.caseHandler.WorkflowConfigStepMapper; |
| | | import com.ycl.mapper.user.UmsAdminRoleRelationMapper; |
| | | import com.ycl.service.caseHandler.IDisposeRecordService; |
| | | import com.ycl.vo.MyBacklogVO; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Resource |
| | | WorkflowConfigStepMapper workflowConfigStepMapper; |
| | | |
| | | @Resource |
| | | UmsAdminRoleRelationMapper umsAdminRoleRelationMapper; |
| | | |
| | | @Override |
| | | public List<MyBacklogVO> listMyTask(String num, Long userId) { |
| | | return disposeRecordMapper.selectList( |
| | | new LambdaQueryWrapper<DisposeRecord>() |
| | | .eq(DisposeRecord::getHandlerId, userId.intValue()) |
| | | .isNull(DisposeRecord::getEndTime)) |
| | | .stream() |
| | | .filter(item -> { |
| | | if (StringUtils.isBlank(num)){ |
| | | return true; |
| | | }else { |
| | | BaseCase baseCase = baseCaseMapper.selectById(item.getBaseCaseId()); |
| | | if (baseCase.getCode().contains(num)) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | }) |
| | | .map(item -> { |
| | | MyBacklogVO myBacklogVO = new MyBacklogVO(); |
| | | BeanUtils.copyProperties(item, myBacklogVO); |
| | | BaseCase baseCase = baseCaseMapper.selectById(item.getBaseCaseId()); |
| | | myBacklogVO.setCategory(baseCase.getCategory()); |
| | | myBacklogVO.setEventSource(baseCase.getEventSource()); |
| | | myBacklogVO.setCode(baseCase.getCode()); |
| | | return myBacklogVO; |
| | | }).collect(Collectors.toList()); |
| | | ArrayList<MyBacklogVO> myBacklogVOS = new ArrayList<>(); |
| | | umsAdminRoleRelationMapper |
| | | .selectList(new LambdaQueryWrapper<UmsAdminRoleRelation>() |
| | | .eq(UmsAdminRoleRelation::getAdminId, userId)) |
| | | .forEach(item1 -> |
| | | myBacklogVOS.addAll(disposeRecordMapper.selectList( |
| | | new LambdaQueryWrapper<DisposeRecord>() |
| | | .eq(DisposeRecord::getHandlerRoleId, item1.getRoleId()) |
| | | .isNull(DisposeRecord::getEndTime)) |
| | | .stream() |
| | | .filter(item -> { |
| | | if (StringUtils.isBlank(num)) { |
| | | return true; |
| | | } else { |
| | | BaseCase baseCase = baseCaseMapper.selectById(item.getBaseCaseId()); |
| | | if (baseCase.getCode().contains(num)) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | }) |
| | | .map(item -> { |
| | | MyBacklogVO myBacklogVO = new MyBacklogVO(); |
| | | BeanUtils.copyProperties(item, myBacklogVO); |
| | | BaseCase baseCase = baseCaseMapper.selectById(item.getBaseCaseId()); |
| | | myBacklogVO.setCategory(baseCase.getCategory()); |
| | | myBacklogVO.setEventSource(baseCase.getEventSource()); |
| | | myBacklogVO.setCode(baseCase.getCode()); |
| | | return myBacklogVO; |
| | | }).collect(Collectors.toList())) |
| | | ); |
| | | return myBacklogVOS; |
| | | } |
| | | |
| | | @Override |
| | |
| | | WorkflowConfigStep dispatchStep = workflowConfigStepMapper.selectOne(qureyDispatch); |
| | | |
| | | UpdateWrapper<DisposeRecord> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("base_case_id", disposeRecord.getBaseCaseId()).eq("workflow_config_step_id",dispatchStep.getId()); |
| | | updateWrapper.eq("base_case_id", disposeRecord.getBaseCaseId()).eq("workflow_config_step_id", dispatchStep.getId()); |
| | | |
| | | DisposeRecord updateRecord = new DisposeRecord(); |
| | | updateRecord.setState(1); |