src/main/java/com/lxq/model/service/LeaveApplicationService.java

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.lxq.model.service;

import com.lxq.Tools.TimeTools;
import com.lxq.model.dao.LeaveApplicationDAO;
import com.lxq.model.object.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class LeaveApplicationService {
    @Autowired
    private LeaveApplicationDAO LeaveApplicationDAO;
    @Autowired
    private UserService userService;
    @Autowired
    private CurriculumService curriculumService;
    @Autowired
    private TimeTools timeTools;
    @Autowired
    private RecordService recordService;


    //查询考勤申请全部信息
    public List<LeaveApplication> getAllLeaveApplication(LeaveApplication leaveApplication){
        List<LeaveApplication> allLeaveApplication = new ArrayList<>();
        try{


            List<LeaveApplication>  allLeaveApplicationSearch = LeaveApplicationDAO.getAllLeaveApplication(leaveApplication);
            for (LeaveApplication LeaveApplication: allLeaveApplicationSearch) {

                User student = new User();
                student.setUserId(LeaveApplication.getUserId());
                User userStudent = userService.getUser(student);

                User teacher = new User();
                teacher.setUserId(LeaveApplication.getTeacherId());
                User userTeacher = userService.getUser(teacher);

                Curriculum curriculum = new Curriculum();
                curriculum.setId(Integer.parseInt(LeaveApplication.getCurriculumId()));
                Curriculum curriculumSearch = curriculumService.getCurriculum(curriculum);

                //学生信息
                LeaveApplication.setStudentMessage(userStudent);
                //老师信息
                LeaveApplication.setTeacherMessage(userTeacher);
                //课程信息
                LeaveApplication.setCurriculumMessage(curriculumSearch);

                allLeaveApplication.add(LeaveApplication);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return allLeaveApplication;
    }
后面还有 88 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。