package digital.laboratory.platform.reagent.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.reagent.entity.EvaluationForm;
import digital.laboratory.platform.reagent.entity.ProvideServicesOrSupplies;
import digital.laboratory.platform.reagent.mapper.ProvideServicesOrSuppliesMapper;
import digital.laboratory.platform.reagent.service.EvaluationFormService;
import digital.laboratory.platform.reagent.service.ProvideServicesOrSuppliesService;
import digital.laboratory.platform.reagent.vo.ProvideServicesOrSuppliesVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 提供服务或供应品服务实现类
 *
 * @author Zhang Xiaolong created at  2023-03-10
 * @describe 提供服务或供应品 服务实现类
 */
@Service
public class ProvideServicesOrSuppliesServiceImpl extends ServiceImpl<ProvideServicesOrSuppliesMapper, ProvideServicesOrSupplies> implements ProvideServicesOrSuppliesService {

    @Autowired
    private ProvideServicesOrSuppliesService provideServicesOrSuppliesService;

    @Autowired
    private EvaluationFormService evaluationFormService;

    @Override
    public List<ProvideServicesOrSuppliesVO> getProvideServicesOrSuppliesVOList(String provideServicesOrSuppliesId) {

        List<ProvideServicesOrSuppliesVO> provideServicesOrSuppliesVOList = baseMapper.getProvideServicesOrSuppliesVOList(provideServicesOrSuppliesId);

        return provideServicesOrSuppliesVOList;
    }
    @Override
    public ProvideServicesOrSupplies addById(String evaluationFormId){

        ProvideServicesOrSupplies provideServicesOrSupplies = new ProvideServicesOrSupplies();

        provideServicesOrSupplies.setProvideServicesOrSuppliesId(IdWorker.get32UUID().toUpperCase());

        provideServicesOrSupplies.setEvaluationFormId(evaluationFormId);

        provideServicesOrSuppliesService.save(provideServicesOrSupplies);

        return provideServicesOrSupplies;


    }
}
