package com.srs.diagnostic.service.impl;

import java.util.List;

import com.srs.common.utils.SecurityUtils;
import com.srs.diagnostic.domain.DiaReportStandards;
import com.srs.diagnostic.mapper.DiaReportStandardsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.diagnostic.mapper.DiaReportSubmissionsMapper;
import com.srs.diagnostic.domain.DiaReportSubmissions;
import com.srs.diagnostic.service.IDiaReportSubmissionsService;

/**
 * 学生报提交记录Service业务层处理
 *
 * @author srs
 * @date 2025-04-22
 */
@Service
public class DiaReportSubmissionsServiceImpl extends ServiceImpl<DiaReportSubmissionsMapper,DiaReportSubmissions> implements IDiaReportSubmissionsService {
    @Autowired
    private DiaReportSubmissionsMapper diaReportSubmissionsMapper;

    @Autowired
    private DiaReportStandardsMapper diaReportStandardsMapper;

    /**
     * 查询学生报提交记录列表
     *
     * @param diaReportSubmissions 学生报提交记录
     * @return 学生报提交记录
     */
    @Override
    public List<DiaReportSubmissions> selectDiaReportSubmissionsList(DiaReportSubmissions diaReportSubmissions) {
        DiaReportStandards diaReportStandards = new DiaReportStandards();
        diaReportStandards.setUserName(SecurityUtils.getUsername());
        List<DiaReportStandards> diaReportStandards1 = diaReportStandardsMapper.selectDiaReportStandardsList(diaReportStandards);
        if (diaReportStandards1.size() < 0) {
            diaReportSubmissions.setFillingStatus("未填写");
        }else {
            diaReportSubmissions.setFillingStatus("已填写");
        }
        return diaReportSubmissionsMapper.selectDiaReportSubmissionsList(diaReportSubmissions);
    }
}
