package com.cirle.scientific.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.cirle.scientific.dao.QkjLungReportUnderstandAppDao;
import com.cirle.scientific.dao.RegionDao;
import com.cirle.scientific.dto.course.QkjLungReportUnderstandAppResp;
import com.cirle.scientific.po.QkjLungReportUnderstandApp;
import com.cirle.scientific.po.SysRegion;
import com.cirle.scientific.service.LungReportUnderstandAppService;
import com.cirle.scientific.service.SysRegionService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;


@Service
@Slf4j
@RequiredArgsConstructor
public class LungReportUnderstandAppServiceImpl implements LungReportUnderstandAppService {



    private final QkjLungReportUnderstandAppDao qkjLungReportUnderstandAppDao;


    @Override
    public List<QkjLungReportUnderstandAppResp> lungReportList(String memCard) {
        List<QkjLungReportUnderstandApp> appList = qkjLungReportUnderstandAppDao.findAllByMemCard(memCard);
        List<QkjLungReportUnderstandAppResp> collect = appList.stream().map(e -> BeanUtil.copyProperties(e, QkjLungReportUnderstandAppResp.class)).collect(Collectors.toList());
        return collect;
    }
}
