|
@@ -72,6 +72,14 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
String st = paramUtils.getParamError(bindingResult);
|
|
String st = paramUtils.getParamError(bindingResult);
|
|
|
return CommonResult.fail(st);
|
|
return CommonResult.fail(st);
|
|
|
}
|
|
}
|
|
|
|
|
+ WelcomeDormitory byId = welcomeDormitoryService.getById(iwbr.getDormitoryId());
|
|
|
|
|
+ if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
+ return CommonResult.fail("该宿舍号不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!byId.getSex().equals(iwbr.getSex())) {
|
|
|
|
|
+ return CommonResult.fail("请勿跨性别添加床位");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
WelcomeBed existData = welcomeBedService.queryBedData(iwbr.getSchool(), iwbr.getBuildId(), iwbr.getDormitoryId(), iwbr.getNumber());
|
|
WelcomeBed existData = welcomeBedService.queryBedData(iwbr.getSchool(), iwbr.getBuildId(), iwbr.getDormitoryId(), iwbr.getNumber());
|
|
|
if (existData != null) {
|
|
if (existData != null) {
|
|
@@ -128,6 +136,14 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
return CommonResult.fail("床位信息已失效,编辑失败");
|
|
return CommonResult.fail("床位信息已失效,编辑失败");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ WelcomeDormitory byId = welcomeDormitoryService.getById(uwbr.getDormitoryId());
|
|
|
|
|
+ if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
+ return CommonResult.fail("该宿舍号不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!byId.getSex().equals(uwbr.getSex())) {
|
|
|
|
|
+ return CommonResult.fail("请勿跨性别修改床位");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
WelcomeBed existData = welcomeBedService.queryBedData(uwbr.getSchool(), uwbr.getBuildId(), uwbr.getDormitoryId(), uwbr.getNumber());
|
|
WelcomeBed existData = welcomeBedService.queryBedData(uwbr.getSchool(), uwbr.getBuildId(), uwbr.getDormitoryId(), uwbr.getNumber());
|
|
|
if (existData != null && existData.getId().intValue() != uwbr.getId().intValue()) {
|
|
if (existData != null && existData.getId().intValue() != uwbr.getId().intValue()) {
|
|
|
return CommonResult.fail("该床位号已存在,请勿重复插入!");
|
|
return CommonResult.fail("该床位号已存在,请勿重复插入!");
|