|
|
@ -1,8 +1,12 @@
|
|
|
|
package com.hzu.bookingsystem.service.impl;
|
|
|
|
package com.hzu.bookingsystem.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.hzu.bookingsystem.bean.LabRecordBean;
|
|
|
|
import com.hzu.bookingsystem.bean.LabRecordBean;
|
|
|
|
|
|
|
|
import com.hzu.bookingsystem.bean.LabTimeBean;
|
|
|
|
|
|
|
|
import com.hzu.bookingsystem.bean.UserCourseBean;
|
|
|
|
import com.hzu.bookingsystem.repository.LabRecordRepository;
|
|
|
|
import com.hzu.bookingsystem.repository.LabRecordRepository;
|
|
|
|
import com.hzu.bookingsystem.service.LabRecordService;
|
|
|
|
import com.hzu.bookingsystem.service.LabRecordService;
|
|
|
|
|
|
|
|
import com.hzu.bookingsystem.service.LabTimeService;
|
|
|
|
|
|
|
|
import com.hzu.bookingsystem.service.UserCourseService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
@ -14,6 +18,10 @@ import java.util.List;
|
|
|
|
public class LabRecordServiceImpl implements LabRecordService{
|
|
|
|
public class LabRecordServiceImpl implements LabRecordService{
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private LabRecordRepository labrecordRepository;
|
|
|
|
private LabRecordRepository labrecordRepository;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private UserCourseService usercourseservice ;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private LabTimeService labtimeservice ;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public LabRecordBean add(LabRecordBean labrcecord) {
|
|
|
|
public LabRecordBean add(LabRecordBean labrcecord) {
|
|
|
@ -23,10 +31,12 @@ public class LabRecordServiceImpl implements LabRecordService{
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<LabRecordBean> findAll() {
|
|
|
|
public List<LabRecordBean> findAll() {
|
|
|
|
|
|
|
|
|
|
|
|
return labrecordRepository.findAll();
|
|
|
|
return labrecordRepository.findAll();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<LabRecordBean> findByStatus(Integer status) {
|
|
|
|
public List<LabRecordBean> findByStatus(Integer status) {
|
|
|
|
|
|
|
|
|
|
|
|
return labrecordRepository.findByStatus(status);
|
|
|
|
return labrecordRepository.findByStatus(status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -46,4 +56,27 @@ public class LabRecordServiceImpl implements LabRecordService{
|
|
|
|
labrecordRepository.deleteBylrId(lr_id);
|
|
|
|
labrecordRepository.deleteBylrId(lr_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public LabRecordBean findByUcId(Integer uc_id) {
|
|
|
|
|
|
|
|
return labrecordRepository.findByUcId(uc_id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public String[][][] getcourseByuser(Integer u_id , String year ,Integer semester ) {
|
|
|
|
|
|
|
|
String value[][][] = new String[7][5][20] ;
|
|
|
|
|
|
|
|
List<UserCourseBean> usercourses=usercourseservice.findAllByUidAndYearAndSemester(u_id,year,semester) ;
|
|
|
|
|
|
|
|
for ( UserCourseBean uc : usercourses)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LabRecordBean labrecord = findByUcId(uc.getUcId()) ;
|
|
|
|
|
|
|
|
LabTimeBean labtime=labtimeservice.findByLtId(labrecord.getLtId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer day= Integer.valueOf(labtime.getTime()) -1 ;
|
|
|
|
|
|
|
|
Integer time= Integer.valueOf(labtime.getTime()) -1 ;
|
|
|
|
|
|
|
|
Integer week= Integer.valueOf(labtime.getWeek()) -1 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
value[day][time][week] =uc.getName() ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return value ;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|