|
|
@@ -184,42 +184,42 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
}
|
|
|
//endregion
|
|
|
|
|
|
- //region 陪同人员数据
|
|
|
- List<WelcomeAccompany> was = new ArrayList<>();
|
|
|
- if (isr.getAvs() != null && isr.getAvs().size() > 0) {
|
|
|
- for (InsertAccompanyRequest accompany : isr.getAvs()) {
|
|
|
- if (!(StringUtils.hasText(accompany.getName()) && StringUtils.hasText(accompany.getPhone()))) {
|
|
|
- return CommonResult.fail("陪同人员信息不能为空!");
|
|
|
- }
|
|
|
- WelcomeAccompany wa = new WelcomeAccompany();
|
|
|
- wa.setStudentCard(ws.getCardId());
|
|
|
- wa.setName(accompany.getName());
|
|
|
- wa.setPhone(accompany.getPhone());
|
|
|
- was.add(wa);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //endregion
|
|
|
-
|
|
|
- //region 宿舍信息
|
|
|
- WelcomeBed bedData = welcomeBedService.queryBedData(isr.getSchool(), isr.getBuildId(), isr.getDormitoryId(), Integer.valueOf(isr.getBed()));
|
|
|
- if (bedData != null) {
|
|
|
- if (StringUtils.hasText(bedData.getStudentCard())) {
|
|
|
- return CommonResult.fail("当前床位已被他人入住,无法入住");
|
|
|
- }
|
|
|
- bedData.setStudentCard(isr.getCardId());
|
|
|
- bedData.setCollege(isr.getCollege());
|
|
|
- bedData.setCollegeId(isr.getCollegeId());
|
|
|
- bedData.setMajor(isr.getMajor());
|
|
|
- bedData.setMajorId(isr.getMajorId());
|
|
|
- bedData.setClassstr(isr.getClassstr());
|
|
|
- bedData.setClassstrId(isr.getClassstrId());
|
|
|
- bedData.setIsCheck(1);
|
|
|
- bedData.setCardNum(isr.getAdmissNum());
|
|
|
- bedData.setName(isr.getName());
|
|
|
- }
|
|
|
-
|
|
|
- //endregion
|
|
|
+// //region 陪同人员数据
|
|
|
+// List<WelcomeAccompany> was = new ArrayList<>();
|
|
|
+// if (isr.getAvs() != null && isr.getAvs().size() > 0) {
|
|
|
+// for (InsertAccompanyRequest accompany : isr.getAvs()) {
|
|
|
+// if (!(StringUtils.hasText(accompany.getName()) && StringUtils.hasText(accompany.getPhone()))) {
|
|
|
+// return CommonResult.fail("陪同人员信息不能为空!");
|
|
|
+// }
|
|
|
+// WelcomeAccompany wa = new WelcomeAccompany();
|
|
|
+// wa.setStudentCard(ws.getCardId());
|
|
|
+// wa.setName(accompany.getName());
|
|
|
+// wa.setPhone(accompany.getPhone());
|
|
|
+// was.add(wa);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// //endregion
|
|
|
+//
|
|
|
+// //region 宿舍信息
|
|
|
+// WelcomeBed bedData = welcomeBedService.queryBedData(isr.getSchool(), isr.getBuildId(), isr.getDormitoryId(), Integer.valueOf(isr.getBed()));
|
|
|
+// if (bedData != null) {
|
|
|
+// if (StringUtils.hasText(bedData.getStudentCard())) {
|
|
|
+// return CommonResult.fail("当前床位已被他人入住,无法入住");
|
|
|
+// }
|
|
|
+// bedData.setStudentCard(isr.getCardId());
|
|
|
+// bedData.setCollege(isr.getCollege());
|
|
|
+// bedData.setCollegeId(isr.getCollegeId());
|
|
|
+// bedData.setMajor(isr.getMajor());
|
|
|
+// bedData.setMajorId(isr.getMajorId());
|
|
|
+// bedData.setClassstr(isr.getClassstr());
|
|
|
+// bedData.setClassstrId(isr.getClassstrId());
|
|
|
+// bedData.setIsCheck(1);
|
|
|
+// bedData.setCardNum(isr.getAdmissNum());
|
|
|
+// bedData.setName(isr.getName());
|
|
|
+// }
|
|
|
+//
|
|
|
+// //endregion
|
|
|
|
|
|
try {
|
|
|
|
|
|
@@ -237,19 +237,19 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (was != null && was.size() > 0) {
|
|
|
- boolean insertBatch = welcomeAccompanyService.saveBatch(was);
|
|
|
- if (!insertBatch) {
|
|
|
- logger.error("添加陪同人员失败,参数:" + JSON.toJSON(was));
|
|
|
- throw new Exception("添加失败!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- int insertStudentDormitory = welcomeBedService.updateWelcomeBed(bedData);
|
|
|
- if (insertStudentDormitory <= 0) {
|
|
|
- logger.error("添加学生床位信息失败,参数:" + JSON.toJSON(bedData));
|
|
|
- throw new Exception("添加失败!");
|
|
|
- }
|
|
|
+// if (was != null && was.size() > 0) {
|
|
|
+// boolean insertBatch = welcomeAccompanyService.saveBatch(was);
|
|
|
+// if (!insertBatch) {
|
|
|
+// logger.error("添加陪同人员失败,参数:" + JSON.toJSON(was));
|
|
|
+// throw new Exception("添加失败!");
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// int insertStudentDormitory = welcomeBedService.updateWelcomeBed(bedData);
|
|
|
+// if (insertStudentDormitory <= 0) {
|
|
|
+// logger.error("添加学生床位信息失败,参数:" + JSON.toJSON(bedData));
|
|
|
+// throw new Exception("添加失败!");
|
|
|
+// }
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage());
|
|
|
throw new Exception("添加失败!");
|
|
|
@@ -339,75 +339,75 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
}
|
|
|
//endregion
|
|
|
|
|
|
- //region 陪同人员数据
|
|
|
- List<WelcomeAccompany> was = new ArrayList<>();
|
|
|
- if (usr.getAvs() != null && usr.getAvs().size() > 0) {
|
|
|
- for (InsertAccompanyRequest accompany : usr.getAvs()) {
|
|
|
- if (!(StringUtils.hasText(accompany.getName()) && StringUtils.hasText(accompany.getPhone()))) {
|
|
|
- return CommonResult.fail("陪同人员信息不能为空!");
|
|
|
- }
|
|
|
- WelcomeAccompany wa = new WelcomeAccompany();
|
|
|
- wa.setStudentCard(student.getCardId());
|
|
|
- wa.setName(accompany.getName());
|
|
|
- wa.setPhone(accompany.getPhone());
|
|
|
- was.add(wa);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //endregion
|
|
|
-
|
|
|
- //region 宿舍信息
|
|
|
- List<WelcomeBed> bedDatas = new ArrayList<>();
|
|
|
- WelcomeBed bedData = welcomeBedService.queryBedData(usr.getSchool(), usr.getBuildId(), usr.getDormitoryId(), Integer.valueOf(usr.getBed()));
|
|
|
- if (bedData != null) {//新床位
|
|
|
- if (StringUtils.hasText(bedData.getStudentCard()) && !bedData.getStudentCard().equals(student.getCardId())) {
|
|
|
- return CommonResult.fail("当前床位已被他人入住,无法入住");
|
|
|
- }
|
|
|
- if (!StringUtils.hasText(bedData.getStudentCard())) {
|
|
|
- bedData.setStudentCard(student.getCardId());
|
|
|
- bedData.setCollege(student.getCollege());
|
|
|
- bedData.setCollegeId(student.getCollegeId());
|
|
|
- bedData.setMajor(student.getMajor());
|
|
|
- bedData.setMajorId(student.getMajorId());
|
|
|
- bedData.setClassstr(student.getClassstr());
|
|
|
- bedData.setClassstrId(student.getClassstrId());
|
|
|
- bedData.setIsCheck(1);
|
|
|
- bedData.setCardNum(student.getAdmissNum());
|
|
|
- bedData.setName(student.getName());
|
|
|
-
|
|
|
- //把旧床位清空
|
|
|
- WelcomeBed obedData = welcomeBedService.getBedByCardId(student.getCardId());
|
|
|
- if (obedData == null) {
|
|
|
- obedData = new WelcomeBed();
|
|
|
- obedData.setStudentCard(null);
|
|
|
- obedData.setCollege(null);
|
|
|
- obedData.setCollegeId(null);
|
|
|
- obedData.setMajor(null);
|
|
|
- obedData.setMajorId(null);
|
|
|
- obedData.setClassstr(null);
|
|
|
- obedData.setClassstrId(null);
|
|
|
- obedData.setIsCheck(0);
|
|
|
- obedData.setCardNum(null);
|
|
|
- obedData.setName(null);
|
|
|
- bedDatas.add(obedData);
|
|
|
- }
|
|
|
- } else {
|
|
|
- bedData.setStudentCard(student.getCardId());
|
|
|
- bedData.setCollege(student.getCollege());
|
|
|
- bedData.setCollegeId(student.getCollegeId());
|
|
|
- bedData.setMajor(student.getMajor());
|
|
|
- bedData.setMajorId(student.getMajorId());
|
|
|
- bedData.setClassstr(student.getClassstr());
|
|
|
- bedData.setClassstrId(student.getClassstrId());
|
|
|
- bedData.setIsCheck(1);
|
|
|
- bedData.setCardNum(student.getAdmissNum());
|
|
|
- bedData.setName(student.getName());
|
|
|
- }
|
|
|
- bedDatas.add(bedData);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //endregion
|
|
|
+// //region 陪同人员数据
|
|
|
+// List<WelcomeAccompany> was = new ArrayList<>();
|
|
|
+// if (usr.getAvs() != null && usr.getAvs().size() > 0) {
|
|
|
+// for (InsertAccompanyRequest accompany : usr.getAvs()) {
|
|
|
+// if (!(StringUtils.hasText(accompany.getName()) && StringUtils.hasText(accompany.getPhone()))) {
|
|
|
+// return CommonResult.fail("陪同人员信息不能为空!");
|
|
|
+// }
|
|
|
+// WelcomeAccompany wa = new WelcomeAccompany();
|
|
|
+// wa.setStudentCard(student.getCardId());
|
|
|
+// wa.setName(accompany.getName());
|
|
|
+// wa.setPhone(accompany.getPhone());
|
|
|
+// was.add(wa);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// //endregion
|
|
|
+//
|
|
|
+// //region 宿舍信息
|
|
|
+// List<WelcomeBed> bedDatas = new ArrayList<>();
|
|
|
+// WelcomeBed bedData = welcomeBedService.queryBedData(usr.getSchool(), usr.getBuildId(), usr.getDormitoryId(), Integer.valueOf(usr.getBed()));
|
|
|
+// if (bedData != null) {//新床位
|
|
|
+// if (StringUtils.hasText(bedData.getStudentCard()) && !bedData.getStudentCard().equals(student.getCardId())) {
|
|
|
+// return CommonResult.fail("当前床位已被他人入住,无法入住");
|
|
|
+// }
|
|
|
+// if (!StringUtils.hasText(bedData.getStudentCard())) {
|
|
|
+// bedData.setStudentCard(student.getCardId());
|
|
|
+// bedData.setCollege(student.getCollege());
|
|
|
+// bedData.setCollegeId(student.getCollegeId());
|
|
|
+// bedData.setMajor(student.getMajor());
|
|
|
+// bedData.setMajorId(student.getMajorId());
|
|
|
+// bedData.setClassstr(student.getClassstr());
|
|
|
+// bedData.setClassstrId(student.getClassstrId());
|
|
|
+// bedData.setIsCheck(1);
|
|
|
+// bedData.setCardNum(student.getAdmissNum());
|
|
|
+// bedData.setName(student.getName());
|
|
|
+//
|
|
|
+// //把旧床位清空
|
|
|
+// WelcomeBed obedData = welcomeBedService.getBedByCardId(student.getCardId());
|
|
|
+// if (obedData == null) {
|
|
|
+// obedData = new WelcomeBed();
|
|
|
+// obedData.setStudentCard(null);
|
|
|
+// obedData.setCollege(null);
|
|
|
+// obedData.setCollegeId(null);
|
|
|
+// obedData.setMajor(null);
|
|
|
+// obedData.setMajorId(null);
|
|
|
+// obedData.setClassstr(null);
|
|
|
+// obedData.setClassstrId(null);
|
|
|
+// obedData.setIsCheck(0);
|
|
|
+// obedData.setCardNum(null);
|
|
|
+// obedData.setName(null);
|
|
|
+// bedDatas.add(obedData);
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// bedData.setStudentCard(student.getCardId());
|
|
|
+// bedData.setCollege(student.getCollege());
|
|
|
+// bedData.setCollegeId(student.getCollegeId());
|
|
|
+// bedData.setMajor(student.getMajor());
|
|
|
+// bedData.setMajorId(student.getMajorId());
|
|
|
+// bedData.setClassstr(student.getClassstr());
|
|
|
+// bedData.setClassstrId(student.getClassstrId());
|
|
|
+// bedData.setIsCheck(1);
|
|
|
+// bedData.setCardNum(student.getAdmissNum());
|
|
|
+// bedData.setName(student.getName());
|
|
|
+// }
|
|
|
+// bedDatas.add(bedData);
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //endregion
|
|
|
|
|
|
try {
|
|
|
|
|
|
@@ -426,20 +426,20 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int deleteA = welcomeAccompanyService.deleteWelcomeAccompanyByCard(student.getCardId());
|
|
|
- if (was != null && was.size() > 0) {
|
|
|
- boolean insertBatch = welcomeAccompanyService.saveBatch(was);
|
|
|
- if (!insertBatch) {
|
|
|
- logger.error("编辑陪同人员失败,参数:" + JSON.toJSON(was));
|
|
|
- throw new Exception("编辑失败!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- boolean updateBatch = welcomeBedService.updateBatchById(bedDatas);
|
|
|
- if (!updateBatch) {
|
|
|
- logger.error("添加宿舍信息失败,参数:" + JSON.toJSON(bedDatas));
|
|
|
- throw new Exception("添加失败!");
|
|
|
- }
|
|
|
+// int deleteA = welcomeAccompanyService.deleteWelcomeAccompanyByCard(student.getCardId());
|
|
|
+// if (was != null && was.size() > 0) {
|
|
|
+// boolean insertBatch = welcomeAccompanyService.saveBatch(was);
|
|
|
+// if (!insertBatch) {
|
|
|
+// logger.error("编辑陪同人员失败,参数:" + JSON.toJSON(was));
|
|
|
+// throw new Exception("编辑失败!");
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// boolean updateBatch = welcomeBedService.updateBatchById(bedDatas);
|
|
|
+// if (!updateBatch) {
|
|
|
+// logger.error("添加宿舍信息失败,参数:" + JSON.toJSON(bedDatas));
|
|
|
+// throw new Exception("添加失败!");
|
|
|
+// }
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage());
|