Sfoglia il codice sorgente

更新宿舍,床铺导入导出

liu 1 anno fa
parent
commit
b76c3e0e29

+ 28 - 14
src/main/java/com/template/controller/WelcomeBedController.java

@@ -295,24 +295,33 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
                         }
                         String classstr = dataFormatter.formatCellValue(row.getCell(8));//备注
                         if (!classstr.equals("所属班级")) {
-                            return CommonResult.fail("导入数据第列为所属班级");
+                            return CommonResult.fail("导入数据第列为所属班级");
                         }
-                        String isCheck = dataFormatter.formatCellValue(row.getCell(9));//备注
+                        String instructor = dataFormatter.formatCellValue(row.getCell(9));//备注
+                        if (!instructor.equals("辅导员")) {
+                            return CommonResult.fail("导入数据第九列为辅导员");
+                        }
+                        String isCheck = dataFormatter.formatCellValue(row.getCell(10));//备注
                         if (!isCheck.equals("是否入住")) {
-                            return CommonResult.fail("导入数据第七列为是否入住");
+                            return CommonResult.fail("导入数据第列为是否入住");
                         }
-                        String admissNum = dataFormatter.formatCellValue(row.getCell(10));//备注
+                        String admissNum = dataFormatter.formatCellValue(row.getCell(11));//备注
                         if (!admissNum.equals("录取号")) {
-                            return CommonResult.fail("导入数据第列为录取号");
+                            return CommonResult.fail("导入数据第十一列为录取号");
                         }
-                        String name = dataFormatter.formatCellValue(row.getCell(11));//备注
+                        String name = dataFormatter.formatCellValue(row.getCell(12));//备注
                         if (!name.equals("姓名")) {
-                            return CommonResult.fail("导入数据第列为姓名");
+                            return CommonResult.fail("导入数据第十二列为姓名");
                         }
-                        String remark = dataFormatter.formatCellValue(row.getCell(12));//备注
+                        String remark = dataFormatter.formatCellValue(row.getCell(13));//备注
                         if (!remark.equals("备注")) {
-                            return CommonResult.fail("导入数据第七列为备注");
+                            return CommonResult.fail("导入数据第十三列为备注");
+                        }
+                        String retentionState = dataFormatter.formatCellValue(row.getCell(14));//是否保留
+                        if (!retentionState.equals("是否保留")) {
+                            return CommonResult.fail("导入数据第十四列为是否保留");
                         }
+
                     } else {
                         WelcomeBed bedData = new WelcomeBed();
 
@@ -330,10 +339,13 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
                         String college = dataFormatter.formatCellValue(row.getCell(6));//起始层数
                         String major = dataFormatter.formatCellValue(row.getCell(7));//备注
                         String classstr = dataFormatter.formatCellValue(row.getCell(8));//备注
-                        String isCheck = dataFormatter.formatCellValue(row.getCell(9));//备注
-                        String admissNum = dataFormatter.formatCellValue(row.getCell(10));//备注
-                        String name = dataFormatter.formatCellValue(row.getCell(11));//备注
-                        String remark = dataFormatter.formatCellValue(row.getCell(12));//备注
+                        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));//是否保留
+
 
                         bedData.setSchool(school);
 
@@ -382,6 +394,8 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
                         bedData.setCardNum(admissNum);
                         bedData.setName(name);
                         bedData.setRemark(remark);
+                        bedData.setRetentionState(Integer.valueOf(retentionState));
+                        bedData.setInstructor(instructor);
                         result.add(bedData);
                     }
                 }
@@ -561,7 +575,7 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
 
     @Override
     public CommonResult downloadBedExcel() {
-        return CommonResult.ok("200", "操作成功", "https://chtech.ncjti.edu.cn/alumnus/homeimage/床位信息管理.xlsx");
+        return CommonResult.ok("200", "操作成功", "https://chtech.ncjti.edu.cn/alumnus/home/image/床位信息管理.xlsx");
     }
 
     @Override

+ 10 - 6
src/main/java/com/template/controller/WelcomeDormitoryController.java

@@ -382,21 +382,24 @@ public class WelcomeDormitoryController implements WelcomeDormitoryControllerAPI
                         }
                         String bedNum = dataFormatter.formatCellValue(row.getCell(7));//床位数
                         if (!bedNum.equals("床位数")) {
-                            return CommonResult.fail("导入数据第列为床位数");
+                            return CommonResult.fail("导入数据第列为床位数");
                         }
                         String freeBedNumber = dataFormatter.formatCellValue(row.getCell(8));//空闲床位数
                         if (!freeBedNumber.equals("空闲床位数")) {
-                            return CommonResult.fail("导入数据第列为空闲床位数");
+                            return CommonResult.fail("导入数据第列为空闲床位数");
                         }
                         String status = dataFormatter.formatCellValue(row.getCell(9));//入住情况
                         if (!status.equals("入住情况")) {
-                            return CommonResult.fail("导入数据第列为入住情况");
+                            return CommonResult.fail("导入数据第列为入住情况");
                         }
                         String remark = dataFormatter.formatCellValue(row.getCell(10));//备注
                         if (!remark.equals("备注")) {
-                            return CommonResult.fail("导入数据第七列为备注");
+                            return CommonResult.fail("导入数据第十一列为备注");
+                        }
+                        String retentionState = dataFormatter.formatCellValue(row.getCell(11));//是否保留
+                        if (!retentionState.equals("是否保留")) {
+                            return CommonResult.fail("导入数据第十二列为是否保留");
                         }
-
                     } else {
                         String school = dataFormatter.formatCellValue(row.getCell(1));//校区名称
                         String build = dataFormatter.formatCellValue(row.getCell(2));//楼栋名称
@@ -414,6 +417,7 @@ public class WelcomeDormitoryController implements WelcomeDormitoryControllerAPI
                         String freeBedNumber = dataFormatter.formatCellValue(row.getCell(8));//空闲床位数
                         String status = dataFormatter.formatCellValue(row.getCell(9));//入住情况
                         String remark = dataFormatter.formatCellValue(row.getCell(10));//备注
+                        String retentionState = dataFormatter.formatCellValue(row.getCell(11));//是否保留
 
 
                         wd.setSchool(school);
@@ -441,7 +445,7 @@ public class WelcomeDormitoryController implements WelcomeDormitoryControllerAPI
                         wd.setFreeBedNumber(Integer.valueOf(freeBedNumber));
                         wd.setStatus(Integer.valueOf(status));
                         wd.setRemark(remark);
-
+                        wd.setRetentionState(Integer.valueOf(retentionState));
                         result.add(wd);
                     }
                 }