Newer
Older
huludao / src / main / java / com / newfiber / api / pc / service / impl / MeetTaskServiceImpl.java
package com.newfiber.api.pc.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.newfiber.api.pc.dao.MeetTaskMapper;
import com.newfiber.api.pc.model.meet.MeetTask;
import com.newfiber.api.pc.model.vo.MeetTaskVo;
import com.newfiber.api.pc.service.MeetTaskService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;


/**
 * @Author:zzh
 * @CreateDate:2020/11/26 16:44
 * @Description:
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MeetTaskServiceImpl extends ServiceImpl<MeetTaskMapper, MeetTask> implements MeetTaskService {


    @Override
    public List<MeetTaskVo> selectTaskList() {
        EntityWrapper<MeetTask> wrapper = new EntityWrapper<>();
        List<MeetTask> meetTasks = this.selectList(wrapper);
        List<MeetTaskVo> result = new ArrayList<>();
        if(!meetTasks.isEmpty()){
            meetTasks.stream().forEach(e->{
                MeetTaskVo vo = new MeetTaskVo();
                BeanUtils.copyProperties(e,vo);
                result.add(vo);
            });
        }
        return result;
    }
}