|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.template.api.WelcomeBedControllerAPI;
|
|
|
+import com.template.common.utils.BeanUtil;
|
|
|
import com.template.common.utils.ExcelUtils;
|
|
|
import com.template.common.utils.paramUtils;
|
|
|
import com.template.model.enumModel.eFileType;
|
|
|
@@ -801,13 +802,7 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
if (ObjectUtils.isEmpty(bed)) {
|
|
|
return CommonResult.fail("无该床铺信息");
|
|
|
}
|
|
|
- bed.setIsCheck(0);
|
|
|
- bed.setStudentCard(null);
|
|
|
- bed.setCardNum(null);
|
|
|
- bed.setClassstrId(null);
|
|
|
- bed.setClassstr(null);
|
|
|
- bed.setName(null);
|
|
|
- welcomeBedService.updateWelcomeBed(bed);
|
|
|
+ welcomeBedService.updateData(bedId);
|
|
|
|
|
|
// 修改寝室信息
|
|
|
WelcomeDormitory welcomeDormitory = welcomeDormitoryService.getById(bed.getDormitoryId());
|
|
|
@@ -837,7 +832,7 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
if (ObjectUtils.isEmpty(sourceBed) || ObjectUtils.isEmpty(changeBed)) {
|
|
|
return CommonResult.fail("床位不存在");
|
|
|
}
|
|
|
- ArrayList<WelcomeBed> welcomeBeds = new ArrayList<>();
|
|
|
+
|
|
|
changeBed.setIsCheck(1);
|
|
|
changeBed.setStudentCard(sourceBed.getStudentCard());
|
|
|
changeBed.setCardNum(sourceBed.getCardNum());
|
|
|
@@ -847,18 +842,9 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
changeBed.setMajorId(sourceBed.getMajorId());
|
|
|
changeBed.setMajor(sourceBed.getMajor());
|
|
|
changeBed.setInstructor(sourceBed.getInstructor());
|
|
|
- welcomeBeds.add(changeBed);
|
|
|
-
|
|
|
- sourceBed.setIsCheck(0);
|
|
|
- sourceBed.setStudentCard(null);
|
|
|
- sourceBed.setCardNum(null);
|
|
|
- sourceBed.setClassstrId(null);
|
|
|
- sourceBed.setClassstr(null);
|
|
|
- sourceBed.setName(null);
|
|
|
- sourceBed.setMajorId(null);
|
|
|
- sourceBed.setMajor(null);
|
|
|
- sourceBed.setInstructor(null);
|
|
|
- welcomeBeds.add(sourceBed);
|
|
|
+
|
|
|
+ welcomeBedService.updateData(sourceBedId);
|
|
|
+
|
|
|
|
|
|
// 修改寝室信息
|
|
|
WelcomeDormitory welcomeDormitoryC = welcomeDormitoryService.getById(changeBed.getDormitoryId());
|
|
|
@@ -891,15 +877,15 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
welcomeDormitoryService.updateById(welcomeDormitory);
|
|
|
}
|
|
|
|
|
|
- welcomeBedService.updateBatchById(welcomeBeds);
|
|
|
+ welcomeBedService.updateById(changeBed);
|
|
|
|
|
|
return CommonResult.ok();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CommonResult checkInBedGroup(Integer schoolId, Integer buildId, Integer dormitoryId) {
|
|
|
+ public CommonResult checkInBedGroup(Integer schoolId, Integer buildId, Integer dormitoryId,Integer bedId) {
|
|
|
// 获取已入住的床位
|
|
|
- List<WelcomeBed> beds = welcomeBedService.checkInBedGroup(schoolId, buildId, dormitoryId);
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.checkInBedGroup(schoolId, buildId, dormitoryId,bedId);
|
|
|
|
|
|
return CommonResult.ok(beds);
|
|
|
}
|
|
|
@@ -914,6 +900,11 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
return CommonResult.fail("床位不存在");
|
|
|
}
|
|
|
// 源数据
|
|
|
+ WelcomeBed welcomeBed = new WelcomeBed();
|
|
|
+ BeanUtil.copyProperties(sourceBed,welcomeBed);
|
|
|
+ WelcomeBed welcomeBed2 = new WelcomeBed();
|
|
|
+ BeanUtil.copyProperties(changeBed,welcomeBed2);
|
|
|
+
|
|
|
String studentCard = sourceBed.getStudentCard();
|
|
|
String cardNum = sourceBed.getCardNum();
|
|
|
Integer classstrId = sourceBed.getClassstrId();
|
|
|
@@ -934,27 +925,27 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
String instructor2 = changeBed.getInstructor();
|
|
|
|
|
|
|
|
|
- sourceBed.setStudentCard(studentCard2);
|
|
|
- sourceBed.setCardNum(cardNum2);
|
|
|
- sourceBed.setClassstrId(classstrId2);
|
|
|
- sourceBed.setClassstr(classstr2);
|
|
|
- sourceBed.setName(name2);
|
|
|
- sourceBed.setMajorId(majorId2);
|
|
|
- sourceBed.setMajor(major2);
|
|
|
- sourceBed.setInstructor(instructor2);
|
|
|
-
|
|
|
- changeBed.setStudentCard(studentCard);
|
|
|
- changeBed.setCardNum(cardNum);
|
|
|
- changeBed.setClassstrId(classstrId);
|
|
|
- changeBed.setClassstr(classstr);
|
|
|
- changeBed.setName(name);
|
|
|
- changeBed.setMajorId(majorId);
|
|
|
- changeBed.setMajor(major);
|
|
|
- changeBed.setInstructor(instructor);
|
|
|
+ welcomeBed.setStudentCard(studentCard2);
|
|
|
+ welcomeBed.setCardNum(cardNum2);
|
|
|
+ welcomeBed.setClassstrId(classstrId2);
|
|
|
+ welcomeBed.setClassstr(classstr2);
|
|
|
+ welcomeBed.setName(name2);
|
|
|
+ welcomeBed.setMajorId(majorId2);
|
|
|
+ welcomeBed.setMajor(major2);
|
|
|
+ welcomeBed.setInstructor(instructor2);
|
|
|
+
|
|
|
+ welcomeBed2.setStudentCard(studentCard);
|
|
|
+ welcomeBed2.setCardNum(cardNum);
|
|
|
+ welcomeBed2.setClassstrId(classstrId);
|
|
|
+ welcomeBed2.setClassstr(classstr);
|
|
|
+ welcomeBed2.setName(name);
|
|
|
+ welcomeBed2.setMajorId(majorId);
|
|
|
+ welcomeBed2.setMajor(major);
|
|
|
+ welcomeBed2.setInstructor(instructor);
|
|
|
|
|
|
ArrayList<WelcomeBed> welcomeBeds = new ArrayList<>();
|
|
|
- welcomeBeds.add(sourceBed);
|
|
|
- welcomeBeds.add(changeBed);
|
|
|
+ welcomeBeds.add(welcomeBed);
|
|
|
+ welcomeBeds.add(welcomeBed2);
|
|
|
|
|
|
welcomeBedService.updateBatchById(welcomeBeds);
|
|
|
return CommonResult.ok();
|