|
@@ -5,6 +5,7 @@ import com.alibaba.druid.sql.visitor.functions.If;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
|
|
+import com.sun.org.apache.bcel.internal.generic.NEW;
|
|
|
import com.template.api.WelcomeBedControllerAPI;
|
|
import com.template.api.WelcomeBedControllerAPI;
|
|
|
import com.template.common.utils.BeanUtil;
|
|
import com.template.common.utils.BeanUtil;
|
|
|
import com.template.common.utils.ExcelUtils;
|
|
import com.template.common.utils.ExcelUtils;
|
|
@@ -40,9 +41,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Optional;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -767,11 +766,14 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
if (bed.getIsCheck()==1) {
|
|
if (bed.getIsCheck()==1) {
|
|
|
return CommonResult.fail("该床位已被其他人入住");
|
|
return CommonResult.fail("该床位已被其他人入住");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if (!welcomeStudent.getCollegeId().equals(bed.getCollegeId())) {
|
|
if (!welcomeStudent.getCollegeId().equals(bed.getCollegeId())) {
|
|
|
return CommonResult.fail("请勿跨学院入住");
|
|
return CommonResult.fail("请勿跨学院入住");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (!welcomeStudent.getSex().equals(bed.getSex())) {
|
|
|
|
|
+ return CommonResult.fail("请勿跨性别入住");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
bed.setIsCheck(1);
|
|
bed.setIsCheck(1);
|
|
|
bed.setStudentCard(welcomeStudent.getCardId());
|
|
bed.setStudentCard(welcomeStudent.getCardId());
|
|
@@ -844,7 +846,11 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
return CommonResult.fail("床位不存在");
|
|
return CommonResult.fail("床位不存在");
|
|
|
}
|
|
}
|
|
|
if (!sourceBed.getCollegeId().equals(changeBed.getCollegeId())) {
|
|
if (!sourceBed.getCollegeId().equals(changeBed.getCollegeId())) {
|
|
|
- return CommonResult.fail("学院不同无法换床");
|
|
|
|
|
|
|
+ return CommonResult.fail("请勿跨学院换床位");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!sourceBed.getSex().equals(changeBed.getSex())) {
|
|
|
|
|
+ return CommonResult.fail("请勿跨性别换床位");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
changeBed.setIsCheck(1);
|
|
changeBed.setIsCheck(1);
|
|
@@ -915,7 +921,11 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!sourceBed.getCollegeId().equals(changeBed.getCollegeId())) {
|
|
if (!sourceBed.getCollegeId().equals(changeBed.getCollegeId())) {
|
|
|
- return CommonResult.fail("学院不同无法床位对调");
|
|
|
|
|
|
|
+ return CommonResult.fail("请勿跨学院床位对调");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!sourceBed.getSex().equals(changeBed.getSex())) {
|
|
|
|
|
+ return CommonResult.fail("请勿跨性别对调床位");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 源数据
|
|
// 源数据
|
|
@@ -1020,11 +1030,138 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public CommonResult collegeBedGroup(Integer schoolId, Integer buildId, Integer dormitoryId, Integer collegeId) {
|
|
|
|
|
|
|
+ public CommonResult changeBuildGroup(Integer schoolId, Integer collegeId, String sex) {
|
|
|
|
|
+ // 获取未入住的楼栋
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.changeBuildGroup(schoolId,collegeId,sex);
|
|
|
|
|
+ ArrayList<ChangeBuildGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeBuildGroupVo vo = new ChangeBuildGroupVo();
|
|
|
|
|
+ vo.setBuild(bed.getBuild());
|
|
|
|
|
+ vo.setBuildId(bed.getBuildId());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult changeDormitoryGroup(Integer schoolId, Integer buildId, Integer collegeId, String sex) {
|
|
|
|
|
+ // 获取未入住的寝室
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.changeDormitoryGroup(schoolId,buildId,collegeId,sex);
|
|
|
|
|
+ ArrayList<ChangeDormitoryGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeDormitoryGroupVo vo = new ChangeDormitoryGroupVo();
|
|
|
|
|
+ vo.setDormitory(bed.getDormitory());
|
|
|
|
|
+ vo.setDormitoryId(bed.getDormitoryId());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult changeBedGroup(Integer schoolId, Integer buildId, Integer dormitoryId, Integer collegeId,String sex) {
|
|
|
// 获取未入住的床位
|
|
// 获取未入住的床位
|
|
|
- List<WelcomeBed> beds = welcomeBedService.collegeBedGroup(schoolId, buildId, dormitoryId,collegeId);
|
|
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.changeBedGroup(schoolId, buildId, dormitoryId,collegeId,sex);
|
|
|
|
|
+ ArrayList<ChangeBedGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeBedGroupVo vo = new ChangeBedGroupVo();
|
|
|
|
|
+ vo.setBedId(bed.getId());
|
|
|
|
|
+ vo.setNumber(bed.getNumber());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return CommonResult.ok(beds);
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult replaceBuildGroup(Integer schoolId, Integer collegeId, String sex) {
|
|
|
|
|
+ // 获取已入住的楼栋
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.replaceBuildGroup(schoolId,collegeId,sex);
|
|
|
|
|
+ ArrayList<ChangeBuildGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeBuildGroupVo vo = new ChangeBuildGroupVo();
|
|
|
|
|
+ vo.setBuild(bed.getBuild());
|
|
|
|
|
+ vo.setBuildId(bed.getBuildId());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult replaceDormitoryGroup(Integer schoolId, Integer buildId, Integer collegeId, String sex) {
|
|
|
|
|
+ // 获取已入住的寝室
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.replaceDormitoryGroup(schoolId,buildId,collegeId,sex);
|
|
|
|
|
+ ArrayList<ChangeDormitoryGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeDormitoryGroupVo vo = new ChangeDormitoryGroupVo();
|
|
|
|
|
+ vo.setDormitory(bed.getDormitory());
|
|
|
|
|
+ vo.setDormitoryId(bed.getDormitoryId());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult replaceBedGroup(Integer schoolId, Integer buildId, Integer dormitoryId, Integer collegeId, String sex) {
|
|
|
|
|
+ // 获取已入住的床位
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.replaceBedGroup(schoolId, buildId, dormitoryId,collegeId,sex);
|
|
|
|
|
+ ArrayList<ChangeBedGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeBedGroupVo vo = new ChangeBedGroupVo();
|
|
|
|
|
+ vo.setBedId(bed.getId());
|
|
|
|
|
+ vo.setNumber(bed.getNumber());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult hBuildGroup(Integer schoolId, Integer collegeId, Integer majorId, Integer classstrid, String sex) {
|
|
|
|
|
+ // 获取未入住的楼栋
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.hBuildGroup(schoolId,collegeId,majorId,classstrid,sex);
|
|
|
|
|
+ ArrayList<ChangeBuildGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeBuildGroupVo vo = new ChangeBuildGroupVo();
|
|
|
|
|
+ vo.setBuild(bed.getBuild());
|
|
|
|
|
+ vo.setBuildId(bed.getBuildId());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult hDormitoryGroup(Integer schoolId, Integer buildId, Integer collegeId, Integer majorId, Integer classstrid, String sex) {
|
|
|
|
|
+ // 获取未入住的寝室
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.hDormitoryGroup(schoolId,buildId,collegeId,majorId,classstrid,sex);
|
|
|
|
|
+ ArrayList<ChangeDormitoryGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeDormitoryGroupVo vo = new ChangeDormitoryGroupVo();
|
|
|
|
|
+ vo.setDormitory(bed.getDormitory());
|
|
|
|
|
+ vo.setDormitoryId(bed.getDormitoryId());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult hBedGroup(Integer schoolId, Integer buildId, Integer dormitoryId, Integer collegeId, Integer majorId, Integer classstrid, String sex) {
|
|
|
|
|
+ // 获取未入住的床位
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.hBedGroup(schoolId, buildId, dormitoryId,collegeId,majorId,classstrid,sex);
|
|
|
|
|
+ ArrayList<ChangeBedGroupVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (WelcomeBed bed : beds) {
|
|
|
|
|
+ ChangeBedGroupVo vo = new ChangeBedGroupVo();
|
|
|
|
|
+ vo.setBedId(bed.getId());
|
|
|
|
|
+ vo.setNumber(bed.getNumber());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ return CommonResult.ok(vos);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|