package com.ycl.service.caseHandler.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ycl.entity.caseHandler.BaseCase; import com.ycl.entity.caseHandler.DisposeRecord; import com.ycl.mapper.caseHandler.BaseCaseMapper; import com.ycl.mapper.caseHandler.DisposeRecordMapper; import com.ycl.service.caseHandler.IDisposeRecordService; import com.ycl.vo.MyBacklogVO; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.stream.Collectors; /** *

* 处置流程记录 服务实现类 *

* * @author wl * @since 2022-09-24 */ @Service public class DisposeRecordServiceImpl extends ServiceImpl implements IDisposeRecordService { @Resource BaseCaseMapper baseCaseMapper; @Resource DisposeRecordMapper disposeRecordMapper; @Override public List listMyTask(Integer caseId, Long userId) { return disposeRecordMapper.selectList( new LambdaQueryWrapper() .eq(DisposeRecord::getHandlerId, userId.intValue()) .isNull(DisposeRecord::getEndTime)) .stream() .map(item -> { MyBacklogVO myBacklogVO = new MyBacklogVO(); BeanUtils.copyProperties(item, myBacklogVO); BaseCase baseCase = baseCaseMapper.selectById(caseId); myBacklogVO.setCategory(baseCase.getCategory()); myBacklogVO.setEventSource(baseCase.getEventSource()); myBacklogVO.setCode(baseCase.getCode()); return myBacklogVO; }).collect(Collectors.toList()); } }