package com.srs.diagnostic.service.impl;

import java.util.List;

import com.srs.common.utils.DateUtils;
import com.srs.common.utils.SecurityUtils;
import com.srs.diagnostic.domain.DiaReportRelease;
import com.srs.diagnostic.mapper.DiaFillOutReportMapper;
import com.srs.diagnostic.mapper.DiaReportReleaseMapper;
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.DiaStudentInfoMapper;
import com.srs.diagnostic.domain.DiaStudentInfo;
import com.srs.diagnostic.service.IDiaStudentInfoService;

/**
 * 学生报信息Service业务层处理
 *
 * @author srs
 * @date 2025-05-26
 */
@Service
public class DiaStudentInfoServiceImpl extends ServiceImpl<DiaStudentInfoMapper,DiaStudentInfo> implements IDiaStudentInfoService {
    @Autowired
    private DiaStudentInfoMapper diaStudentInfoMapper;


    @Autowired
    private DiaReportReleaseMapper diaReportReleaseMapper;

    /**
     * 查询学生报信息
     *
     * @param userid 学生报信息主键
     * @return 学生报信息
     */
    @Override
    public DiaStudentInfo  selectDiaStudentInfolistid(Long userid) {
        return diaStudentInfoMapper.selectDiaStudentInfolistid(userid);
    }



    /**
     * 获取报表id
     *
     * @param id 学生报信息主键
     * @return 学生报信息
     */
//    @Override
//    public DiaStudentInfo selectDiaInfoById(Long id) {
//        return diaStudentInfoMapper.selectDiaInfoById(id);
//    }


    /**
     * 查询学生报信息列表
     *
     * @param diaStudentInfo 学生报信息
     * @return 学生报信息
     */
    @Override
    public List<DiaStudentInfo> selectDiaStudentInfoList(DiaStudentInfo diaStudentInfo) {
        diaStudentInfo.setCollegeId(SecurityUtils.getDeptId());
        diaStudentInfo.setStuNo(SecurityUtils.getUsername());
        diaStudentInfo.setUserId(SecurityUtils.getUserId());

        return diaStudentInfoMapper.selectDiaStudentInfoList(diaStudentInfo);
    }

    /**
     * 新增学生报信息
     *
     * @param diaStudentInfo 学生报信息
     * @return 结果
     */
    @Override
    public int insertDiaStudentInfo(DiaStudentInfo diaStudentInfo) {
        diaStudentInfo.setCollegeId(SecurityUtils.getDeptId());
        diaStudentInfo.setStuNo(SecurityUtils.getUsername());
        diaStudentInfo.setUserId(SecurityUtils.getUserId());
        diaStudentInfo.setCreateTime(DateUtils.getNowDate());
            return diaStudentInfoMapper.insertDiaStudentInfo(diaStudentInfo);
    }



}
