Bläddra i källkod

更新宿舍导出和楼栋导入模板接口

liu 1 år sedan
förälder
incheckning
0199ca6377

+ 2 - 2
src/main/java/com/template/api/WelcomeDormitoryControllerAPI.java

@@ -31,7 +31,7 @@ public interface WelcomeDormitoryControllerAPI {
 
 
     @GetMapping(value = "/listDormitory")
     @GetMapping(value = "/listDormitory")
     @ApiOperation(value = "查询寝室", notes = "查询寝室", httpMethod = "GET")
     @ApiOperation(value = "查询寝室", notes = "查询寝室", httpMethod = "GET")
-    CommonResult listDormitory(@RequestParam int currentPage, @RequestParam int pageCount,Integer schoolId,Integer buildId,Integer dormitoryId,String sex,Integer status,Integer majorId,Integer collegeId,Integer retentionState);
+    CommonResult listDormitory(@RequestParam int currentPage, @RequestParam int pageCount,Integer schoolId,Integer buildId,Integer dormitoryId,String sex,Integer collegeId,Integer status,Integer retentionState);
 
 
 
 
     @GetMapping(value = "/dormitoryGroup")
     @GetMapping(value = "/dormitoryGroup")
@@ -56,7 +56,7 @@ public interface WelcomeDormitoryControllerAPI {
 
 
     @GetMapping(value = "welcomeDormitoryExport")
     @GetMapping(value = "welcomeDormitoryExport")
     @ApiOperation(value = "导出寝室信息数据", notes = "导出寝室信息数据", httpMethod = "GET")
     @ApiOperation(value = "导出寝室信息数据", notes = "导出寝室信息数据", httpMethod = "GET")
-    void welcomeDormitoryExport(HttpServletResponse response, Integer schoolId,Integer buildId,Integer dormitoryId,String sex,Integer status,Integer majorId,Integer collegeId);
+    void welcomeDormitoryExport(HttpServletResponse response, Integer schoolId,Integer buildId,Integer dormitoryId,String sex,Integer collegeId,Integer status,Integer retentionState);
 
 
     @PostMapping(value = "/batchOperation")
     @PostMapping(value = "/batchOperation")
     @ApiOperation(value = "批量操作", notes = "批量操作", httpMethod = "POST")
     @ApiOperation(value = "批量操作", notes = "批量操作", httpMethod = "POST")

+ 1 - 1
src/main/java/com/template/controller/WelcomeBuildController.java

@@ -343,7 +343,7 @@ public class WelcomeBuildController implements WelcomeBuildControllerAPI {
 
 
     @Override
     @Override
     public CommonResult downloadBuildExcel() {
     public CommonResult downloadBuildExcel() {
-        return CommonResult.ok("200", "操作成功", "https://chtech.ncjti.edu.cn/welcome/homeimage/学生信息管理.xlsx");
+        return CommonResult.ok("200", "操作成功", "https://chtech.ncjti.edu.cn/welcome/homeimage/楼栋信息管理.xlsx");
     }
     }
 
 
     @Override
     @Override

+ 26 - 28
src/main/java/com/template/controller/WelcomeDormitoryController.java

@@ -232,9 +232,9 @@ public class WelcomeDormitoryController implements WelcomeDormitoryControllerAPI
     }
     }
 
 
     @Override
     @Override
-    public CommonResult listDormitory(int currentPage, int pageCount, Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer status, Integer majorId, Integer collegeId,Integer retentionState) {
+    public CommonResult listDormitory(int currentPage, int pageCount, Integer schoolId,Integer buildId,Integer dormitoryId,String sex,Integer collegeId,Integer status,Integer retentionState) {
 
 
-        PageUtils<WelcomeDormitoryVo> pageUtils = welcomeDormitoryService.listDormitory(currentPage, pageCount, schoolId, buildId, dormitoryId, sex, status, majorId, collegeId,retentionState);
+        PageUtils<WelcomeDormitoryVo> pageUtils = welcomeDormitoryService.listDormitoryPage(currentPage, pageCount, schoolId, buildId, dormitoryId, sex, collegeId, status,retentionState);
 
 
         if (pageUtils != null && pageUtils.getList() != null && pageUtils.getList().size() > 0) {
         if (pageUtils != null && pageUtils.getList() != null && pageUtils.getList().size() > 0) {
             List<Integer> dormitoryIds = pageUtils.getList().stream().map(WelcomeDormitoryVo::getId).collect(Collectors.toList());
             List<Integer> dormitoryIds = pageUtils.getList().stream().map(WelcomeDormitoryVo::getId).collect(Collectors.toList());
@@ -604,40 +604,38 @@ public class WelcomeDormitoryController implements WelcomeDormitoryControllerAPI
     }
     }
 
 
     @Override
     @Override
-    public void welcomeDormitoryExport(HttpServletResponse response, Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer status, Integer majorId, Integer collegeId) {
-        List<WelcomeDormitoryVo> result = welcomeDormitoryService.listDormitory(schoolId, buildId, dormitoryId, sex, status, majorId, collegeId);
+    public void welcomeDormitoryExport(HttpServletResponse response, Integer schoolId,Integer buildId,Integer dormitoryId,String sex,Integer collegeId,Integer status,Integer retentionState) {
+        List<WelcomeDormitoryVo> result = welcomeDormitoryService.listDormitory(schoolId, buildId, dormitoryId, sex, collegeId, status, retentionState);
         //导出
         //导出
         Workbook workbook = new XSSFWorkbook();
         Workbook workbook = new XSSFWorkbook();
         Sheet sheet = workbook.createSheet("宿舍信息");
         Sheet sheet = workbook.createSheet("宿舍信息");
 
 
         Row headerRow = sheet.createRow(0);
         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("是否保留");
+        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("是否保留");
         for (int i = 0; i < result.size(); i++) {
         for (int i = 0; i < result.size(); i++) {
             WelcomeDormitoryVo build = result.get(i);
             WelcomeDormitoryVo build = result.get(i);
             Row dataRow = sheet.createRow(i + 1);
             Row dataRow = sheet.createRow(i + 1);
-            dataRow.createCell(0).setCellValue(i + 1);
-            dataRow.createCell(1).setCellValue(build.getSchool());
-            dataRow.createCell(2).setCellValue(build.getBuild());
-            dataRow.createCell(3).setCellValue(build.getDormitory());
-            dataRow.createCell(4).setCellValue(build.getSex());
-            dataRow.createCell(5).setCellValue(build.getGrade());
-            dataRow.createCell(6).setCellValue(build.getCollege());
-            dataRow.createCell(7).setCellValue(build.getBedNumber());
-            dataRow.createCell(8).setCellValue(build.getFreeBedNumber());
-            dataRow.createCell(9).setCellValue(build.getStatus());
-            dataRow.createCell(10).setCellValue(build.getRemark());
-            dataRow.createCell(11).setCellValue(build.getRetentionState());
+            dataRow.createCell(0).setCellValue(build.getSchool());
+            dataRow.createCell(1).setCellValue(build.getBuild());
+            dataRow.createCell(2).setCellValue(build.getDormitory());
+            dataRow.createCell(3).setCellValue(build.getSex());
+            dataRow.createCell(4).setCellValue(build.getGrade());
+            dataRow.createCell(5).setCellValue(build.getCollege());
+            dataRow.createCell(6).setCellValue(build.getBedNumber());
+            dataRow.createCell(7).setCellValue(build.getFreeBedNumber());
+            dataRow.createCell(8).setCellValue(build.getStatus());
+            dataRow.createCell(9).setCellValue(build.getRemark());
+            dataRow.createCell(10).setCellValue(build.getRetentionState());
         }
         }
         // 将工作簿写入文件
         // 将工作簿写入文件
         ExcelUtils.excelDownload(workbook, "寝室信息.xlsx", response);
         ExcelUtils.excelDownload(workbook, "寝室信息.xlsx", response);

+ 6 - 7
src/main/java/com/template/mapper/WelcomeDormitoryMapper.java

@@ -23,15 +23,14 @@ import java.util.List;
 @Repository
 @Repository
 public interface WelcomeDormitoryMapper extends BaseMapper<WelcomeDormitory> {
 public interface WelcomeDormitoryMapper extends BaseMapper<WelcomeDormitory> {
 
 
-    IPage<WelcomeDormitoryVo> listDormitory(Page<WelcomeDormitoryVo> page, @Param("schoolId") Integer schoolId, @Param("buildId") Integer buildId,
-                                            @Param("dormitoryId") Integer dormitoryId, @Param("sex") String sex, @Param("status") Integer status,
-                                            @Param("majorId") Integer majorId, @Param("collegeId") Integer collegeId,@Param("retentionState") Integer retentionState);
-
 
 
     List<WelcomeDormitoryVo> listDormitory( @Param("schoolId") Integer schoolId, @Param("buildId") Integer buildId,
     List<WelcomeDormitoryVo> listDormitory( @Param("schoolId") Integer schoolId, @Param("buildId") Integer buildId,
-                                            @Param("dormitoryId") Integer dormitoryId, @Param("sex") String sex, @Param("status") Integer status,
-                                            @Param("majorId") Integer majorId, @Param("collegeId") Integer collegeId);
-
+                                            @Param("dormitoryId") Integer dormitoryId, @Param("sex") String sex, @Param("collegeId") Integer collegeId,
+                                            @Param("status") Integer status,@Param("retentionState") Integer retentionState);
 
 
     StudentStayVo getTotalCount(@Param("buildId") Integer buildId);
     StudentStayVo getTotalCount(@Param("buildId") Integer buildId);
+
+    IPage<WelcomeDormitoryVo> listDormitoryPage(Page<WelcomeDormitoryVo> page, @Param("schoolId") Integer schoolId, @Param("buildId") Integer buildId,
+                                                @Param("dormitoryId") Integer dormitoryId, @Param("sex") String sex, @Param("collegeId") Integer collegeId,
+                                                @Param("status") Integer status,@Param("retentionState") Integer retentionState);
 }
 }

+ 2 - 2
src/main/java/com/template/model/pojo/WelcomeRole.java

@@ -49,7 +49,7 @@ public class WelcomeRole implements Serializable {
     @ApiModelProperty(value = "寝室管理设置 0.全部, 1.导入,2导出,3.新增,4批量保留,5批量开发,6保留,7开发,8.编辑,9.删除,10查看页面")
     @ApiModelProperty(value = "寝室管理设置 0.全部, 1.导入,2导出,3.新增,4批量保留,5批量开发,6保留,7开发,8.编辑,9.删除,10查看页面")
     private String dormitoryManagementSetting;
     private String dormitoryManagementSetting;
 
 
-    @ApiModelProperty(value = "床位管理设置 0.全部, 1.导入,2导出,3.新增,4批量保留,5批量开放,6保留,7开放,8.入住,9.退宿,10换床,11床位对调,12删除,13查看页面,14.编辑所属专业,15.编辑所属班级,16.编辑辅导员")
+    @ApiModelProperty(value = "床位管理设置 0.全部, 1.导入,2导出,3.新增,4批量保留,5批量开放,6保留,7开放,8.入住,9.退宿,10换床,11床位对调,12删除,13查看页面,14.编辑,15.编辑所属专业,16.编辑所属班级,17.编辑辅导员")
     private String bedManagementSetting;
     private String bedManagementSetting;
 
 
     @ApiModelProperty(value = "学生住宿设置 0.全部, 1.导出,2.查看页面")
     @ApiModelProperty(value = "学生住宿设置 0.全部, 1.导出,2.查看页面")
@@ -67,7 +67,7 @@ public class WelcomeRole implements Serializable {
     @ApiModelProperty(value = "用户管理设置  0.全部, 1.新增,2编辑,3删除,4查看页面")
     @ApiModelProperty(value = "用户管理设置  0.全部, 1.新增,2编辑,3删除,4查看页面")
     private String accountManagementSetting;
     private String accountManagementSetting;
 
 
-    @ApiModelProperty(value = "设置管理设置 0.全部, 1.缴费设置,2.车位数设置,3.联系方式设置,4.文本设置")
+    @ApiModelProperty(value = "设置管理设置 0.全部, 1.修改,2查看页面")
     private String settingManagementSetting;
     private String settingManagementSetting;
 
 
     @ApiModelProperty(value = "创建时间")
     @ApiModelProperty(value = "创建时间")

+ 3 - 4
src/main/java/com/template/services/WelcomeDormitoryService.java

@@ -28,14 +28,13 @@ public interface WelcomeDormitoryService extends IService<WelcomeDormitory> {
 
 
     WelcomeDormitory getManageById(String id);
     WelcomeDormitory getManageById(String id);
 
 
-
-    PageUtils<WelcomeDormitoryVo> listDormitory(int currentPage, int pageCount, Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer status, Integer majorId, Integer collegeId,Integer retentionState);
-
-    List<WelcomeDormitoryVo> listDormitory(Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer status, Integer majorId, Integer collegeId);
+    List<WelcomeDormitoryVo> listDormitory( Integer schoolId,Integer buildId,Integer dormitoryId,String sex,Integer collegeId,Integer status,Integer retentionState);
 
 
     List<WelcomeDormitory> dormitoryGroup(Integer schoolId, Integer buildId);
     List<WelcomeDormitory> dormitoryGroup(Integer schoolId, Integer buildId);
 
 
     StudentStayVo getTotalCount(Integer buildId);
     StudentStayVo getTotalCount(Integer buildId);
 
 
     List<WelcomeDormitory> collegeDormitoryCollegeGroup(Integer schoolId, Integer buildId, Integer collegeId);
     List<WelcomeDormitory> collegeDormitoryCollegeGroup(Integer schoolId, Integer buildId, Integer collegeId);
+
+    PageUtils<WelcomeDormitoryVo> listDormitoryPage(int currentPage, int pageCount, Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer collegeId, Integer status, Integer retentionState);
 }
 }

+ 9 - 9
src/main/java/com/template/services/impl/WelcomeDormitoryServiceImpl.java

@@ -68,16 +68,9 @@ public class WelcomeDormitoryServiceImpl extends ServiceImpl<WelcomeDormitoryMap
 
 
 
 
     @Override
     @Override
-    public PageUtils<WelcomeDormitoryVo> listDormitory(int currentPage, int pageCount, Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer status, Integer majorId, Integer collegeId,Integer retentionState) {
-        Page<WelcomeDormitoryVo> page = new Page<>(currentPage, pageCount);
-        IPage<WelcomeDormitoryVo> result = welcomeDormitoryMapper.listDormitory(page,schoolId,buildId,dormitoryId,sex,status,majorId,collegeId,retentionState);
-        return new PageUtils<>(result);
-    }
-
-    @Override
-    public List<WelcomeDormitoryVo> listDormitory(Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer status, Integer majorId, Integer collegeId) {
+    public List<WelcomeDormitoryVo> listDormitory( Integer schoolId,Integer buildId,Integer dormitoryId,String sex,Integer collegeId,Integer status,Integer retentionState) {
 
 
-        List<WelcomeDormitoryVo> result = welcomeDormitoryMapper.listDormitory(schoolId,buildId,dormitoryId,sex,status,majorId,collegeId);
+        List<WelcomeDormitoryVo> result = welcomeDormitoryMapper.listDormitory(schoolId,buildId,dormitoryId,sex,collegeId,status,retentionState);
         return result;
         return result;
     }
     }
 
 
@@ -106,4 +99,11 @@ public class WelcomeDormitoryServiceImpl extends ServiceImpl<WelcomeDormitoryMap
         List<WelcomeDormitory> welcomeDormitories = welcomeDormitoryMapper.selectList(wrapper);
         List<WelcomeDormitory> welcomeDormitories = welcomeDormitoryMapper.selectList(wrapper);
         return welcomeDormitories;
         return welcomeDormitories;
     }
     }
+
+    @Override
+    public PageUtils<WelcomeDormitoryVo> listDormitoryPage(int currentPage, int pageCount, Integer schoolId, Integer buildId, Integer dormitoryId, String sex, Integer collegeId, Integer status, Integer retentionState) {
+        Page<WelcomeDormitoryVo> page = new Page<>(currentPage, pageCount);
+        IPage<WelcomeDormitoryVo> result = welcomeDormitoryMapper.listDormitoryPage(page,schoolId,buildId,dormitoryId,sex,collegeId,status,retentionState);
+        return new PageUtils<>(result);
+    }
 }
 }

+ 2 - 0
src/main/java/com/template/services/impl/WelcomeVisitorServiceImpl.java

@@ -255,6 +255,8 @@ public class WelcomeVisitorServiceImpl extends ServiceImpl<WelcomeVisitorMapper,
 
 
     @Override
     @Override
     public Integer countTotal(LocalDateTime start, LocalDateTime end,Integer schoolId) {
     public Integer countTotal(LocalDateTime start, LocalDateTime end,Integer schoolId) {
+
+
         LambdaQueryWrapper<WelcomeVisitor> queryWrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<WelcomeVisitor> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.le(WelcomeVisitor::getStartTime, start)
         queryWrapper.le(WelcomeVisitor::getStartTime, start)
                         .ge(WelcomeVisitor::getEndTime,end)
                         .ge(WelcomeVisitor::getEndTime,end)

+ 50 - 6
src/main/resources/mapper/template/WelcomeDormitoryMapper.xml

@@ -38,15 +38,12 @@
         <if test="sex != null and sex != ''">
         <if test="sex != null and sex != ''">
             and wd.sex = #{sex}
             and wd.sex = #{sex}
         </if>
         </if>
-        <if test="status != null and status != ''">
-            and wd.status = #{status}
-        </if>
-        <if test="majorId != null and majorId != ''">
-            and wd.major_id = #{majorId}
-        </if>
         <if test="collegeId != null and collegeId != ''">
         <if test="collegeId != null and collegeId != ''">
             and wd.college_id = #{collegeId}
             and wd.college_id = #{collegeId}
         </if>
         </if>
+        <if test="status != null and status != ''">
+            and wd.status = #{status}
+        </if>
         <if test="retentionState != null and retentionState != ''">
         <if test="retentionState != null and retentionState != ''">
             and wd.retention_state = #{retentionState}
             and wd.retention_state = #{retentionState}
         </if>
         </if>
@@ -66,4 +63,51 @@
         WHERE wd.deleted=0
         WHERE wd.deleted=0
           AND wd.build_id=#{buildId}
           AND wd.build_id=#{buildId}
     </select>
     </select>
+    <select id="listDormitoryPage" resultType="com.template.model.vo.WelcomeDormitoryVo">
+        SELECT
+        wd.id,
+        wd.school_id as schoolId,
+        ws.school,
+        wd.build_id as buildId,
+        wb.build,
+        wd.dormitory,
+        wd.sex,
+        wd.college_id as collegeId,
+        wo.name as college,
+        wd.grade as grade,
+        wd.bed_number as bedNumber,
+        wd.remark,
+        wd.status,
+        wd.free_bed_number as freeBedNumber,
+        wd.retention_state as retentionState
+        FROM
+        `welcome_dormitory` wd
+        LEFT JOIN welcome_school ws ON wd.school_id = ws.id and ws.deleted = 0
+        LEFT JOIN welcome_build wb ON wd.build_id = wb.id and wb.deleted = 0
+        LEFT JOIN welcome_org wo ON wd.college_id = wo.id and wo.deleted = 0
+        WHERE
+        wd.deleted =0
+        <if test="schoolId != null and schoolId != ''">
+            and wd.school_id = #{schoolId}
+        </if>
+        <if test="buildId != null and buildId != ''">
+            and wd.build_id = #{buildId}
+        </if>
+        <if test="dormitoryId != null and dormitoryId != ''">
+            and wd.id = #{dormitoryId}
+        </if>
+        <if test="sex != null and sex != ''">
+            and wd.sex = #{sex}
+        </if>
+        <if test="collegeId != null and collegeId != ''">
+            and wd.college_id = #{collegeId}
+        </if>
+        <if test="status != null and status != ''">
+            and wd.status = #{status}
+        </if>
+        <if test="retentionState != null and retentionState != ''">
+            and wd.retention_state = #{retentionState}
+        </if>
+        order by wd.create_time desc
+    </select>
 </mapper>
 </mapper>