|
|
@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
+import org.springframework.web.bind.annotation.RequestAttribute;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@@ -813,11 +814,40 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CommonResult bedDetails(Integer schoolId, Integer buildId, Integer dormitoryId, String studentCard) {
|
|
|
+ public CommonResult bedDetails(String studentCard) {
|
|
|
+ List<BedDetailsVo> result = new ArrayList<>();
|
|
|
+ WelcomeStudent student = welcomeStudentService.getDataByIdcard(studentCard);
|
|
|
+ if(student == null){
|
|
|
+ return CommonResult.fail("当前学生信息已失效,查看失败");
|
|
|
+ }
|
|
|
// 获取未入住的床位
|
|
|
- List<BedDetailsVo> beds = welcomeBedService.getBedList(schoolId, buildId, dormitoryId, studentCard);
|
|
|
+ List<BedInfosVo> beds = welcomeBedService.queryBedList(studentCard);
|
|
|
+
|
|
|
+ for (BedInfosVo bed:beds) {
|
|
|
+ BedDetailsVo data = new BedDetailsVo();
|
|
|
+ if(bed.getStudentCard() != null && bed.getStudentCard().equals(studentCard)){
|
|
|
+ data.setPicture(student.getPicture());
|
|
|
+ data.setCardNum(student.getAdmissNum());
|
|
|
+ data.setName(student.getName());
|
|
|
+ data.setSex(student.getSex());
|
|
|
+ data.setNationality(student.getNationality());
|
|
|
+ data.setCollege(student.getCollege());
|
|
|
+ data.setMajor(student.getMajor());
|
|
|
+ data.setClassstr(student.getClassstr());
|
|
|
+ data.setBatchValue(student.getBatchValue());
|
|
|
+ data.setExamNum(student.getExamNum());
|
|
|
+ data.setStudentCard(student.getCardId());
|
|
|
+ data.setAddress(student.getAddress());
|
|
|
+ data.setPhone(student.getPhone());
|
|
|
+ }
|
|
|
+ data.setBuild(bed.getBuild());
|
|
|
+ data.setDormitory(bed.getDormitory());
|
|
|
+ data.setNumber(bed.getNumber());
|
|
|
+ data.setIsCheck(bed.getIsCheck());
|
|
|
+ result.add(data);
|
|
|
+ }
|
|
|
|
|
|
- return CommonResult.ok(beds);
|
|
|
+ return CommonResult.ok(result);
|
|
|
|
|
|
}
|
|
|
|