|
|
|
@ -2,10 +2,12 @@ package com.hzu.bookingsystem.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.hzu.bookingsystem.VO.ResultVO;
|
|
|
|
|
import com.hzu.bookingsystem.VO.WeekVO;
|
|
|
|
|
import com.hzu.bookingsystem.bean.LabRecordBean;
|
|
|
|
|
import com.hzu.bookingsystem.bean.LabTimeBean;
|
|
|
|
|
import com.hzu.bookingsystem.converter.Map2Object;
|
|
|
|
|
import com.hzu.bookingsystem.dto.LabRecordDTO;
|
|
|
|
|
import com.hzu.bookingsystem.repository.LabRecordDTOMapper;
|
|
|
|
|
import com.hzu.bookingsystem.service.LabRecordService;
|
|
|
|
|
import com.hzu.bookingsystem.service.LabTimeService;
|
|
|
|
|
import com.hzu.bookingsystem.utils.ResultVOUtil;
|
|
|
|
@ -13,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
@ -31,6 +34,9 @@ public class LabRecordController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserController userController;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private LabRecordDTOMapper labRecordDTOMapper;
|
|
|
|
|
|
|
|
|
|
// 根据id查看实验室记录
|
|
|
|
|
@GetMapping(value = "/findlabrecord/{lr_id}")
|
|
|
|
|
public ResultVO<Map<String, LabRecordBean>> FindLabRecordId(@PathVariable("lr_id") Integer lr_id) {
|
|
|
|
@ -143,4 +149,27 @@ public class LabRecordController {
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtil.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查找用户当前课程已经预约的时间表
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/getWeekBooked")
|
|
|
|
|
public ResultVO getWeekBooked(@RequestParam("labId") Integer lab_id,
|
|
|
|
|
@RequestParam("year") String year,
|
|
|
|
|
@RequestParam("semester") Integer semester,
|
|
|
|
|
@RequestParam("uc_id") Integer uc_id) {
|
|
|
|
|
//总表
|
|
|
|
|
List<List<List<Integer>>> lists = new ArrayList<>();
|
|
|
|
|
for (int i = 1; i <= 5; i++) {
|
|
|
|
|
// 一行数据
|
|
|
|
|
List<List<Integer>> timeList = new ArrayList<>();
|
|
|
|
|
for (int j = 1; j <= 7; j++) {
|
|
|
|
|
WeekVO weekVO = new WeekVO();
|
|
|
|
|
|
|
|
|
|
timeList.add(labrecordService.findWeeksBooked(lab_id, year, semester, j, i, uc_id));
|
|
|
|
|
}
|
|
|
|
|
lists.add(timeList);
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtil.success(lists);
|
|
|
|
|
}
|
|
|
|
|
}
|