|
@@ -168,8 +168,8 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public CommonResult queryPageBeds(int currentPage, int pageCount, Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer isCheck, Integer collegeId, Integer majorId, Integer classstrId) {
|
|
|
|
|
- PageUtils<WelcomeBed> result = welcomeBedService.queryPageWelcomeBeds(currentPage, pageCount, schoolId, buildId, dormitoryId, sex, isCheck, collegeId, majorId, classstrId);
|
|
|
|
|
|
|
+ public CommonResult queryPageBeds(int currentPage, int pageCount, Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer isCheck, Integer collegeId, Integer majorId, Integer classstrId,Integer retentionState) {
|
|
|
|
|
+ PageUtils<WelcomeBed> result = welcomeBedService.queryPageWelcomeBeds(currentPage, pageCount, schoolId, buildId, dormitoryId, sex, isCheck, collegeId, majorId, classstrId,retentionState);
|
|
|
return CommonResult.ok(result);
|
|
return CommonResult.ok(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -282,43 +282,48 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
if (!number.equals("床位号")) {
|
|
if (!number.equals("床位号")) {
|
|
|
return CommonResult.fail("导入数据第四列为床位号");
|
|
return CommonResult.fail("导入数据第四列为床位号");
|
|
|
}
|
|
}
|
|
|
- String sex = dataFormatter.formatCellValue(row.getCell(5));//楼栋层数
|
|
|
|
|
|
|
+ String sex = dataFormatter.formatCellValue(row.getCell(5));//床位性别
|
|
|
if (!sex.equals("床位性别")) {
|
|
if (!sex.equals("床位性别")) {
|
|
|
return CommonResult.fail("导入数据第五列为床位性别");
|
|
return CommonResult.fail("导入数据第五列为床位性别");
|
|
|
}
|
|
}
|
|
|
- String college = dataFormatter.formatCellValue(row.getCell(6));//起始层数
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String grade = dataFormatter.formatCellValue(row.getCell(6));//所属年级
|
|
|
|
|
+ if (!grade.equals("所属年级")) {
|
|
|
|
|
+ return CommonResult.fail("导入数据第五列为所属年级");
|
|
|
|
|
+ }
|
|
|
|
|
+ String college = dataFormatter.formatCellValue(row.getCell(7));//所属学院
|
|
|
if (!college.equals("所属学院")) {
|
|
if (!college.equals("所属学院")) {
|
|
|
return CommonResult.fail("导入数据第六列为所属学院");
|
|
return CommonResult.fail("导入数据第六列为所属学院");
|
|
|
}
|
|
}
|
|
|
- String major = dataFormatter.formatCellValue(row.getCell(7));//备注
|
|
|
|
|
|
|
+ String major = dataFormatter.formatCellValue(row.getCell(8));//所属专业
|
|
|
if (!major.equals("所属专业")) {
|
|
if (!major.equals("所属专业")) {
|
|
|
return CommonResult.fail("导入数据第七列为所属专业");
|
|
return CommonResult.fail("导入数据第七列为所属专业");
|
|
|
}
|
|
}
|
|
|
- String classstr = dataFormatter.formatCellValue(row.getCell(8));//备注
|
|
|
|
|
|
|
+ String classstr = dataFormatter.formatCellValue(row.getCell(9));//备注
|
|
|
if (!classstr.equals("所属班级")) {
|
|
if (!classstr.equals("所属班级")) {
|
|
|
return CommonResult.fail("导入数据第八列为所属班级");
|
|
return CommonResult.fail("导入数据第八列为所属班级");
|
|
|
}
|
|
}
|
|
|
- String instructor = dataFormatter.formatCellValue(row.getCell(9));//备注
|
|
|
|
|
|
|
+ String instructor = dataFormatter.formatCellValue(row.getCell(10));//备注
|
|
|
if (!instructor.equals("辅导员")) {
|
|
if (!instructor.equals("辅导员")) {
|
|
|
return CommonResult.fail("导入数据第九列为辅导员");
|
|
return CommonResult.fail("导入数据第九列为辅导员");
|
|
|
}
|
|
}
|
|
|
- String isCheck = dataFormatter.formatCellValue(row.getCell(10));//备注
|
|
|
|
|
|
|
+ String isCheck = dataFormatter.formatCellValue(row.getCell(11));//备注
|
|
|
if (!isCheck.equals("是否入住")) {
|
|
if (!isCheck.equals("是否入住")) {
|
|
|
return CommonResult.fail("导入数据第十列为是否入住");
|
|
return CommonResult.fail("导入数据第十列为是否入住");
|
|
|
}
|
|
}
|
|
|
- String admissNum = dataFormatter.formatCellValue(row.getCell(11));//备注
|
|
|
|
|
|
|
+ String admissNum = dataFormatter.formatCellValue(row.getCell(12));//备注
|
|
|
if (!admissNum.equals("录取号")) {
|
|
if (!admissNum.equals("录取号")) {
|
|
|
return CommonResult.fail("导入数据第十一列为录取号");
|
|
return CommonResult.fail("导入数据第十一列为录取号");
|
|
|
}
|
|
}
|
|
|
- String name = dataFormatter.formatCellValue(row.getCell(12));//备注
|
|
|
|
|
|
|
+ String name = dataFormatter.formatCellValue(row.getCell(13));//备注
|
|
|
if (!name.equals("姓名")) {
|
|
if (!name.equals("姓名")) {
|
|
|
return CommonResult.fail("导入数据第十二列为姓名");
|
|
return CommonResult.fail("导入数据第十二列为姓名");
|
|
|
}
|
|
}
|
|
|
- String remark = dataFormatter.formatCellValue(row.getCell(13));//备注
|
|
|
|
|
|
|
+ String remark = dataFormatter.formatCellValue(row.getCell(14));//备注
|
|
|
if (!remark.equals("备注")) {
|
|
if (!remark.equals("备注")) {
|
|
|
return CommonResult.fail("导入数据第十三列为备注");
|
|
return CommonResult.fail("导入数据第十三列为备注");
|
|
|
}
|
|
}
|
|
|
- String retentionState = dataFormatter.formatCellValue(row.getCell(14));//是否保留
|
|
|
|
|
|
|
+ String retentionState = dataFormatter.formatCellValue(row.getCell(15));//是否保留
|
|
|
if (!retentionState.equals("是否保留")) {
|
|
if (!retentionState.equals("是否保留")) {
|
|
|
return CommonResult.fail("导入数据第十四列为是否保留");
|
|
return CommonResult.fail("导入数据第十四列为是否保留");
|
|
|
}
|
|
}
|
|
@@ -337,15 +342,16 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String sex = dataFormatter.formatCellValue(row.getCell(5));//楼栋层数
|
|
String sex = dataFormatter.formatCellValue(row.getCell(5));//楼栋层数
|
|
|
- String college = dataFormatter.formatCellValue(row.getCell(6));//起始层数
|
|
|
|
|
- String major = dataFormatter.formatCellValue(row.getCell(7));//备注
|
|
|
|
|
- String classstr = dataFormatter.formatCellValue(row.getCell(8));//备注
|
|
|
|
|
- String instructor = dataFormatter.formatCellValue(row.getCell(9));//辅导员
|
|
|
|
|
- String isCheck = dataFormatter.formatCellValue(row.getCell(10));//备注
|
|
|
|
|
- String admissNum = dataFormatter.formatCellValue(row.getCell(11));//备注
|
|
|
|
|
- String name = dataFormatter.formatCellValue(row.getCell(12));//备注
|
|
|
|
|
- String remark = dataFormatter.formatCellValue(row.getCell(13));//备注
|
|
|
|
|
- String retentionState = dataFormatter.formatCellValue(row.getCell(14));//是否保留
|
|
|
|
|
|
|
+ String grade = dataFormatter.formatCellValue(row.getCell(6));//起始层数
|
|
|
|
|
+ String college = dataFormatter.formatCellValue(row.getCell(7));//起始层数
|
|
|
|
|
+ String major = dataFormatter.formatCellValue(row.getCell(8));//备注
|
|
|
|
|
+ String classstr = dataFormatter.formatCellValue(row.getCell(9));//备注
|
|
|
|
|
+ String instructor = dataFormatter.formatCellValue(row.getCell(10));//辅导员
|
|
|
|
|
+ String isCheck = dataFormatter.formatCellValue(row.getCell(11));//备注
|
|
|
|
|
+ String admissNum = dataFormatter.formatCellValue(row.getCell(12));//备注
|
|
|
|
|
+ String name = dataFormatter.formatCellValue(row.getCell(13));//备注
|
|
|
|
|
+ String remark = dataFormatter.formatCellValue(row.getCell(14));//备注
|
|
|
|
|
+ String retentionState = dataFormatter.formatCellValue(row.getCell(15));//是否保留
|
|
|
|
|
|
|
|
|
|
|
|
|
bedData.setSchool(school);
|
|
bedData.setSchool(school);
|
|
@@ -397,6 +403,7 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
bedData.setRemark(remark);
|
|
bedData.setRemark(remark);
|
|
|
bedData.setRetentionState(Integer.valueOf(retentionState));
|
|
bedData.setRetentionState(Integer.valueOf(retentionState));
|
|
|
bedData.setInstructor(instructor);
|
|
bedData.setInstructor(instructor);
|
|
|
|
|
+ bedData.setGrade(Integer.valueOf(grade));
|
|
|
result.add(bedData);
|
|
result.add(bedData);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -465,39 +472,44 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
if (!sex.equals("床位性别")) {
|
|
if (!sex.equals("床位性别")) {
|
|
|
return CommonResult.fail("导入数据第五列为床位性别");
|
|
return CommonResult.fail("导入数据第五列为床位性别");
|
|
|
}
|
|
}
|
|
|
- String college = dataFormatter.formatCellValue(row.getCell(6));//起始层数
|
|
|
|
|
|
|
+ String grade = dataFormatter.formatCellValue(row.getCell(6));//起始层数
|
|
|
|
|
+ if (!grade.equals("所属年级")) {
|
|
|
|
|
+ return CommonResult.fail("导入数据第六列为所属年级");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String college = dataFormatter.formatCellValue(row.getCell(7));//起始层数
|
|
|
if (!college.equals("所属学院")) {
|
|
if (!college.equals("所属学院")) {
|
|
|
return CommonResult.fail("导入数据第六列为所属学院");
|
|
return CommonResult.fail("导入数据第六列为所属学院");
|
|
|
}
|
|
}
|
|
|
- String major = dataFormatter.formatCellValue(row.getCell(7));//备注
|
|
|
|
|
|
|
+ String major = dataFormatter.formatCellValue(row.getCell(8));//备注
|
|
|
if (!major.equals("所属专业")) {
|
|
if (!major.equals("所属专业")) {
|
|
|
return CommonResult.fail("导入数据第七列为所属专业");
|
|
return CommonResult.fail("导入数据第七列为所属专业");
|
|
|
}
|
|
}
|
|
|
- String classstr = dataFormatter.formatCellValue(row.getCell(8));//备注
|
|
|
|
|
|
|
+ String classstr = dataFormatter.formatCellValue(row.getCell(9));//备注
|
|
|
if (!classstr.equals("所属班级")) {
|
|
if (!classstr.equals("所属班级")) {
|
|
|
return CommonResult.fail("导入数据第八列为所属班级");
|
|
return CommonResult.fail("导入数据第八列为所属班级");
|
|
|
}
|
|
}
|
|
|
- String instructor = dataFormatter.formatCellValue(row.getCell(9));//备注
|
|
|
|
|
|
|
+ String instructor = dataFormatter.formatCellValue(row.getCell(10));//备注
|
|
|
if (!instructor.equals("辅导员")) {
|
|
if (!instructor.equals("辅导员")) {
|
|
|
return CommonResult.fail("导入数据第九列为辅导员");
|
|
return CommonResult.fail("导入数据第九列为辅导员");
|
|
|
}
|
|
}
|
|
|
- String isCheck = dataFormatter.formatCellValue(row.getCell(10));//备注
|
|
|
|
|
|
|
+ String isCheck = dataFormatter.formatCellValue(row.getCell(11));//备注
|
|
|
if (!isCheck.equals("是否入住")) {
|
|
if (!isCheck.equals("是否入住")) {
|
|
|
return CommonResult.fail("导入数据第十列为是否入住");
|
|
return CommonResult.fail("导入数据第十列为是否入住");
|
|
|
}
|
|
}
|
|
|
- String admissNum = dataFormatter.formatCellValue(row.getCell(11));//备注
|
|
|
|
|
|
|
+ String admissNum = dataFormatter.formatCellValue(row.getCell(12));//备注
|
|
|
if (!admissNum.equals("录取号")) {
|
|
if (!admissNum.equals("录取号")) {
|
|
|
return CommonResult.fail("导入数据第十一列为录取号");
|
|
return CommonResult.fail("导入数据第十一列为录取号");
|
|
|
}
|
|
}
|
|
|
- String name = dataFormatter.formatCellValue(row.getCell(12));//备注
|
|
|
|
|
|
|
+ String name = dataFormatter.formatCellValue(row.getCell(13));//备注
|
|
|
if (!name.equals("姓名")) {
|
|
if (!name.equals("姓名")) {
|
|
|
return CommonResult.fail("导入数据第十二列为姓名");
|
|
return CommonResult.fail("导入数据第十二列为姓名");
|
|
|
}
|
|
}
|
|
|
- String remark = dataFormatter.formatCellValue(row.getCell(13));//备注
|
|
|
|
|
|
|
+ String remark = dataFormatter.formatCellValue(row.getCell(14));//备注
|
|
|
if (!remark.equals("备注")) {
|
|
if (!remark.equals("备注")) {
|
|
|
return CommonResult.fail("导入数据第十三列为备注");
|
|
return CommonResult.fail("导入数据第十三列为备注");
|
|
|
}
|
|
}
|
|
|
- String retentionState = dataFormatter.formatCellValue(row.getCell(14));//是否保留
|
|
|
|
|
|
|
+ String retentionState = dataFormatter.formatCellValue(row.getCell(15));//是否保留
|
|
|
if (!retentionState.equals("是否保留")) {
|
|
if (!retentionState.equals("是否保留")) {
|
|
|
return CommonResult.fail("导入数据第十四列为是否保留");
|
|
return CommonResult.fail("导入数据第十四列为是否保留");
|
|
|
}
|
|
}
|
|
@@ -515,15 +527,16 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String sex = dataFormatter.formatCellValue(row.getCell(5));//楼栋层数
|
|
String sex = dataFormatter.formatCellValue(row.getCell(5));//楼栋层数
|
|
|
- String college = dataFormatter.formatCellValue(row.getCell(6));//起始层数
|
|
|
|
|
- String major = dataFormatter.formatCellValue(row.getCell(7));//备注
|
|
|
|
|
- String classstr = dataFormatter.formatCellValue(row.getCell(8));//备注
|
|
|
|
|
- String instructor = dataFormatter.formatCellValue(row.getCell(9));//辅导员
|
|
|
|
|
- String isCheck = dataFormatter.formatCellValue(row.getCell(10));//备注
|
|
|
|
|
- String admissNum = dataFormatter.formatCellValue(row.getCell(11));//备注
|
|
|
|
|
- String name = dataFormatter.formatCellValue(row.getCell(12));//备注
|
|
|
|
|
- String remark = dataFormatter.formatCellValue(row.getCell(13));//备注
|
|
|
|
|
- String retentionState = dataFormatter.formatCellValue(row.getCell(14));//是否保留
|
|
|
|
|
|
|
+ String grade = dataFormatter.formatCellValue(row.getCell(6));//起始层数
|
|
|
|
|
+ String college = dataFormatter.formatCellValue(row.getCell(7));//起始层数
|
|
|
|
|
+ String major = dataFormatter.formatCellValue(row.getCell(8));//备注
|
|
|
|
|
+ String classstr = dataFormatter.formatCellValue(row.getCell(9));//备注
|
|
|
|
|
+ String instructor = dataFormatter.formatCellValue(row.getCell(10));//辅导员
|
|
|
|
|
+ String isCheck = dataFormatter.formatCellValue(row.getCell(11));//备注
|
|
|
|
|
+ String admissNum = dataFormatter.formatCellValue(row.getCell(12));//备注
|
|
|
|
|
+ String name = dataFormatter.formatCellValue(row.getCell(13));//备注
|
|
|
|
|
+ String remark = dataFormatter.formatCellValue(row.getCell(14));//备注
|
|
|
|
|
+ String retentionState = dataFormatter.formatCellValue(row.getCell(15));//是否保留
|
|
|
|
|
|
|
|
bedData.setSchool(school);
|
|
bedData.setSchool(school);
|
|
|
|
|
|
|
@@ -574,6 +587,7 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
bedData.setRemark(remark);
|
|
bedData.setRemark(remark);
|
|
|
bedData.setRetentionState(Integer.valueOf(retentionState));
|
|
bedData.setRetentionState(Integer.valueOf(retentionState));
|
|
|
bedData.setInstructor(instructor);
|
|
bedData.setInstructor(instructor);
|
|
|
|
|
+ bedData.setGrade(Integer.valueOf(grade));
|
|
|
result.add(bedData);
|
|
result.add(bedData);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -588,7 +602,7 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public CommonResult downloadBedExcel() {
|
|
public CommonResult downloadBedExcel() {
|
|
|
- return CommonResult.ok("200", "操作成功", "https://chtech.ncjti.edu.cn/alumnus/home/image/床位信息管理.xlsx");
|
|
|
|
|
|
|
+ return CommonResult.ok("200", "操作成功", "https://chtech.ncjti.edu.cn/welcome/homeimage/床位信息管理.xlsx");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -606,15 +620,16 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
headerRow.createCell(3).setCellValue("寝室号");
|
|
headerRow.createCell(3).setCellValue("寝室号");
|
|
|
headerRow.createCell(4).setCellValue("床位号");
|
|
headerRow.createCell(4).setCellValue("床位号");
|
|
|
headerRow.createCell(5).setCellValue("床位性别");
|
|
headerRow.createCell(5).setCellValue("床位性别");
|
|
|
- headerRow.createCell(6).setCellValue("所属学院");
|
|
|
|
|
- headerRow.createCell(7).setCellValue("所属专业");
|
|
|
|
|
- headerRow.createCell(8).setCellValue("所属班级");
|
|
|
|
|
- headerRow.createCell(9).setCellValue("辅导员");
|
|
|
|
|
- headerRow.createCell(10).setCellValue("是否入住");
|
|
|
|
|
- headerRow.createCell(11).setCellValue("录取号");
|
|
|
|
|
- headerRow.createCell(12).setCellValue("姓名");
|
|
|
|
|
- headerRow.createCell(13).setCellValue("备注");
|
|
|
|
|
- headerRow.createCell(14).setCellValue("是否保留");
|
|
|
|
|
|
|
+ headerRow.createCell(6).setCellValue("所属年级");
|
|
|
|
|
+ headerRow.createCell(7).setCellValue("所属学院");
|
|
|
|
|
+ headerRow.createCell(8).setCellValue("所属专业");
|
|
|
|
|
+ headerRow.createCell(9).setCellValue("所属班级");
|
|
|
|
|
+ headerRow.createCell(10).setCellValue("辅导员");
|
|
|
|
|
+ headerRow.createCell(11).setCellValue("是否入住");
|
|
|
|
|
+ headerRow.createCell(12).setCellValue("录取号");
|
|
|
|
|
+ headerRow.createCell(13).setCellValue("姓名");
|
|
|
|
|
+ headerRow.createCell(14).setCellValue("备注");
|
|
|
|
|
+ headerRow.createCell(15).setCellValue("是否保留");
|
|
|
for (int i = 0; i < result.size(); i++) {
|
|
for (int i = 0; i < result.size(); i++) {
|
|
|
WelcomeBed bed = result.get(i);
|
|
WelcomeBed bed = result.get(i);
|
|
|
Row dataRow = sheet.createRow(i + 1);
|
|
Row dataRow = sheet.createRow(i + 1);
|
|
@@ -624,15 +639,16 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
dataRow.createCell(3).setCellValue(bed.getDormitory());
|
|
dataRow.createCell(3).setCellValue(bed.getDormitory());
|
|
|
dataRow.createCell(4).setCellValue(bed.getNumber());
|
|
dataRow.createCell(4).setCellValue(bed.getNumber());
|
|
|
dataRow.createCell(5).setCellValue(bed.getSex());
|
|
dataRow.createCell(5).setCellValue(bed.getSex());
|
|
|
- dataRow.createCell(6).setCellValue(bed.getCollege());
|
|
|
|
|
- dataRow.createCell(7).setCellValue(bed.getMajor());
|
|
|
|
|
- dataRow.createCell(8).setCellValue(bed.getClassstr());
|
|
|
|
|
- dataRow.createCell(9).setCellValue(bed.getInstructor());
|
|
|
|
|
- dataRow.createCell(10).setCellValue(bed.getIsCheck());
|
|
|
|
|
- dataRow.createCell(11).setCellValue(bed.getCardNum());
|
|
|
|
|
- dataRow.createCell(12).setCellValue(bed.getName());
|
|
|
|
|
- dataRow.createCell(13).setCellValue(bed.getRemark());
|
|
|
|
|
- dataRow.createCell(14).setCellValue(bed.getRetentionState());
|
|
|
|
|
|
|
+ dataRow.createCell(6).setCellValue(bed.getGrade());
|
|
|
|
|
+ dataRow.createCell(7).setCellValue(bed.getCollege());
|
|
|
|
|
+ dataRow.createCell(8).setCellValue(bed.getMajor());
|
|
|
|
|
+ dataRow.createCell(9).setCellValue(bed.getClassstr());
|
|
|
|
|
+ dataRow.createCell(10).setCellValue(bed.getInstructor());
|
|
|
|
|
+ dataRow.createCell(11).setCellValue(bed.getIsCheck());
|
|
|
|
|
+ dataRow.createCell(12).setCellValue(bed.getCardNum());
|
|
|
|
|
+ dataRow.createCell(13).setCellValue(bed.getName());
|
|
|
|
|
+ dataRow.createCell(14).setCellValue(bed.getRemark());
|
|
|
|
|
+ dataRow.createCell(15).setCellValue(bed.getRetentionState());
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
// 将工作簿写入文件
|
|
// 将工作簿写入文件
|
|
@@ -654,6 +670,9 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
if (wb == null) {
|
|
if (wb == null) {
|
|
|
return CommonResult.fail("床位已失效,选择失败!");
|
|
return CommonResult.fail("床位已失效,选择失败!");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (wb.getIsCheck()==1) {
|
|
|
|
|
+ return CommonResult.fail("该床位已被其他人入住");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (StringUtils.hasText(wb.getStudentCard()) && !wb.getStudentCard().equals(welcomeBed.getStudentCard())) {
|
|
if (StringUtils.hasText(wb.getStudentCard()) && !wb.getStudentCard().equals(welcomeBed.getStudentCard())) {
|
|
|
return CommonResult.fail("该床位已被其他人入住,选择失败!");
|
|
return CommonResult.fail("该床位已被其他人入住,选择失败!");
|
|
@@ -743,12 +762,18 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
if (ObjectUtils.isEmpty(bed)) {
|
|
if (ObjectUtils.isEmpty(bed)) {
|
|
|
return CommonResult.fail("不存在该床铺");
|
|
return CommonResult.fail("不存在该床铺");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (bed.getIsCheck()==1) {
|
|
|
|
|
+ return CommonResult.fail("该床位已被其他人入住");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
bed.setIsCheck(1);
|
|
bed.setIsCheck(1);
|
|
|
bed.setStudentCard(welcomeStudent.getCardId());
|
|
bed.setStudentCard(welcomeStudent.getCardId());
|
|
|
bed.setCardNum(welcomeStudent.getAdmissNum());
|
|
bed.setCardNum(welcomeStudent.getAdmissNum());
|
|
|
bed.setClassstrId(welcomeStudent.getClassstrId());
|
|
bed.setClassstrId(welcomeStudent.getClassstrId());
|
|
|
bed.setClassstr(welcomeStudent.getClassstr());
|
|
bed.setClassstr(welcomeStudent.getClassstr());
|
|
|
bed.setName(welcomeStudent.getName());
|
|
bed.setName(welcomeStudent.getName());
|
|
|
|
|
+ bed.setMajorId(welcomeStudent.getMajorId());
|
|
|
|
|
+ bed.setMajor(welcomeStudent.getMajor());
|
|
|
welcomeBedService.updateWelcomeBed(bed);
|
|
welcomeBedService.updateWelcomeBed(bed);
|
|
|
|
|
|
|
|
// 修改寝室信息
|
|
// 修改寝室信息
|
|
@@ -819,6 +844,9 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
changeBed.setClassstrId(sourceBed.getClassstrId());
|
|
changeBed.setClassstrId(sourceBed.getClassstrId());
|
|
|
changeBed.setClassstr(sourceBed.getClassstr());
|
|
changeBed.setClassstr(sourceBed.getClassstr());
|
|
|
changeBed.setName(sourceBed.getName());
|
|
changeBed.setName(sourceBed.getName());
|
|
|
|
|
+ changeBed.setMajorId(sourceBed.getMajorId());
|
|
|
|
|
+ changeBed.setMajor(sourceBed.getMajor());
|
|
|
|
|
+ changeBed.setInstructor(sourceBed.getInstructor());
|
|
|
welcomeBeds.add(changeBed);
|
|
welcomeBeds.add(changeBed);
|
|
|
|
|
|
|
|
sourceBed.setIsCheck(0);
|
|
sourceBed.setIsCheck(0);
|
|
@@ -827,6 +855,9 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
sourceBed.setClassstrId(null);
|
|
sourceBed.setClassstrId(null);
|
|
|
sourceBed.setClassstr(null);
|
|
sourceBed.setClassstr(null);
|
|
|
sourceBed.setName(null);
|
|
sourceBed.setName(null);
|
|
|
|
|
+ sourceBed.setMajorId(null);
|
|
|
|
|
+ sourceBed.setMajor(null);
|
|
|
|
|
+ sourceBed.setInstructor(null);
|
|
|
welcomeBeds.add(sourceBed);
|
|
welcomeBeds.add(sourceBed);
|
|
|
|
|
|
|
|
// 修改寝室信息
|
|
// 修改寝室信息
|
|
@@ -843,7 +874,7 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
}
|
|
}
|
|
|
welcomeDormitoryService.updateById(welcomeDormitoryC);
|
|
welcomeDormitoryService.updateById(welcomeDormitoryC);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 修改寝室信息
|
|
// 修改寝室信息
|
|
|
WelcomeDormitory welcomeDormitory = welcomeDormitoryService.getById(sourceBed.getDormitoryId());
|
|
WelcomeDormitory welcomeDormitory = welcomeDormitoryService.getById(sourceBed.getDormitoryId());
|
|
|
if (ObjectUtils.isNotEmpty(welcomeDormitory)) {
|
|
if (ObjectUtils.isNotEmpty(welcomeDormitory)) {
|
|
@@ -866,8 +897,116 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public CommonResult replaceBed(Integer bedId) {
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ public CommonResult checkInBedGroup(Integer schoolId, Integer buildId, Integer dormitoryId) {
|
|
|
|
|
+ // 获取已入住的床位
|
|
|
|
|
+ List<WelcomeBed> beds = welcomeBedService.checkInBedGroup(schoolId, buildId, dormitoryId);
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(beds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult replaceBed(ReplaceBedVo replaceBedVo) {
|
|
|
|
|
+ Integer sourceBedId = replaceBedVo.getSourceBedId();
|
|
|
|
|
+ Integer changeBedId = replaceBedVo.getChangeBedId();
|
|
|
|
|
+ WelcomeBed sourceBed = welcomeBedService.getBedById(sourceBedId);
|
|
|
|
|
+ WelcomeBed changeBed = welcomeBedService.getBedById(changeBedId);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(sourceBed) || ObjectUtils.isEmpty(changeBed)) {
|
|
|
|
|
+ return CommonResult.fail("床位不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+// 源数据
|
|
|
|
|
+ String studentCard = sourceBed.getStudentCard();
|
|
|
|
|
+ String cardNum = sourceBed.getCardNum();
|
|
|
|
|
+ Integer classstrId = sourceBed.getClassstrId();
|
|
|
|
|
+ String classstr = sourceBed.getClassstr();
|
|
|
|
|
+ String name = sourceBed.getName();
|
|
|
|
|
+ Integer majorId = sourceBed.getMajorId();
|
|
|
|
|
+ String major = sourceBed.getMajor();
|
|
|
|
|
+ String instructor = sourceBed.getInstructor();
|
|
|
|
|
+
|
|
|
|
|
+// 交换床位数据
|
|
|
|
|
+ String studentCard2 = changeBed.getStudentCard();
|
|
|
|
|
+ String cardNum2 = changeBed.getCardNum();
|
|
|
|
|
+ Integer classstrId2 = changeBed.getClassstrId();
|
|
|
|
|
+ String classstr2 = changeBed.getClassstr();
|
|
|
|
|
+ String name2 = changeBed.getName();
|
|
|
|
|
+ Integer majorId2 = changeBed.getMajorId();
|
|
|
|
|
+ String major2 = changeBed.getMajor();
|
|
|
|
|
+ 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);
|
|
|
|
|
+
|
|
|
|
|
+ ArrayList<WelcomeBed> welcomeBeds = new ArrayList<>();
|
|
|
|
|
+ welcomeBeds.add(sourceBed);
|
|
|
|
|
+ welcomeBeds.add(changeBed);
|
|
|
|
|
+
|
|
|
|
|
+ welcomeBedService.updateBatchById(welcomeBeds);
|
|
|
|
|
+ return CommonResult.ok();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult studentAccommodationPage(int currentPage, int pageCount, Integer schoolId, Integer buildId, Integer dormitoryId, Integer collegeId, Integer majorId, Integer classstrId, String name) {
|
|
|
|
|
+ PageUtils<WelcomeBed> result = welcomeBedService.studentAccommodationPage(currentPage, pageCount, schoolId, buildId, dormitoryId,collegeId, majorId, classstrId,name);
|
|
|
|
|
+ return CommonResult.ok(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void studentAccommodationListExport(HttpServletResponse response, Integer schoolId, Integer buildId, Integer dormitoryId, Integer collegeId, Integer majorId, Integer classstrId, String name) {
|
|
|
|
|
+ List<WelcomeBed> result=welcomeBedService.studentAccommodationList( schoolId, buildId, dormitoryId,collegeId, majorId, classstrId,name);
|
|
|
|
|
+
|
|
|
|
|
+ //导出
|
|
|
|
|
+ Workbook workbook = new XSSFWorkbook();
|
|
|
|
|
+ Sheet sheet = workbook.createSheet("床位信息");
|
|
|
|
|
+
|
|
|
|
|
+ Row headerRow = sheet.createRow(0);
|
|
|
|
|
+ headerRow.createCell(0).setCellValue("序号");
|
|
|
|
|
+ headerRow.createCell(1).setCellValue("录取号");
|
|
|
|
|
+ headerRow.createCell(2).setCellValue("学生姓名");
|
|
|
|
|
+ headerRow.createCell(3).setCellValue("校区名称");
|
|
|
|
|
+ headerRow.createCell(4).setCellValue("学院");
|
|
|
|
|
+ headerRow.createCell(5).setCellValue("专业");
|
|
|
|
|
+ headerRow.createCell(6).setCellValue("班级");
|
|
|
|
|
+ headerRow.createCell(7).setCellValue("性别");
|
|
|
|
|
+ headerRow.createCell(8).setCellValue("楼栋名称");
|
|
|
|
|
+ headerRow.createCell(9).setCellValue("寝室号");
|
|
|
|
|
+ headerRow.createCell(10).setCellValue("床位号");
|
|
|
|
|
+ headerRow.createCell(11).setCellValue("辅导员");
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < result.size(); i++) {
|
|
|
|
|
+ WelcomeBed bed = result.get(i);
|
|
|
|
|
+ Row dataRow = sheet.createRow(i + 1);
|
|
|
|
|
+ dataRow.createCell(0).setCellValue(i + 1);
|
|
|
|
|
+ dataRow.createCell(1).setCellValue(bed.getCardNum());
|
|
|
|
|
+ dataRow.createCell(2).setCellValue(bed.getName());
|
|
|
|
|
+ dataRow.createCell(3).setCellValue(bed.getSchool());
|
|
|
|
|
+ dataRow.createCell(4).setCellValue(bed.getCollege());
|
|
|
|
|
+ dataRow.createCell(5).setCellValue(bed.getMajor());
|
|
|
|
|
+ dataRow.createCell(6).setCellValue(bed.getClassstr());
|
|
|
|
|
+ dataRow.createCell(7).setCellValue(bed.getSex());
|
|
|
|
|
+ dataRow.createCell(8).setCellValue(bed.getBuild());
|
|
|
|
|
+ dataRow.createCell(9).setCellValue(bed.getDormitory());
|
|
|
|
|
+ dataRow.createCell(10).setCellValue(bed.getNumber());
|
|
|
|
|
+ dataRow.createCell(11).setCellValue(bed.getInstructor());
|
|
|
|
|
+ }
|
|
|
|
|
+ // 将工作簿写入文件
|
|
|
|
|
+ ExcelUtils.excelDownload(workbook, "学生住宿信息.xlsx", response);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|