提交宿管代码
This commit is contained in:
1 parent
49899ca537
commit
225a268e32
80 files changed
+6931
-15
No files matched your search
@@ -0,0 +1,3 @@
|
||||
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
|
||||
temp/
|
||||
test/
|
||||
@@ -1,2 +0,0 @@
|
||||
# 学工管理模块 - 控制器层
|
||||
# 此目录用于存放REST API控制器类
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgDormAreaVo;
|
||||
import org.dromara.xg.domain.bo.XgDormAreaBo;
|
||||
import org.dromara.xg.service.IXgDormAreaService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 宿舍区信息
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ssqxx/dormArea")
|
||||
public class XgDormAreaController extends BaseController {
|
||||
|
||||
private final IXgDormAreaService xgDormAreaService;
|
||||
|
||||
/**
|
||||
* 查询宿舍区信息列表
|
||||
*/
|
||||
@SaCheckPermission("ssqxx:dormArea:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgDormAreaVo> list(XgDormAreaBo bo, PageQuery pageQuery) {
|
||||
return xgDormAreaService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出宿舍区信息列表
|
||||
*/
|
||||
@SaCheckPermission("ssqxx:dormArea:export")
|
||||
@Log(title = "宿舍区信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgDormAreaBo bo, HttpServletResponse response) {
|
||||
List<XgDormAreaVo> list = xgDormAreaService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "宿舍区信息", XgDormAreaVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取宿舍区信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ssqxx:dormArea:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgDormAreaVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgDormAreaService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增宿舍区信息
|
||||
*/
|
||||
@SaCheckPermission("ssqxx:dormArea:add")
|
||||
@Log(title = "宿舍区信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgDormAreaBo bo) {
|
||||
return toAjax(xgDormAreaService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍区信息
|
||||
*/
|
||||
@SaCheckPermission("ssqxx:dormArea:edit")
|
||||
@Log(title = "宿舍区信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgDormAreaBo bo) {
|
||||
return toAjax(xgDormAreaService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除宿舍区信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ssqxx:dormArea:remove")
|
||||
@Log(title = "宿舍区信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgDormAreaService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgDormBuildingVo;
|
||||
import org.dromara.xg.domain.bo.XgDormBuildingBo;
|
||||
import org.dromara.xg.service.IXgDormBuildingService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 宿舍楼信息
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/sslxx/dormBuilding")
|
||||
public class XgDormBuildingController extends BaseController {
|
||||
|
||||
private final IXgDormBuildingService xgDormBuildingService;
|
||||
|
||||
/**
|
||||
* 查询宿舍楼信息列表
|
||||
*/
|
||||
@SaCheckPermission("sslxx:dormBuilding:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgDormBuildingVo> list(XgDormBuildingBo bo, PageQuery pageQuery) {
|
||||
return xgDormBuildingService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出宿舍楼信息列表
|
||||
*/
|
||||
@SaCheckPermission("sslxx:dormBuilding:export")
|
||||
@Log(title = "宿舍楼信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgDormBuildingBo bo, HttpServletResponse response) {
|
||||
List<XgDormBuildingVo> list = xgDormBuildingService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "宿舍楼信息", XgDormBuildingVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取宿舍楼信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("sslxx:dormBuilding:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgDormBuildingVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgDormBuildingService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增宿舍楼信息
|
||||
*/
|
||||
@SaCheckPermission("sslxx:dormBuilding:add")
|
||||
@Log(title = "宿舍楼信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgDormBuildingBo bo) {
|
||||
return toAjax(xgDormBuildingService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍楼信息
|
||||
*/
|
||||
@SaCheckPermission("sslxx:dormBuilding:edit")
|
||||
@Log(title = "宿舍楼信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgDormBuildingBo bo) {
|
||||
return toAjax(xgDormBuildingService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除宿舍楼信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("sslxx:dormBuilding:remove")
|
||||
@Log(title = "宿舍楼信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgDormBuildingService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgDormCampusVo;
|
||||
import org.dromara.xg.domain.bo.XgDormCampusBo;
|
||||
import org.dromara.xg.service.IXgDormCampusService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 校区信息
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xqxx/dormCampus")
|
||||
public class XgDormCampusController extends BaseController {
|
||||
|
||||
private final IXgDormCampusService xgDormCampusService;
|
||||
|
||||
/**
|
||||
* 查询校区信息列表
|
||||
*/
|
||||
@SaCheckPermission("xqxx:dormCampus:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgDormCampusVo> list(XgDormCampusBo bo, PageQuery pageQuery) {
|
||||
return xgDormCampusService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出校区信息列表
|
||||
*/
|
||||
@SaCheckPermission("xqxx:dormCampus:export")
|
||||
@Log(title = "校区信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgDormCampusBo bo, HttpServletResponse response) {
|
||||
List<XgDormCampusVo> list = xgDormCampusService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "校区信息", XgDormCampusVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取校区信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xqxx:dormCampus:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgDormCampusVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgDormCampusService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增校区信息
|
||||
*/
|
||||
@SaCheckPermission("xqxx:dormCampus:add")
|
||||
@Log(title = "校区信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgDormCampusBo bo) {
|
||||
return toAjax(xgDormCampusService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改校区信息
|
||||
*/
|
||||
@SaCheckPermission("xqxx:dormCampus:edit")
|
||||
@Log(title = "校区信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgDormCampusBo bo) {
|
||||
return toAjax(xgDormCampusService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除校区信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("xqxx:dormCampus:remove")
|
||||
@Log(title = "校区信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgDormCampusService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerBuildingVo;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerBuildingBo;
|
||||
import org.dromara.xg.service.IXgDormManagerBuildingService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 管理员宿舍楼权限关系
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/glysslqxgx/dormManagerBuilding")
|
||||
public class XgDormManagerBuildingController extends BaseController {
|
||||
|
||||
private final IXgDormManagerBuildingService xgDormManagerBuildingService;
|
||||
|
||||
/**
|
||||
* 查询管理员宿舍楼权限关系列表
|
||||
*/
|
||||
@SaCheckPermission("glysslqxgx:dormManagerBuilding:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgDormManagerBuildingVo> list(XgDormManagerBuildingBo bo, PageQuery pageQuery) {
|
||||
return xgDormManagerBuildingService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出管理员宿舍楼权限关系列表
|
||||
*/
|
||||
@SaCheckPermission("glysslqxgx:dormManagerBuilding:export")
|
||||
@Log(title = "管理员宿舍楼权限关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgDormManagerBuildingBo bo, HttpServletResponse response) {
|
||||
List<XgDormManagerBuildingVo> list = xgDormManagerBuildingService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "管理员宿舍楼权限关系", XgDormManagerBuildingVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取管理员宿舍楼权限关系详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("glysslqxgx:dormManagerBuilding:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgDormManagerBuildingVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgDormManagerBuildingService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增管理员宿舍楼权限关系
|
||||
*/
|
||||
@SaCheckPermission("glysslqxgx:dormManagerBuilding:add")
|
||||
@Log(title = "管理员宿舍楼权限关系", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgDormManagerBuildingBo bo) {
|
||||
return toAjax(xgDormManagerBuildingService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改管理员宿舍楼权限关系
|
||||
*/
|
||||
@SaCheckPermission("glysslqxgx:dormManagerBuilding:edit")
|
||||
@Log(title = "管理员宿舍楼权限关系", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgDormManagerBuildingBo bo) {
|
||||
return toAjax(xgDormManagerBuildingService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除管理员宿舍楼权限关系
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("glysslqxgx:dormManagerBuilding:remove")
|
||||
@Log(title = "管理员宿舍楼权限关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgDormManagerBuildingService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerVo;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerBo;
|
||||
import org.dromara.xg.service.IXgDormManagerService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 宿舍管理员信息
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ssglyxx/dormManager")
|
||||
public class XgDormManagerController extends BaseController {
|
||||
|
||||
private final IXgDormManagerService xgDormManagerService;
|
||||
|
||||
/**
|
||||
* 查询宿舍管理员信息列表
|
||||
*/
|
||||
@SaCheckPermission("ssglyxx:dormManager:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgDormManagerVo> list(XgDormManagerBo bo, PageQuery pageQuery) {
|
||||
return xgDormManagerService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出宿舍管理员信息列表
|
||||
*/
|
||||
@SaCheckPermission("ssglyxx:dormManager:export")
|
||||
@Log(title = "宿舍管理员信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgDormManagerBo bo, HttpServletResponse response) {
|
||||
List<XgDormManagerVo> list = xgDormManagerService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "宿舍管理员信息", XgDormManagerVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取宿舍管理员信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ssglyxx:dormManager:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgDormManagerVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(xgDormManagerService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教师列表(用于下拉选择)
|
||||
*
|
||||
* @param name 教师姓名(可选,用于模糊查询)
|
||||
* @param managerType 管理员类型(可选,用于查询不同类型的管理员)
|
||||
*/
|
||||
@SaCheckPermission("ssglyxx:dormManager:list")
|
||||
@GetMapping("/teachers")
|
||||
public R<List<Map<String, Object>>> listTeachers(@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String managerType) {
|
||||
return R.ok(xgDormManagerService.queryTeacherList(name, managerType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增宿舍管理员信息
|
||||
*/
|
||||
@SaCheckPermission("ssglyxx:dormManager:add")
|
||||
@Log(title = "宿舍管理员信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgDormManagerBo bo) {
|
||||
return toAjax(xgDormManagerService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍管理员信息
|
||||
*/
|
||||
@SaCheckPermission("ssglyxx:dormManager:edit")
|
||||
@Log(title = "宿舍管理员信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgDormManagerBo bo) {
|
||||
return toAjax(xgDormManagerService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除宿舍管理员信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ssglyxx:dormManager:remove")
|
||||
@Log(title = "宿舍管理员信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
return toAjax(xgDormManagerService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerSourceVo;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerSourceBo;
|
||||
import org.dromara.xg.service.IXgDormManagerSourceService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 管理员授权关系
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/glysqgx/dormManagerSource")
|
||||
public class XgDormManagerSourceController extends BaseController {
|
||||
|
||||
private final IXgDormManagerSourceService xgDormManagerSourceService;
|
||||
|
||||
/**
|
||||
* 查询管理员授权关系列表
|
||||
*/
|
||||
@SaCheckPermission("glysqgx:dormManagerSource:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgDormManagerSourceVo> list(XgDormManagerSourceBo bo, PageQuery pageQuery) {
|
||||
return xgDormManagerSourceService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出管理员授权关系列表
|
||||
*/
|
||||
@SaCheckPermission("glysqgx:dormManagerSource:export")
|
||||
@Log(title = "管理员授权关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgDormManagerSourceBo bo, HttpServletResponse response) {
|
||||
List<XgDormManagerSourceVo> list = xgDormManagerSourceService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "管理员授权关系", XgDormManagerSourceVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取管理员授权关系详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("glysqgx:dormManagerSource:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgDormManagerSourceVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(xgDormManagerSourceService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增管理员授权关系
|
||||
*/
|
||||
@SaCheckPermission("glysqgx:dormManagerSource:add")
|
||||
@Log(title = "管理员授权关系", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgDormManagerSourceBo bo) {
|
||||
return toAjax(xgDormManagerSourceService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改管理员授权关系
|
||||
*/
|
||||
@SaCheckPermission("glysqgx:dormManagerSource:edit")
|
||||
@Log(title = "管理员授权关系", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgDormManagerSourceBo bo) {
|
||||
return toAjax(xgDormManagerSourceService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除管理员授权关系
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("glysqgx:dormManagerSource:remove")
|
||||
@Log(title = "管理员授权关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
return toAjax(xgDormManagerSourceService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量分配管理员数据范围
|
||||
*
|
||||
* @param managerId 管理员ID
|
||||
* @param authType 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
* @param authSourceIds 授权来源ID列表
|
||||
*/
|
||||
@SaCheckPermission("glysqgx:dormManagerSource:edit")
|
||||
@Log(title = "分配管理员数据范围", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/assignScope")
|
||||
public R<Void> assignScope(@RequestParam @NotNull(message = "管理员ID不能为空") Long managerId,
|
||||
@RequestParam @NotNull(message = "授权类型不能为空") Character authType,
|
||||
@RequestBody @NotEmpty(message = "授权来源ID不能为空") List<Long> authSourceIds) {
|
||||
return toAjax(xgDormManagerSourceService.assignScope(managerId, authType, authSourceIds));
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# 学工管理模块 - 实体类
|
||||
# 此目录用于存放数据库实体类,对应数据库表结构
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 宿舍区信息对象 xg_dorm_area
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_dorm_area")
|
||||
public class XgDormArea extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 宿舍区编码
|
||||
*/
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
private Long campusId;
|
||||
|
||||
/**
|
||||
* 宿舍区描述
|
||||
*/
|
||||
private String areaDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 宿舍楼信息对象 xg_dorm_building
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_dorm_building")
|
||||
public class XgDormBuilding extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 宿舍楼编码
|
||||
*/
|
||||
private String buildingCode;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
private String buildingName;
|
||||
|
||||
/**
|
||||
* 所属宿舍区ID
|
||||
*/
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
private Long campusId;
|
||||
|
||||
/**
|
||||
* 宿舍楼类型(1男生楼 2女生楼 3混合楼)
|
||||
*/
|
||||
private String buildingType;
|
||||
|
||||
/**
|
||||
* 宿舍楼描述
|
||||
*/
|
||||
private String buildingDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 校区信息对象 xg_dorm_campus
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_dorm_campus")
|
||||
public class XgDormCampus extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
private String campusCode;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
private String campusName;
|
||||
|
||||
/**
|
||||
* 校区描述
|
||||
*/
|
||||
private String campusDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 宿舍管理员信息对象 xg_dorm_manager
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_dorm_manager")
|
||||
public class XgDormManager extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员姓名
|
||||
*/
|
||||
private String managerName;
|
||||
|
||||
/**
|
||||
* 管理员类型(1全校管理员 2校区管理员 3宿舍区管理员 4宿舍楼管理员)
|
||||
*/
|
||||
private String managerType;
|
||||
|
||||
/**
|
||||
* 管理级别(1-5,1为最高)
|
||||
*/
|
||||
private Long managerLevel;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 性别(0男 1女 2未知)
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 管理员宿舍楼权限关系对象 xg_dorm_manager_building
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_dorm_manager_building")
|
||||
public class XgDormManagerBuilding extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
private Long buildingId;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 管理员授权关系对象 xg_dorm_manager_source
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_dorm_manager_source")
|
||||
public class XgDormManagerSource extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 权限类型(1查看 2编辑 3完全管理)
|
||||
*/
|
||||
private String permissionType;
|
||||
|
||||
/**
|
||||
* 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
*/
|
||||
private String authType;
|
||||
|
||||
/**
|
||||
* 授权来源ID(对应校区ID或宿舍区ID或楼栋ID)
|
||||
*/
|
||||
private Long authSource;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# 学工管理模块 - 业务对象(Business Object)
|
||||
# 此目录用于存放业务对象类,用于接收前端参数和业务逻辑处理
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormArea;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 宿舍区信息业务对象 xg_dorm_area
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgDormArea.class, reverseConvertGenerate = false)
|
||||
public class XgDormAreaBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 宿舍区编码
|
||||
*/
|
||||
@NotBlank(message = "宿舍区编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
@NotBlank(message = "宿舍区名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
@NotNull(message = "所属校区ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long campusId;
|
||||
|
||||
/**
|
||||
* 宿舍区描述
|
||||
*/
|
||||
private String areaDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormBuilding;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 宿舍楼信息业务对象 xg_dorm_building
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgDormBuilding.class, reverseConvertGenerate = false)
|
||||
public class XgDormBuildingBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 宿舍楼编码
|
||||
*/
|
||||
@NotBlank(message = "宿舍楼编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String buildingCode;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
@NotBlank(message = "宿舍楼名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String buildingName;
|
||||
|
||||
/**
|
||||
* 所属宿舍区ID
|
||||
*/
|
||||
@NotNull(message = "所属宿舍区ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
@NotNull(message = "所属校区ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long campusId;
|
||||
|
||||
/**
|
||||
* 宿舍楼类型(1男生楼 2女生楼 3混合楼)
|
||||
*/
|
||||
private String buildingType;
|
||||
|
||||
/**
|
||||
* 宿舍楼描述
|
||||
*/
|
||||
private String buildingDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormCampus;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 校区信息业务对象 xg_dorm_campus
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgDormCampus.class, reverseConvertGenerate = false)
|
||||
public class XgDormCampusBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
@NotBlank(message = "校区编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String campusCode;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
@NotBlank(message = "校区名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String campusName;
|
||||
|
||||
/**
|
||||
* 校区描述
|
||||
*/
|
||||
private String campusDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManager;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 宿舍管理员信息业务对象 xg_dorm_manager
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgDormManager.class, reverseConvertGenerate = false)
|
||||
public class XgDormManagerBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员姓名
|
||||
*/
|
||||
@NotBlank(message = "管理员姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String managerName;
|
||||
|
||||
/**
|
||||
* 管理员类型(1全校管理员 2校区管理员 3宿舍区管理员 4宿舍楼管理员)
|
||||
*/
|
||||
@NotBlank(message = "管理员类型(1全校管理员 2校区管理员 3宿舍区管理员 4宿舍楼管理员)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String managerType;
|
||||
|
||||
/**
|
||||
* 管理级别(1-5,1为最高)
|
||||
*/
|
||||
private Long managerLevel;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 性别(0男 1女 2未知)
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManagerBuilding;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 管理员宿舍楼权限关系业务对象 xg_dorm_manager_building
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgDormManagerBuilding.class, reverseConvertGenerate = false)
|
||||
public class XgDormManagerBuildingBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
@NotNull(message = "管理员ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
@NotNull(message = "宿舍楼ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long buildingId;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManagerSource;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 管理员授权关系业务对象 xg_dorm_manager_source
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgDormManagerSource.class, reverseConvertGenerate = false)
|
||||
public class XgDormManagerSourceBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
@NotNull(message = "管理员ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 权限类型(1查看 2编辑 3完全管理)
|
||||
*/
|
||||
private String permissionType;
|
||||
|
||||
/**
|
||||
* 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
*/
|
||||
@NotBlank(message = "授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String authType;
|
||||
|
||||
/**
|
||||
* 授权来源ID(对应校区ID或宿舍区ID或楼栋ID)
|
||||
*/
|
||||
private Long authSource;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# 学工管理模块 - 视图对象(View Object)
|
||||
# 此目录用于存放视图对象类,用于返回给前端的数据结构
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 教师信息视图对象
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class TeacherVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户性别(0男 1女 2未知)
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private Long updateBy;
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormArea;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 宿舍区信息视图对象 xg_dorm_area
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgDormArea.class)
|
||||
public class XgDormAreaVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 宿舍区编码
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍区编码")
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍区名称")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
@ExcelProperty(value = "所属校区ID")
|
||||
private Long campusId;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
@ExcelProperty(value = "校区名称")
|
||||
private String campusName;
|
||||
|
||||
/**
|
||||
* 宿舍区描述
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍区描述")
|
||||
private String areaDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ExcelProperty(value = "排序号")
|
||||
private Long sortOrder;
|
||||
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormBuilding;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 宿舍楼信息视图对象 xg_dorm_building
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgDormBuilding.class)
|
||||
public class XgDormBuildingVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 宿舍楼编码
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍楼编码")
|
||||
private String buildingCode;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍楼名称")
|
||||
private String buildingName;
|
||||
|
||||
/**
|
||||
* 所属宿舍区ID
|
||||
*/
|
||||
@ExcelProperty(value = "所属宿舍区ID")
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍区名称")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
@ExcelProperty(value = "所属校区ID")
|
||||
private Long campusId;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
@ExcelProperty(value = "校区名称")
|
||||
private String campusName;
|
||||
|
||||
/**
|
||||
* 宿舍楼类型(1男生楼 2女生楼 3混合楼)
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍楼类型(1男生楼 2女生楼 3混合楼)", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "dorm_type")
|
||||
private String buildingType;
|
||||
|
||||
/**
|
||||
* 宿舍楼描述
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍楼描述")
|
||||
private String buildingDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ExcelProperty(value = "排序号")
|
||||
private Long sortOrder;
|
||||
|
||||
// 基础字段
|
||||
private Long createBy; // 创建者
|
||||
private Date createTime; // 创建时间
|
||||
private Long updateBy; // 更新者
|
||||
private Date updateTime; // 更新时间
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormCampus;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 校区信息视图对象 xg_dorm_campus
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgDormCampus.class)
|
||||
public class XgDormCampusVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
@ExcelProperty(value = "校区编码")
|
||||
private String campusCode;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
@ExcelProperty(value = "校区名称")
|
||||
private String campusName;
|
||||
|
||||
/**
|
||||
* 校区描述
|
||||
*/
|
||||
@ExcelProperty(value = "校区描述")
|
||||
private String campusDescription;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ExcelProperty(value = "排序号")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManagerBuilding;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 管理员宿舍楼权限关系视图对象 xg_dorm_manager_building
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgDormManagerBuilding.class)
|
||||
public class XgDormManagerBuildingVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
@ExcelProperty(value = "管理员ID")
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍楼ID")
|
||||
private Long buildingId;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
@ExcelProperty(value = "状态(0有效 1已撤销)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@ExcelProperty(value = "删除标志(0代表存在 1代表删除)")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManagerSource;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 管理员授权关系视图对象 xg_dorm_manager_source
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgDormManagerSource.class)
|
||||
public class XgDormManagerSourceVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
@ExcelProperty(value = "管理员ID")
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 权限类型(1查看 2编辑 3完全管理)
|
||||
*/
|
||||
@ExcelProperty(value = "权限类型(1查看 2编辑 3完全管理)")
|
||||
private String permissionType;
|
||||
|
||||
/**
|
||||
* 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
*/
|
||||
@ExcelProperty(value = "授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)")
|
||||
private String authType;
|
||||
|
||||
/**
|
||||
* 授权来源ID(对应校区ID或宿舍区ID或楼栋ID)
|
||||
*/
|
||||
@ExcelProperty(value = "授权来源ID(对应校区ID或宿舍区ID或楼栋ID)")
|
||||
private Long authSource;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
@ExcelProperty(value = "状态(0有效 1已撤销)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@ExcelProperty(value = "删除标志(0代表存在 1代表删除)")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManager;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 宿舍管理员信息视图对象 xg_dorm_manager
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgDormManager.class)
|
||||
public class XgDormManagerVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员姓名
|
||||
*/
|
||||
@ExcelProperty(value = "管理员姓名")
|
||||
private String managerName;
|
||||
|
||||
/**
|
||||
* 管理员类型(1全校管理员 2校区管理员 3宿舍区管理员 4宿舍楼管理员)
|
||||
*/
|
||||
@ExcelProperty(value = "管理员类型(1全校管理员 2校区管理员 3宿舍区管理员 4宿舍楼管理员)")
|
||||
private String managerType;
|
||||
|
||||
/**
|
||||
* 管理级别(1-5,1为最高)
|
||||
*/
|
||||
@ExcelProperty(value = "管理级别(1-5,1为最高)")
|
||||
private Long managerLevel;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "关联用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@ExcelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 性别(0男 1女 2未知)
|
||||
*/
|
||||
@ExcelProperty(value = "性别(0男 1女 2未知)")
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ExcelProperty(value = "状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@ExcelProperty(value = "删除标志(0代表存在 1代表删除)")
|
||||
private String deleted;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# 学工管理模块 - 数据访问层
|
||||
# 此目录用于存放MyBatis Mapper接口
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgDormArea;
|
||||
import org.dromara.xg.domain.vo.XgDormAreaVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.xg.domain.bo.XgDormAreaBo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
/**
|
||||
* 宿舍区信息Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface XgDormAreaMapper extends BaseMapperPlus<XgDormArea, XgDormAreaVo> {
|
||||
|
||||
/**
|
||||
* 分页查询并返回校区名称
|
||||
*/
|
||||
Page<XgDormAreaVo> selectPageWithCampusName(Page<?> page,
|
||||
@org.apache.ibatis.annotations.Param("bo") XgDormAreaBo bo);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgDormBuilding;
|
||||
import org.dromara.xg.domain.vo.XgDormBuildingVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.xg.domain.bo.XgDormBuildingBo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
/**
|
||||
* 宿舍楼信息Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface XgDormBuildingMapper extends BaseMapperPlus<XgDormBuilding, XgDormBuildingVo> {
|
||||
|
||||
/**
|
||||
* 分页查询并返回校区名称和宿舍区名称
|
||||
*/
|
||||
Page<XgDormBuildingVo> selectPageWithAreaAndCampusName(Page<?> page,
|
||||
@org.apache.ibatis.annotations.Param("bo") XgDormBuildingBo bo);
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgDormCampus;
|
||||
import org.dromara.xg.domain.vo.XgDormCampusVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 校区信息Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface XgDormCampusMapper extends BaseMapperPlus<XgDormCampus, XgDormCampusVo> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManagerBuilding;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerBuildingVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 管理员宿舍楼权限关系Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface XgDormManagerBuildingMapper extends BaseMapperPlus<XgDormManagerBuilding, XgDormManagerBuildingVo> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManager;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 宿舍管理员信息Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface XgDormManagerMapper extends BaseMapperPlus<XgDormManager, XgDormManagerVo> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgDormManagerSource;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerSourceVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 管理员授权关系Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface XgDormManagerSourceMapper extends BaseMapperPlus<XgDormManagerSource, XgDormManagerSourceVo> {
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# 学工管理模块 - 业务服务接口层
|
||||
# 此目录用于存放Service接口定义
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgDormAreaVo;
|
||||
import org.dromara.xg.domain.bo.XgDormAreaBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍区信息Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface IXgDormAreaService {
|
||||
|
||||
/**
|
||||
* 查询宿舍区信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 宿舍区信息
|
||||
*/
|
||||
XgDormAreaVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询宿舍区信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 宿舍区信息分页列表
|
||||
*/
|
||||
TableDataInfo<XgDormAreaVo> queryPageList(XgDormAreaBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的宿舍区信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 宿舍区信息列表
|
||||
*/
|
||||
List<XgDormAreaVo> queryList(XgDormAreaBo bo);
|
||||
|
||||
/**
|
||||
* 新增宿舍区信息
|
||||
*
|
||||
* @param bo 宿舍区信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgDormAreaBo bo);
|
||||
|
||||
/**
|
||||
* 修改宿舍区信息
|
||||
*
|
||||
* @param bo 宿舍区信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgDormAreaBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除宿舍区信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgDormBuildingVo;
|
||||
import org.dromara.xg.domain.bo.XgDormBuildingBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍楼信息Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface IXgDormBuildingService {
|
||||
|
||||
/**
|
||||
* 查询宿舍楼信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 宿舍楼信息
|
||||
*/
|
||||
XgDormBuildingVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询宿舍楼信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 宿舍楼信息分页列表
|
||||
*/
|
||||
TableDataInfo<XgDormBuildingVo> queryPageList(XgDormBuildingBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的宿舍楼信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 宿舍楼信息列表
|
||||
*/
|
||||
List<XgDormBuildingVo> queryList(XgDormBuildingBo bo);
|
||||
|
||||
/**
|
||||
* 新增宿舍楼信息
|
||||
*
|
||||
* @param bo 宿舍楼信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgDormBuildingBo bo);
|
||||
|
||||
/**
|
||||
* 修改宿舍楼信息
|
||||
*
|
||||
* @param bo 宿舍楼信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgDormBuildingBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除宿舍楼信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgDormCampusVo;
|
||||
import org.dromara.xg.domain.bo.XgDormCampusBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 校区信息Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface IXgDormCampusService {
|
||||
|
||||
/**
|
||||
* 查询校区信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 校区信息
|
||||
*/
|
||||
XgDormCampusVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询校区信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 校区信息分页列表
|
||||
*/
|
||||
TableDataInfo<XgDormCampusVo> queryPageList(XgDormCampusBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的校区信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 校区信息列表
|
||||
*/
|
||||
List<XgDormCampusVo> queryList(XgDormCampusBo bo);
|
||||
|
||||
/**
|
||||
* 新增校区信息
|
||||
*
|
||||
* @param bo 校区信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgDormCampusBo bo);
|
||||
|
||||
/**
|
||||
* 修改校区信息
|
||||
*
|
||||
* @param bo 校区信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgDormCampusBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除校区信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgDormManagerBuildingVo;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerBuildingBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 管理员宿舍楼权限关系Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface IXgDormManagerBuildingService {
|
||||
|
||||
/**
|
||||
* 查询管理员宿舍楼权限关系
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 管理员宿舍楼权限关系
|
||||
*/
|
||||
XgDormManagerBuildingVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询管理员宿舍楼权限关系列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 管理员宿舍楼权限关系分页列表
|
||||
*/
|
||||
TableDataInfo<XgDormManagerBuildingVo> queryPageList(XgDormManagerBuildingBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的管理员宿舍楼权限关系列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 管理员宿舍楼权限关系列表
|
||||
*/
|
||||
List<XgDormManagerBuildingVo> queryList(XgDormManagerBuildingBo bo);
|
||||
|
||||
/**
|
||||
* 新增管理员宿舍楼权限关系
|
||||
*
|
||||
* @param bo 管理员宿舍楼权限关系
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgDormManagerBuildingBo bo);
|
||||
|
||||
/**
|
||||
* 修改管理员宿舍楼权限关系
|
||||
*
|
||||
* @param bo 管理员宿舍楼权限关系
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgDormManagerBuildingBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除管理员宿舍楼权限关系信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgDormManagerVo;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 宿舍管理员信息Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface IXgDormManagerService {
|
||||
|
||||
/**
|
||||
* 查询宿舍管理员信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 宿舍管理员信息
|
||||
*/
|
||||
XgDormManagerVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询宿舍管理员信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 宿舍管理员信息分页列表
|
||||
*/
|
||||
TableDataInfo<XgDormManagerVo> queryPageList(XgDormManagerBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的宿舍管理员信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 宿舍管理员信息列表
|
||||
*/
|
||||
List<XgDormManagerVo> queryList(XgDormManagerBo bo);
|
||||
|
||||
/**
|
||||
* 查询教师列表(用于下拉选择)
|
||||
*
|
||||
* @param name 教师姓名(可选,用于模糊查询)
|
||||
* @return 教师列表
|
||||
*/
|
||||
List<Map<String, Object>> queryTeacherList(String name, String managerType);
|
||||
|
||||
/**
|
||||
* 新增宿舍管理员信息
|
||||
*
|
||||
* @param bo 宿舍管理员信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgDormManagerBo bo);
|
||||
|
||||
/**
|
||||
* 修改宿舍管理员信息
|
||||
*
|
||||
* @param bo 宿舍管理员信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgDormManagerBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除宿舍管理员信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgDormManagerSourceVo;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerSourceBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 管理员授权关系Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface IXgDormManagerSourceService {
|
||||
|
||||
/**
|
||||
* 查询管理员授权关系
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 管理员授权关系
|
||||
*/
|
||||
XgDormManagerSourceVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询管理员授权关系列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 管理员授权关系分页列表
|
||||
*/
|
||||
TableDataInfo<XgDormManagerSourceVo> queryPageList(XgDormManagerSourceBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的管理员授权关系列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 管理员授权关系列表
|
||||
*/
|
||||
List<XgDormManagerSourceVo> queryList(XgDormManagerSourceBo bo);
|
||||
|
||||
/**
|
||||
* 新增管理员授权关系
|
||||
*
|
||||
* @param bo 管理员授权关系
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgDormManagerSourceBo bo);
|
||||
|
||||
/**
|
||||
* 修改管理员授权关系
|
||||
*
|
||||
* @param bo 管理员授权关系
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgDormManagerSourceBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除管理员授权关系信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 批量分配管理员数据范围
|
||||
*
|
||||
* @param managerId 管理员ID
|
||||
* @param authType 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
* @param authSourceIds 授权来源ID列表
|
||||
* @return 是否分配成功
|
||||
*/
|
||||
Boolean assignScope(Long managerId, Character authType, List<Long> authSourceIds);
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# 学工管理模块 - 业务服务实现层
|
||||
# 此目录用于存放Service接口的实现类
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.xg.domain.bo.XgDormAreaBo;
|
||||
import org.dromara.xg.domain.vo.XgDormAreaVo;
|
||||
import org.dromara.xg.domain.XgDormArea;
|
||||
import org.dromara.xg.mapper.XgDormAreaMapper;
|
||||
import org.dromara.xg.service.IXgDormAreaService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 宿舍区信息Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgDormAreaServiceImpl implements IXgDormAreaService {
|
||||
|
||||
private final XgDormAreaMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询宿舍区信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 宿舍区信息
|
||||
*/
|
||||
@Override
|
||||
public XgDormAreaVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询宿舍区信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 宿舍区信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgDormAreaVo> queryPageList(XgDormAreaBo bo, PageQuery pageQuery) {
|
||||
Page<XgDormAreaVo> result = baseMapper.selectPageWithCampusName(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的宿舍区信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 宿舍区信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgDormAreaVo> queryList(XgDormAreaBo bo) {
|
||||
LambdaQueryWrapper<XgDormArea> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgDormArea> buildQueryWrapper(XgDormAreaBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgDormArea> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgDormArea::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAreaCode()), XgDormArea::getAreaCode, bo.getAreaCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAreaName()), XgDormArea::getAreaName, bo.getAreaName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAreaDescription()), XgDormArea::getAreaDescription,
|
||||
bo.getAreaDescription());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增宿舍区信息
|
||||
*
|
||||
* @param bo 宿舍区信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgDormAreaBo bo) {
|
||||
XgDormArea add = MapstructUtils.convert(bo, XgDormArea.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍区信息
|
||||
*
|
||||
* @param bo 宿舍区信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgDormAreaBo bo) {
|
||||
XgDormArea update = MapstructUtils.convert(bo, XgDormArea.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgDormArea entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除宿舍区信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.xg.domain.bo.XgDormBuildingBo;
|
||||
import org.dromara.xg.domain.vo.XgDormBuildingVo;
|
||||
import org.dromara.xg.domain.XgDormBuilding;
|
||||
import org.dromara.xg.mapper.XgDormBuildingMapper;
|
||||
import org.dromara.xg.service.IXgDormBuildingService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 宿舍楼信息Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgDormBuildingServiceImpl implements IXgDormBuildingService {
|
||||
|
||||
private final XgDormBuildingMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询宿舍楼信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 宿舍楼信息
|
||||
*/
|
||||
@Override
|
||||
public XgDormBuildingVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询宿舍楼信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 宿舍楼信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgDormBuildingVo> queryPageList(XgDormBuildingBo bo, PageQuery pageQuery) {
|
||||
Page<XgDormBuildingVo> result = baseMapper.selectPageWithAreaAndCampusName(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的宿舍楼信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 宿舍楼信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgDormBuildingVo> queryList(XgDormBuildingBo bo) {
|
||||
LambdaQueryWrapper<XgDormBuilding> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgDormBuilding> buildQueryWrapper(XgDormBuildingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgDormBuilding> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgDormBuilding::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBuildingCode()), XgDormBuilding::getBuildingCode, bo.getBuildingCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBuildingName()), XgDormBuilding::getBuildingName, bo.getBuildingName());
|
||||
lqw.eq(bo.getAreaId() != null, XgDormBuilding::getAreaId, bo.getAreaId());
|
||||
lqw.eq(bo.getCampusId() != null, XgDormBuilding::getCampusId, bo.getCampusId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBuildingType()), XgDormBuilding::getBuildingType, bo.getBuildingType());
|
||||
lqw.eq(bo.getSortOrder() != null, XgDormBuilding::getSortOrder, bo.getSortOrder());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增宿舍楼信息
|
||||
*
|
||||
* @param bo 宿舍楼信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgDormBuildingBo bo) {
|
||||
XgDormBuilding add = MapstructUtils.convert(bo, XgDormBuilding.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍楼信息
|
||||
*
|
||||
* @param bo 宿舍楼信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgDormBuildingBo bo) {
|
||||
XgDormBuilding update = MapstructUtils.convert(bo, XgDormBuilding.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgDormBuilding entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除宿舍楼信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.xg.domain.bo.XgDormCampusBo;
|
||||
import org.dromara.xg.domain.vo.XgDormCampusVo;
|
||||
import org.dromara.xg.domain.XgDormCampus;
|
||||
import org.dromara.xg.mapper.XgDormCampusMapper;
|
||||
import org.dromara.xg.service.IXgDormCampusService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 校区信息Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgDormCampusServiceImpl implements IXgDormCampusService {
|
||||
|
||||
private final XgDormCampusMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询校区信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 校区信息
|
||||
*/
|
||||
@Override
|
||||
public XgDormCampusVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询校区信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 校区信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgDormCampusVo> queryPageList(XgDormCampusBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgDormCampus> lqw = buildQueryWrapper(bo);
|
||||
Page<XgDormCampusVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的校区信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 校区信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgDormCampusVo> queryList(XgDormCampusBo bo) {
|
||||
LambdaQueryWrapper<XgDormCampus> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgDormCampus> buildQueryWrapper(XgDormCampusBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgDormCampus> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgDormCampus::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCampusCode()), XgDormCampus::getCampusCode, bo.getCampusCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCampusName()), XgDormCampus::getCampusName, bo.getCampusName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增校区信息
|
||||
*
|
||||
* @param bo 校区信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgDormCampusBo bo) {
|
||||
XgDormCampus add = MapstructUtils.convert(bo, XgDormCampus.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改校区信息
|
||||
*
|
||||
* @param bo 校区信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgDormCampusBo bo) {
|
||||
XgDormCampus update = MapstructUtils.convert(bo, XgDormCampus.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgDormCampus entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除校区信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerBuildingBo;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerBuildingVo;
|
||||
import org.dromara.xg.domain.XgDormManagerBuilding;
|
||||
import org.dromara.xg.mapper.XgDormManagerBuildingMapper;
|
||||
import org.dromara.xg.service.IXgDormManagerBuildingService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 管理员宿舍楼权限关系Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgDormManagerBuildingServiceImpl implements IXgDormManagerBuildingService {
|
||||
|
||||
private final XgDormManagerBuildingMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询管理员宿舍楼权限关系
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 管理员宿舍楼权限关系
|
||||
*/
|
||||
@Override
|
||||
public XgDormManagerBuildingVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询管理员宿舍楼权限关系列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 管理员宿舍楼权限关系分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgDormManagerBuildingVo> queryPageList(XgDormManagerBuildingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgDormManagerBuilding> lqw = buildQueryWrapper(bo);
|
||||
Page<XgDormManagerBuildingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的管理员宿舍楼权限关系列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 管理员宿舍楼权限关系列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgDormManagerBuildingVo> queryList(XgDormManagerBuildingBo bo) {
|
||||
LambdaQueryWrapper<XgDormManagerBuilding> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgDormManagerBuilding> buildQueryWrapper(XgDormManagerBuildingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgDormManagerBuilding> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgDormManagerBuilding::getId);
|
||||
lqw.eq(bo.getManagerId() != null, XgDormManagerBuilding::getManagerId, bo.getManagerId());
|
||||
lqw.eq(bo.getBuildingId() != null, XgDormManagerBuilding::getBuildingId, bo.getBuildingId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), XgDormManagerBuilding::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeleted()), XgDormManagerBuilding::getDeleted, bo.getDeleted());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增管理员宿舍楼权限关系
|
||||
*
|
||||
* @param bo 管理员宿舍楼权限关系
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgDormManagerBuildingBo bo) {
|
||||
XgDormManagerBuilding add = MapstructUtils.convert(bo, XgDormManagerBuilding.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改管理员宿舍楼权限关系
|
||||
*
|
||||
* @param bo 管理员宿舍楼权限关系
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgDormManagerBuildingBo bo) {
|
||||
XgDormManagerBuilding update = MapstructUtils.convert(bo, XgDormManagerBuilding.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgDormManagerBuilding entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除管理员宿舍楼权限关系信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerBo;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerVo;
|
||||
import org.dromara.xg.domain.XgDormManager;
|
||||
import org.dromara.xg.mapper.XgDormManagerMapper;
|
||||
import org.dromara.xg.service.IXgDormManagerService;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 宿舍管理员信息Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgDormManagerServiceImpl implements IXgDormManagerService {
|
||||
|
||||
private final XgDormManagerMapper baseMapper;
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
/**
|
||||
* 查询宿舍管理员信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 宿舍管理员信息
|
||||
*/
|
||||
@Override
|
||||
public XgDormManagerVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询宿舍管理员信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 宿舍管理员信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgDormManagerVo> queryPageList(XgDormManagerBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgDormManager> lqw = buildQueryWrapper(bo);
|
||||
Page<XgDormManagerVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的宿舍管理员信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 宿舍管理员信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgDormManagerVo> queryList(XgDormManagerBo bo) {
|
||||
LambdaQueryWrapper<XgDormManager> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询教师列表(用于下拉选择)
|
||||
*
|
||||
* @param name 教师姓名(可选,用于模糊查询)
|
||||
* @return 教师列表
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> queryTeacherList(String name, String managerType) {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append(
|
||||
"SELECT u.user_id as value, u.nick_name as label, u.user_name as username,u.phonenumber as phonenumber, u.sex as sex ");
|
||||
sql.append("FROM sys_user u ");
|
||||
sql.append("INNER JOIN sys_user_role ur ON u.user_id = ur.user_id ");
|
||||
sql.append("INNER JOIN sys_role r ON ur.role_id = r.role_id ");
|
||||
sql.append(
|
||||
"WHERE r.role_key = 'teacher' AND u.status = '0' and not exists (select 1 from xg_dorm_manager where user_id = u.user_id and deleted = '0' and manager_type = '"
|
||||
+ managerType + "') ");
|
||||
|
||||
List<Object> params = new ArrayList<>();
|
||||
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sql.append("AND u.nick_name LIKE ? ");
|
||||
params.add("%" + name + "%");
|
||||
}
|
||||
|
||||
sql.append("ORDER BY u.nick_name");
|
||||
|
||||
try {
|
||||
if (params.isEmpty()) {
|
||||
return jdbcTemplate.queryForList(sql.toString());
|
||||
} else {
|
||||
return jdbcTemplate.queryForList(sql.toString(), params.toArray());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询教师列表异常", e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgDormManager> buildQueryWrapper(XgDormManagerBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgDormManager> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgDormManager::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getManagerName()), XgDormManager::getManagerName, bo.getManagerName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getManagerType()), XgDormManager::getManagerType, bo.getManagerType());
|
||||
lqw.eq(bo.getManagerLevel() != null, XgDormManager::getManagerLevel, bo.getManagerLevel());
|
||||
lqw.eq(bo.getUserId() != null, XgDormManager::getUserId, bo.getUserId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), XgDormManager::getPhone, bo.getPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGender()), XgDormManager::getGender, bo.getGender());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), XgDormManager::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeleted()), XgDormManager::getDeleted, bo.getDeleted());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增宿舍管理员信息
|
||||
*
|
||||
* @param bo 宿舍管理员信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgDormManagerBo bo) {
|
||||
XgDormManager add = MapstructUtils.convert(bo, XgDormManager.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍管理员信息
|
||||
*
|
||||
* @param bo 宿舍管理员信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgDormManagerBo bo) {
|
||||
XgDormManager update = MapstructUtils.convert(bo, XgDormManager.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgDormManager entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除宿舍管理员信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+191
@@ -0,0 +1,191 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.dromara.xg.domain.bo.XgDormManagerSourceBo;
|
||||
import org.dromara.xg.domain.vo.XgDormManagerSourceVo;
|
||||
import org.dromara.xg.domain.XgDormManagerSource;
|
||||
import org.dromara.xg.mapper.XgDormManagerSourceMapper;
|
||||
import org.dromara.xg.service.IXgDormManagerSourceService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 管理员授权关系Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgDormManagerSourceServiceImpl implements IXgDormManagerSourceService {
|
||||
|
||||
private final XgDormManagerSourceMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询管理员授权关系
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 管理员授权关系
|
||||
*/
|
||||
@Override
|
||||
public XgDormManagerSourceVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询管理员授权关系列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 管理员授权关系分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgDormManagerSourceVo> queryPageList(XgDormManagerSourceBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgDormManagerSource> lqw = buildQueryWrapper(bo);
|
||||
Page<XgDormManagerSourceVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的管理员授权关系列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 管理员授权关系列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgDormManagerSourceVo> queryList(XgDormManagerSourceBo bo) {
|
||||
LambdaQueryWrapper<XgDormManagerSource> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgDormManagerSource> buildQueryWrapper(XgDormManagerSourceBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgDormManagerSource> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgDormManagerSource::getId);
|
||||
lqw.eq(bo.getManagerId() != null, XgDormManagerSource::getManagerId, bo.getManagerId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPermissionType()), XgDormManagerSource::getPermissionType,
|
||||
bo.getPermissionType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAuthType()), XgDormManagerSource::getAuthType, bo.getAuthType());
|
||||
lqw.eq(bo.getAuthSource() != null, XgDormManagerSource::getAuthSource, bo.getAuthSource());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), XgDormManagerSource::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeleted()), XgDormManagerSource::getDeleted, bo.getDeleted());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增管理员授权关系
|
||||
*
|
||||
* @param bo 管理员授权关系
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgDormManagerSourceBo bo) {
|
||||
XgDormManagerSource add = MapstructUtils.convert(bo, XgDormManagerSource.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改管理员授权关系
|
||||
*
|
||||
* @param bo 管理员授权关系
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgDormManagerSourceBo bo) {
|
||||
XgDormManagerSource update = MapstructUtils.convert(bo, XgDormManagerSource.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgDormManagerSource entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除管理员授权关系信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量分配管理员数据范围
|
||||
*
|
||||
* @param managerId 管理员ID
|
||||
* @param authType 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
* @param authSourceIds 授权来源ID列表
|
||||
* @return 是否分配成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean assignScope(Long managerId, Character authType, List<Long> authSourceIds) {
|
||||
if (managerId == null || authType == null || authSourceIds == null || authSourceIds.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
// 1. 先逻辑删除该管理员现有的对应类型的授权数据
|
||||
LambdaUpdateWrapper<XgDormManagerSource> updateWrapper = Wrappers.lambdaUpdate(XgDormManagerSource.class)
|
||||
.set(XgDormManagerSource::getDeleted, "1")
|
||||
.eq(XgDormManagerSource::getManagerId, managerId)
|
||||
.eq(XgDormManagerSource::getAuthType, authType.toString())
|
||||
.eq(XgDormManagerSource::getDeleted, "0");
|
||||
|
||||
baseMapper.update(null, updateWrapper);
|
||||
|
||||
// 2. 批量插入新的授权数据
|
||||
List<XgDormManagerSource> insertList = new ArrayList<>();
|
||||
for (Long authSourceId : authSourceIds) {
|
||||
XgDormManagerSource entity = new XgDormManagerSource();
|
||||
entity.setManagerId(managerId);
|
||||
entity.setAuthType(authType.toString());
|
||||
entity.setAuthSource(authSourceId);
|
||||
entity.setPermissionType("3"); // 默认为完全管理权限
|
||||
entity.setStatus("0"); // 默认有效
|
||||
entity.setDeleted("0"); // 默认未删除
|
||||
insertList.add(entity);
|
||||
}
|
||||
|
||||
// 循环插入,确保每条数据都有唯一ID
|
||||
for (XgDormManagerSource entity : insertList) {
|
||||
baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("分配管理员数据范围失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgDormManagerSourceMapper">
|
||||
|
||||
</mapper>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgDormManagerBuildingMapper">
|
||||
|
||||
</mapper>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgDormManagerMapper">
|
||||
|
||||
</mapper>
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgDormBuildingMapper">
|
||||
|
||||
<select id="selectPageWithAreaAndCampusName" resultType="org.dromara.xg.domain.vo.XgDormBuildingVo">
|
||||
SELECT
|
||||
b.id,
|
||||
b.building_code,
|
||||
b.building_name,
|
||||
b.area_id,
|
||||
a.area_name,
|
||||
b.campus_id,
|
||||
c.campus_name,
|
||||
b.building_type,
|
||||
b.building_description,
|
||||
b.sort_order,
|
||||
b.deleted,
|
||||
b.remark,
|
||||
b.create_by,
|
||||
b.create_time,
|
||||
b.update_by,
|
||||
b.update_time
|
||||
FROM xg_dorm_building b
|
||||
LEFT JOIN xg_dorm_area a ON b.area_id = a.id
|
||||
LEFT JOIN xg_dorm_campus c ON b.campus_id = c.id
|
||||
<where>
|
||||
<if test="bo.buildingCode != null and bo.buildingCode != ''">
|
||||
AND b.building_code LIKE CONCAT('%', #{bo.buildingCode}, '%')
|
||||
</if>
|
||||
<if test="bo.buildingName != null and bo.buildingName != ''">
|
||||
AND b.building_name LIKE CONCAT('%', #{bo.buildingName}, '%')
|
||||
</if>
|
||||
<if test="bo.areaId != null">
|
||||
AND b.area_id = #{bo.areaId}
|
||||
</if>
|
||||
<if test="bo.campusId != null">
|
||||
AND b.campus_id = #{bo.campusId}
|
||||
</if>
|
||||
<if test="bo.buildingType != null and bo.buildingType != ''">
|
||||
AND b.building_type = #{bo.buildingType}
|
||||
</if>
|
||||
<if test="bo.buildingDescription != null and bo.buildingDescription != ''">
|
||||
AND b.building_description LIKE CONCAT('%', #{bo.buildingDescription}, '%')
|
||||
</if>
|
||||
AND b.deleted = '0'
|
||||
</where>
|
||||
ORDER BY b.id ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgDormAreaMapper">
|
||||
|
||||
<select id="selectPageWithCampusName" resultType="org.dromara.xg.domain.vo.XgDormAreaVo">
|
||||
SELECT
|
||||
a.id,
|
||||
a.area_code,
|
||||
a.area_name,
|
||||
a.campus_id,
|
||||
a.area_description,
|
||||
a.sort_order,
|
||||
a.deleted,
|
||||
a.remark,
|
||||
c.campus_name
|
||||
FROM xg_dorm_area a
|
||||
LEFT JOIN xg_dorm_campus c ON a.campus_id = c.id
|
||||
<where>
|
||||
<if test="bo.areaCode != null and bo.areaCode != ''">
|
||||
AND a.area_code LIKE CONCAT('%', #{bo.areaCode}, '%')
|
||||
</if>
|
||||
<if test="bo.areaName != null and bo.areaName != ''">
|
||||
AND a.area_name LIKE CONCAT('%', #{bo.areaName}, '%')
|
||||
</if>
|
||||
<if test="bo.areaDescription != null and bo.areaDescription != ''">
|
||||
AND a.area_description LIKE CONCAT('%', #{bo.areaDescription}, '%')
|
||||
</if>
|
||||
<if test="bo.campusId != null">
|
||||
AND a.campus_id = #{bo.campusId}
|
||||
</if>
|
||||
AND a.deleted = '0'
|
||||
</where>
|
||||
ORDER BY a.id ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgDormCampusMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
-- ----------------------------
|
||||
-- 宿舍管理员表
|
||||
-- ----------------------------
|
||||
drop table if exists xg_dorm_manager;
|
||||
create table xg_dorm_manager (
|
||||
id bigint(20) not null comment '主键',
|
||||
name varchar(100) not null comment '管理员姓名',
|
||||
phone varchar(11) not null comment '手机号码',
|
||||
sex int(1) default 0 comment '性别(0男 1女 2未知)',
|
||||
manager_type int(1) default 0 comment '管理类型(0全校 1校区 2宿舍区 3宿舍楼)',
|
||||
scope varchar(100) comment '管理范围(校区/宿舍区/宿舍楼)',
|
||||
user_id bigint(20) comment '关联用户ID',
|
||||
remark varchar(500) comment '备注',
|
||||
create_by bigint(20) comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by bigint(20) comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
deleted char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
tenant_id varchar(20) default '000000' comment '租户编号',
|
||||
primary key (id)
|
||||
) engine=innodb comment = '宿舍管理员信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始数据
|
||||
-- ----------------------------
|
||||
INSERT INTO xg_dorm_manager(id, name, phone, sex, manager_type, scope, user_id, remark, create_by, create_time, update_by, update_time, deleted, tenant_id)
|
||||
VALUES (1, '张三', '13800000001', 0, 0, null, 2, '全校主管', 1, sysdate(), 1, sysdate(), '0', '000000');
|
||||
INSERT INTO xg_dorm_manager(id, name, phone, sex, manager_type, scope, user_id, remark, create_by, create_time, update_by, update_time, deleted, tenant_id)
|
||||
VALUES (2, '李四', '13800000002', 1, 0, null, 3, '全校副主管', 1, sysdate(), 1, sysdate(), '0', '000000');
|
||||
@@ -15,6 +15,7 @@ create table `xg_dorm_campus` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -35,6 +36,7 @@ create table `xg_dorm_area` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -58,6 +60,7 @@ create table `xg_dorm_building` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -83,6 +86,7 @@ create table `xg_dorm_room` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -131,6 +135,7 @@ create table `xg_dorm_bed_student` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -161,6 +166,7 @@ create table `xg_dorm_manager` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -182,6 +188,7 @@ create table `xg_dorm_manager_source` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -201,6 +208,7 @@ create table `xg_dorm_manager_building` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -224,6 +232,7 @@ create table `xg_dorm_college_manager` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -247,6 +256,7 @@ create table `xg_dorm_college_bed` (
|
||||
`deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
`tenant_id` bigint(20) default '0' comment '租户编号',
|
||||
`create_by` bigint(20) default null comment '创建者',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime default null comment '创建时间',
|
||||
`update_by` bigint(20) default null comment '更新者',
|
||||
`update_time` datetime default null comment '更新时间',
|
||||
@@ -257,4 +267,4 @@ create table `xg_dorm_college_bed` (
|
||||
key `idx_bed_id` (`bed_id`),
|
||||
key `idx_building_id` (`building_id`),
|
||||
key `idx_room_id` (`room_id`)
|
||||
) engine=innodb default charset=utf8mb4 comment='二级学院床位绑定关系表';
|
||||
) engine=innodb default charset=utf8mb4 comment='二级学院床位绑定关系表';
|
||||
@@ -0,0 +1,60 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733426065409, '宿舍区信息', '1946805729728077826', '1', 'dormArea', 'ssqxx/dormArea/index', 1, 0, 'C', '0', '0', 'ssqxx:dormArea:list', '#', 103, 1, sysdate(), null, null, '宿舍区信息菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733426065410, '宿舍区信息查询', 1946809733426065409, '1', '#', '', 1, 0, 'F', '0', '0', 'ssqxx:dormArea:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733426065411, '宿舍区信息新增', 1946809733426065409, '2', '#', '', 1, 0, 'F', '0', '0', 'ssqxx:dormArea:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733426065412, '宿舍区信息修改', 1946809733426065409, '3', '#', '', 1, 0, 'F', '0', '0', 'ssqxx:dormArea:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733426065413, '宿舍区信息删除', 1946809733426065409, '4', '#', '', 1, 0, 'F', '0', '0', 'ssqxx:dormArea:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733426065414, '宿舍区信息导出', 1946809733426065409, '5', '#', '', 1, 0, 'F', '0', '0', 'ssqxx:dormArea:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809734004879362, '宿舍楼信息', '1946805729728077826', '1', 'dormBuilding', 'sslxx/dormBuilding/index', 1, 0, 'C', '0', '0', 'sslxx:dormBuilding:list', '#', 103, 1, sysdate(), null, null, '宿舍楼信息菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809734004879363, '宿舍楼信息查询', 1946809734004879362, '1', '#', '', 1, 0, 'F', '0', '0', 'sslxx:dormBuilding:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809734004879364, '宿舍楼信息新增', 1946809734004879362, '2', '#', '', 1, 0, 'F', '0', '0', 'sslxx:dormBuilding:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809734004879365, '宿舍楼信息修改', 1946809734004879362, '3', '#', '', 1, 0, 'F', '0', '0', 'sslxx:dormBuilding:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809734004879366, '宿舍楼信息删除', 1946809734004879362, '4', '#', '', 1, 0, 'F', '0', '0', 'sslxx:dormBuilding:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809734004879367, '宿舍楼信息导出', 1946809734004879362, '5', '#', '', 1, 0, 'F', '0', '0', 'sslxx:dormBuilding:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733761609729, '校区信息', '1946805729728077826', '1', 'dormCampus', 'xqxx/dormCampus/index', 1, 0, 'C', '0', '0', 'xqxx:dormCampus:list', '#', 103, 1, sysdate(), null, null, '校区信息菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733761609730, '校区信息查询', 1946809733761609729, '1', '#', '', 1, 0, 'F', '0', '0', 'xqxx:dormCampus:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733761609731, '校区信息新增', 1946809733761609729, '2', '#', '', 1, 0, 'F', '0', '0', 'xqxx:dormCampus:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733761609732, '校区信息修改', 1946809733761609729, '3', '#', '', 1, 0, 'F', '0', '0', 'xqxx:dormCampus:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733761609733, '校区信息删除', 1946809733761609729, '4', '#', '', 1, 0, 'F', '0', '0', 'xqxx:dormCampus:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1946809733761609734, '校区信息导出', 1946809733761609729, '5', '#', '', 1, 0, 'F', '0', '0', 'xqxx:dormCampus:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DormManagerSourceVO, DormManagerSourceForm, DormManagerSourceQuery } from '@/api/glysqgx/dormManagerSource/types';
|
||||
|
||||
/**
|
||||
* 查询管理员授权关系列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormManagerSource = (query?: DormManagerSourceQuery): AxiosPromise<DormManagerSourceVO[]> => {
|
||||
return request({
|
||||
url: '/glysqgx/dormManagerSource/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询管理员授权关系详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormManagerSource = (id: string | number): AxiosPromise<DormManagerSourceVO> => {
|
||||
return request({
|
||||
url: '/glysqgx/dormManagerSource/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增管理员授权关系
|
||||
* @param data
|
||||
*/
|
||||
export const addDormManagerSource = (data: DormManagerSourceForm) => {
|
||||
return request({
|
||||
url: '/glysqgx/dormManagerSource',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改管理员授权关系
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormManagerSource = (data: DormManagerSourceForm) => {
|
||||
return request({
|
||||
url: '/glysqgx/dormManagerSource',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除管理员授权关系
|
||||
* @param id
|
||||
*/
|
||||
export const delDormManagerSource = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/glysqgx/dormManagerSource/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,126 @@
|
||||
export interface DormManagerSourceVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
managerId: string | number;
|
||||
|
||||
/**
|
||||
* 权限类型(1查看 2编辑 3完全管理)
|
||||
*/
|
||||
permissionType: string;
|
||||
|
||||
/**
|
||||
* 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
*/
|
||||
authType: string;
|
||||
|
||||
/**
|
||||
* 授权来源ID(对应校区ID或宿舍区ID或楼栋ID)
|
||||
*/
|
||||
authSource: number;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerSourceForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
managerId?: string | number;
|
||||
|
||||
/**
|
||||
* 权限类型(1查看 2编辑 3完全管理)
|
||||
*/
|
||||
permissionType?: string;
|
||||
|
||||
/**
|
||||
* 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
*/
|
||||
authType?: string;
|
||||
|
||||
/**
|
||||
* 授权来源ID(对应校区ID或宿舍区ID或楼栋ID)
|
||||
*/
|
||||
authSource?: number;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerSourceQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
managerId?: string | number;
|
||||
|
||||
/**
|
||||
* 权限类型(1查看 2编辑 3完全管理)
|
||||
*/
|
||||
permissionType?: string;
|
||||
|
||||
/**
|
||||
* 授权类型(1全校级 2校区级 3宿舍区级 4楼栋级)
|
||||
*/
|
||||
authType?: string;
|
||||
|
||||
/**
|
||||
* 授权来源ID(对应校区ID或宿舍区ID或楼栋ID)
|
||||
*/
|
||||
authSource?: number;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DormManagerBuildingVO, DormManagerBuildingForm, DormManagerBuildingQuery } from '@/api/glysslqxgx/dormManagerBuilding/types';
|
||||
|
||||
/**
|
||||
* 查询管理员宿舍楼权限关系列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormManagerBuilding = (query?: DormManagerBuildingQuery): AxiosPromise<DormManagerBuildingVO[]> => {
|
||||
return request({
|
||||
url: '/glysslqxgx/dormManagerBuilding/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询管理员宿舍楼权限关系详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormManagerBuilding = (id: string | number): AxiosPromise<DormManagerBuildingVO> => {
|
||||
return request({
|
||||
url: '/glysslqxgx/dormManagerBuilding/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增管理员宿舍楼权限关系
|
||||
* @param data
|
||||
*/
|
||||
export const addDormManagerBuilding = (data: DormManagerBuildingForm) => {
|
||||
return request({
|
||||
url: '/glysslqxgx/dormManagerBuilding',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改管理员宿舍楼权限关系
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormManagerBuilding = (data: DormManagerBuildingForm) => {
|
||||
return request({
|
||||
url: '/glysslqxgx/dormManagerBuilding',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除管理员宿舍楼权限关系
|
||||
* @param id
|
||||
*/
|
||||
export const delDormManagerBuilding = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/glysslqxgx/dormManagerBuilding/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,96 @@
|
||||
export interface DormManagerBuildingVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
managerId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
buildingId: string | number;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerBuildingForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
managerId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerBuildingQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
managerId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 状态(0有效 1已撤销)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DormManagerVO, DormManagerForm, DormManagerQuery } from '@/api/ssglyxx/dormManager/types';
|
||||
|
||||
/**
|
||||
* 查询宿舍管理员信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormManager = (query?: DormManagerQuery): AxiosPromise<DormManagerVO[]> => {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍管理员信息详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormManager = (id: string | number): AxiosPromise<DormManagerVO> => {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增宿舍管理员信息
|
||||
* @param data
|
||||
*/
|
||||
export const addDormManager = (data: DormManagerForm) => {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改宿舍管理员信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormManager = (data: DormManagerForm) => {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除宿舍管理员信息
|
||||
* @param id
|
||||
*/
|
||||
export const delDormManager = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,156 @@
|
||||
export interface DormManagerVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 管理员姓名
|
||||
*/
|
||||
managerName: string;
|
||||
|
||||
/**
|
||||
* 管理员类型(1全校管理员 2校区管理员 3宿舍区管理员 4宿舍楼管理员)
|
||||
*/
|
||||
managerType: string;
|
||||
|
||||
/**
|
||||
* 管理级别(1-5,1为最高)
|
||||
*/
|
||||
managerLevel: number;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 性别(0男 1女 2未知)
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 管理员姓名
|
||||
*/
|
||||
managerName?: string;
|
||||
|
||||
/**
|
||||
* 管理员类型(1全校管理员 2校区管理员 3宿舍区管理员 4宿舍楼管理员)
|
||||
*/
|
||||
managerType?: string;
|
||||
|
||||
/**
|
||||
* 管理级别(1-5,1为最高)
|
||||
*/
|
||||
managerLevel?: number;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 性别(0男 1女 2未知)
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 管理员姓名
|
||||
*/
|
||||
managerName?: string;
|
||||
|
||||
/**
|
||||
* 管理员类型(1全校管理员 2校区管理员 3宿舍区管理员 4宿舍楼管理员)
|
||||
*/
|
||||
managerType?: string;
|
||||
|
||||
/**
|
||||
* 管理级别(1-5,1为最高)
|
||||
*/
|
||||
managerLevel?: number;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 性别(0男 1女 2未知)
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DormBuildingVO, DormBuildingForm, DormBuildingQuery } from '@/api/sslxx/dormBuilding/types';
|
||||
|
||||
/**
|
||||
* 查询宿舍楼信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormBuilding = (query?: DormBuildingQuery): AxiosPromise<DormBuildingVO[]> => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍楼信息详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormBuilding = (id: string | number): AxiosPromise<DormBuildingVO> => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增宿舍楼信息
|
||||
* @param data
|
||||
*/
|
||||
export const addDormBuilding = (data: DormBuildingForm) => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改宿舍楼信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormBuilding = (data: DormBuildingForm) => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除宿舍楼信息
|
||||
* @param id
|
||||
*/
|
||||
export const delDormBuilding = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取校区选项列表
|
||||
*/
|
||||
export const listCampusOptions = (): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus/list',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取宿舍区树形数据
|
||||
* @param campusId 校区ID,如果指定则只返回该校区的宿舍区
|
||||
*/
|
||||
export const listAreaTreeData = (campusId?: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea/list',
|
||||
method: 'get',
|
||||
params: { campusId }
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,126 @@
|
||||
export interface DormBuildingVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼编码
|
||||
*/
|
||||
buildingCode: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName: string;
|
||||
|
||||
/**
|
||||
* 所属宿舍区ID
|
||||
*/
|
||||
areaId: string | number;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
campusId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼类型(1男生楼 2女生楼 3混合楼)
|
||||
*/
|
||||
buildingType: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼描述
|
||||
*/
|
||||
buildingDescription: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder: number;
|
||||
|
||||
}
|
||||
|
||||
export interface DormBuildingForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼编码
|
||||
*/
|
||||
buildingCode?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 所属宿舍区ID
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼类型(1男生楼 2女生楼 3混合楼)
|
||||
*/
|
||||
buildingType?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼描述
|
||||
*/
|
||||
buildingDescription?: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface DormBuildingQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 宿舍楼编码
|
||||
*/
|
||||
buildingCode?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 所属宿舍区ID
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼类型(1男生楼 2女生楼 3混合楼)
|
||||
*/
|
||||
buildingType?: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DormAreaVO, DormAreaForm, DormAreaQuery } from '@/api/ssqxx/dormArea/types';
|
||||
|
||||
/**
|
||||
* 查询宿舍区信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormArea = (query?: DormAreaQuery): AxiosPromise<DormAreaVO[]> => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询宿舍区信息详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormArea = (id: string | number): AxiosPromise<DormAreaVO> => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增宿舍区信息
|
||||
* @param data
|
||||
*/
|
||||
export const addDormArea = (data: DormAreaForm) => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改宿舍区信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormArea = (data: DormAreaForm) => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除宿舍区信息
|
||||
* @param id
|
||||
*/
|
||||
export const delDormArea = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,91 @@
|
||||
export interface DormAreaVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区编码
|
||||
*/
|
||||
areaCode: string;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName: string;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
campusId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区描述
|
||||
*/
|
||||
areaDescription: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder: number;
|
||||
|
||||
}
|
||||
|
||||
export interface DormAreaForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区编码
|
||||
*/
|
||||
areaCode?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 所属校区ID
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区描述
|
||||
*/
|
||||
areaDescription?: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface DormAreaQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 宿舍区编码
|
||||
*/
|
||||
areaCode?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区描述
|
||||
*/
|
||||
areaDescription?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DormCampusVO, DormCampusForm, DormCampusQuery } from '@/api/xqxx/dormCampus/types';
|
||||
|
||||
/**
|
||||
* 查询校区信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormCampus = (query?: DormCampusQuery): AxiosPromise<DormCampusVO[]> => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询校区信息详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDormCampus = (id: string | number): AxiosPromise<DormCampusVO> => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增校区信息
|
||||
* @param data
|
||||
*/
|
||||
export const addDormCampus = (data: DormCampusForm) => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改校区信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateDormCampus = (data: DormCampusForm) => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除校区信息
|
||||
* @param id
|
||||
*/
|
||||
export const delDormCampus = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,86 @@
|
||||
export interface DormCampusVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
campusCode: string;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName: string;
|
||||
|
||||
/**
|
||||
* 校区描述
|
||||
*/
|
||||
campusDescription: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormCampusForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
campusCode?: string;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 校区描述
|
||||
*/
|
||||
campusDescription?: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder?: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormCampusQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
campusCode?: string;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 获取教师列表(根据role_key=teacher筛选)
|
||||
export function getTeacherList(name?: string, managerType?: string) {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager/teachers',
|
||||
method: 'get',
|
||||
params: { name, managerType }
|
||||
});
|
||||
}
|
||||
|
||||
// 查询宿舍管理员列表
|
||||
export function listDormManager(query: any) {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询宿舍管理员详情
|
||||
export function getDormManager(id: number) {
|
||||
return request({
|
||||
url: `/ssglyxx/dormManager/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 新增宿舍管理员
|
||||
export function addDormManager(data: any) {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 修改宿舍管理员
|
||||
export function updateDormManager(data: any) {
|
||||
return request({
|
||||
url: '/ssglyxx/dormManager',
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除宿舍管理员
|
||||
export function deleteDormManager(ids: number | number[]) {
|
||||
return request({
|
||||
url: `/ssglyxx/dormManager/${ids instanceof Array ? ids.join(',') : ids}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,540 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="宿舍楼编码" prop="buildingCode">
|
||||
<el-input v-model="queryParams.buildingCode" placeholder="请输入宿舍楼编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="宿舍楼名称" prop="buildingName">
|
||||
<el-input v-model="queryParams.buildingName" placeholder="请输入宿舍楼名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属校区" prop="campusId">
|
||||
<el-select v-model="queryParams.campusId" placeholder="请选择所属校区" clearable @change="handleCampusChange">
|
||||
<el-option v-for="item in campusList" :key="item.id" :label="item.campusName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属宿舍区" prop="areaId">
|
||||
<el-tree-select
|
||||
v-model="queryParams.areaId"
|
||||
:data="areaTreeData"
|
||||
:props="{ label: 'areaName', value: 'id' }"
|
||||
placeholder="请选择所属宿舍区"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="宿舍楼类型" prop="buildingType">
|
||||
<el-select v-model="queryParams.buildingType" placeholder="请选择宿舍楼类型" clearable>
|
||||
<el-option v-for="dict in dorm_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['sslxx:dormBuilding:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['sslxx:dormBuilding:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['sslxx:dormBuilding:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['sslxx:dormBuilding:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="dormBuildingList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="宿舍楼编码" align="center" prop="buildingCode" />
|
||||
<el-table-column label="宿舍楼名称" align="center" prop="buildingName" />
|
||||
<el-table-column label="所属校区" align="center" prop="campusName" />
|
||||
<el-table-column label="所属宿舍区" align="center" prop="areaName" />
|
||||
<el-table-column label="宿舍楼类型" align="center" prop="buildingType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="dorm_type" :value="scope.row.buildingType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宿舍楼描述" align="center" prop="buildingDescription" />
|
||||
<el-table-column label="排序号" align="center" prop="sortOrder" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['sslxx:dormBuilding:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['sslxx:dormBuilding:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改宿舍楼信息对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="dormBuildingFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="所属校区" prop="campusId">
|
||||
<el-select v-model="form.campusId" placeholder="请选择所属校区" clearable @change="handleFormCampusChange">
|
||||
<el-option v-for="item in campusList" :key="item.id" :label="item.campusName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属宿舍区" prop="areaId">
|
||||
<el-tree-select
|
||||
v-model="form.areaId"
|
||||
:data="formAreaTreeData"
|
||||
:props="{ label: 'areaName', value: 'id' }"
|
||||
placeholder="请选择所属宿舍区"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍楼编码" prop="buildingCode">
|
||||
<el-input v-model="form.buildingCode" placeholder="请输入宿舍楼编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍楼名称" prop="buildingName">
|
||||
<el-input v-model="form.buildingName" placeholder="请输入宿舍楼名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍楼类型" prop="buildingType">
|
||||
<el-select v-model="form.buildingType" placeholder="请选择宿舍楼类型">
|
||||
<el-option v-for="dict in dorm_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍楼描述" prop="buildingDescription">
|
||||
<el-input v-model="form.buildingDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序号" prop="sortOrder">
|
||||
<el-input v-model="form.sortOrder" placeholder="请输入排序号" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DormBuilding" lang="ts">
|
||||
import {
|
||||
listDormBuilding,
|
||||
getDormBuilding,
|
||||
delDormBuilding,
|
||||
addDormBuilding,
|
||||
updateDormBuilding,
|
||||
listCampusOptions,
|
||||
listAreaTreeData
|
||||
} from '@/api/sslxx/dormBuilding';
|
||||
import { DormBuildingVO, DormBuildingQuery, DormBuildingForm } from '@/api/sslxx/dormBuilding/types';
|
||||
import { DormCampusVO } from '@/api/xqxx/dormCampus/types';
|
||||
import { DormAreaVO } from '@/api/ssqxx/dormArea/types';
|
||||
import { getCurrentInstance, ComponentInternalInstance, ref, reactive, toRefs, onMounted } from 'vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { dorm_type } = toRefs<any>(proxy?.useDict('dorm_type'));
|
||||
|
||||
const dormBuildingList = ref<DormBuildingVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const campusList = ref<DormCampusVO[]>([]); // 校区列表
|
||||
const areaTreeData = ref<any[]>([]); // 宿舍区树形数据
|
||||
const formAreaTreeData = ref<any[]>([]); // 表单宿舍区树形数据
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const dormBuildingFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: DormBuildingForm = {
|
||||
id: undefined,
|
||||
buildingCode: undefined,
|
||||
buildingName: undefined,
|
||||
areaId: undefined,
|
||||
campusId: undefined,
|
||||
buildingType: undefined,
|
||||
buildingDescription: undefined,
|
||||
sortOrder: undefined
|
||||
};
|
||||
const data = reactive<PageData<DormBuildingForm, DormBuildingQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
buildingCode: undefined,
|
||||
buildingName: undefined,
|
||||
areaId: undefined,
|
||||
campusId: undefined,
|
||||
buildingType: undefined,
|
||||
sortOrder: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
buildingCode: [{ required: true, message: '宿舍楼编码不能为空', trigger: 'blur' }],
|
||||
buildingName: [{ required: true, message: '宿舍楼名称不能为空', trigger: 'blur' }],
|
||||
areaId: [{ required: true, message: '所属宿舍区ID不能为空', trigger: 'blur' }],
|
||||
campusId: [{ required: true, message: '所属校区ID不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询宿舍楼信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDormBuilding(queryParams.value);
|
||||
dormBuildingList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 加载校区数据 */
|
||||
const loadCampusOptions = async () => {
|
||||
const res = await listCampusOptions();
|
||||
campusList.value = res.rows || [];
|
||||
};
|
||||
|
||||
/** 加载宿舍区树形数据 */
|
||||
const loadAreaTreeData = async (campusId?: string | number) => {
|
||||
const res = await listAreaTreeData(campusId);
|
||||
if (campusId) {
|
||||
// 如果指定了校区ID,只展示该校区的宿舍区
|
||||
areaTreeData.value = res.rows || [];
|
||||
formAreaTreeData.value = res.rows || []; // 同时更新表单树形数据
|
||||
} else {
|
||||
// 如果没有指定校区ID,按照校区分组展示宿舍区
|
||||
const campusMap = new Map();
|
||||
|
||||
// 先将校区列表转为Map
|
||||
campusList.value.forEach((campus) => {
|
||||
campusMap.set(campus.id, {
|
||||
id: campus.id,
|
||||
areaName: campus.campusName,
|
||||
children: []
|
||||
});
|
||||
});
|
||||
|
||||
// 将宿舍区按校区分组
|
||||
const areas = res.rows || [];
|
||||
areas.forEach((area: DormAreaVO) => {
|
||||
if (campusMap.has(area.campusId)) {
|
||||
campusMap.get(area.campusId).children.push({
|
||||
id: area.id,
|
||||
areaName: area.areaName
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 转换为树形结构
|
||||
areaTreeData.value = Array.from(campusMap.values());
|
||||
formAreaTreeData.value = Array.from(campusMap.values());
|
||||
}
|
||||
};
|
||||
|
||||
/** 校区选择变化处理函数 */
|
||||
const handleCampusChange = (value: string | number) => {
|
||||
queryParams.value.areaId = undefined; // 清空已选择的宿舍区
|
||||
loadAreaTreeData(value);
|
||||
};
|
||||
|
||||
/** 表单校区选择变化处理函数 */
|
||||
const handleFormCampusChange = (value: string | number) => {
|
||||
form.value.areaId = undefined; // 清空已选择的宿舍区
|
||||
loadFormAreaTreeData(value);
|
||||
};
|
||||
|
||||
/** 加载表单宿舍区树形数据 */
|
||||
const loadFormAreaTreeData = async (campusId?: string | number) => {
|
||||
const res = await listAreaTreeData(campusId);
|
||||
if (campusId) {
|
||||
// 如果指定了校区ID,只展示该校区的宿舍区
|
||||
formAreaTreeData.value = res.rows || [];
|
||||
} else {
|
||||
// 如果没有指定校区ID,按照校区分组展示宿舍区
|
||||
const campusMap = new Map();
|
||||
|
||||
// 先将校区列表转为Map
|
||||
campusList.value.forEach((campus) => {
|
||||
campusMap.set(campus.id, {
|
||||
id: campus.id,
|
||||
areaName: campus.campusName,
|
||||
children: []
|
||||
});
|
||||
});
|
||||
|
||||
// 将宿舍区按校区分组
|
||||
const areas = res.rows || [];
|
||||
areas.forEach((area: DormAreaVO) => {
|
||||
if (campusMap.has(area.campusId)) {
|
||||
campusMap.get(area.campusId).children.push({
|
||||
id: area.id,
|
||||
areaName: area.areaName
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 转换为树形结构
|
||||
formAreaTreeData.value = Array.from(campusMap.values());
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
dormBuildingFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DormBuildingVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加宿舍楼信息';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DormBuildingVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDormBuilding(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
// 加载表单中的宿舍区数据
|
||||
if (form.value.campusId) {
|
||||
loadFormAreaTreeData(form.value.campusId);
|
||||
}
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改宿舍楼信息';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
dormBuildingFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateDormBuilding(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addDormBuilding(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DormBuildingVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
||||
let confirmMsg = '';
|
||||
if (row) {
|
||||
confirmMsg = `是否确认删除宿舍楼信息编号为"${row?.buildingName}"的数据项?`;
|
||||
} else if (Array.isArray(ids.value) && ids.value.length > 1) {
|
||||
confirmMsg = `是否确认删除选中的${ids.value.length}个宿舍楼信息?`;
|
||||
} else {
|
||||
confirmMsg = '是否确认删除选中的宿舍楼信息?';
|
||||
}
|
||||
await proxy?.$modal.confirm(confirmMsg).finally(() => (loading.value = false));
|
||||
|
||||
await delDormBuilding(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'sslxx/dormBuilding/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`dormBuilding_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
loadCampusOptions().then(() => {
|
||||
loadAreaTreeData();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.image-gallery {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.image-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 6px;
|
||||
background-color: #fff;
|
||||
padding: 4px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.image-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.no-image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.no-image-text {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.table-no-image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.table-no-image-text {
|
||||
color: #909399;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.view-text {
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.view-description {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
overflow-y: auto;
|
||||
}
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,392 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="宿舍区编码" prop="areaCode">
|
||||
<el-input v-model="queryParams.areaCode" placeholder="请输入宿舍区编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="宿舍区名称" prop="areaName">
|
||||
<el-input v-model="queryParams.areaName" placeholder="请输入宿舍区名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="6">
|
||||
<el-form-item label="宿舍区描述" prop="areaDescription">
|
||||
<el-input v-model="queryParams.areaDescription" placeholder="请输入宿舍区描述" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['ssqxx:dormArea:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['ssqxx:dormArea:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['ssqxx:dormArea:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['ssqxx:dormArea:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="dormAreaList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="宿舍区编码" align="center" prop="areaCode" label-width="100px" />
|
||||
<el-table-column label="宿舍区名称" align="center" prop="areaName" label-width="100px" />
|
||||
<el-table-column label="所属校区ID" align="center" prop="campusId" label-width="100px" />
|
||||
<el-table-column label="所属校区" align="center" prop="campusName" label-width="100px" />
|
||||
<el-table-column label="宿舍区描述" align="center" prop="areaDescription" />
|
||||
<el-table-column label="排序号" align="center" prop="sortOrder" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ssqxx:dormArea:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['ssqxx:dormArea:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改宿舍区信息对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="dormAreaFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="所属校区" prop="campusId">
|
||||
<el-select v-model="form.campusId" placeholder="请选择所属校区" filterable clearable>
|
||||
<el-option v-for="item in campusOptions" :key="item.id" :label="item.campusName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍区编码" prop="areaCode">
|
||||
<el-input v-model="form.areaCode" placeholder="请输入宿舍区编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍区名称" prop="areaName">
|
||||
<el-input v-model="form.areaName" placeholder="请输入宿舍区名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍区描述" prop="areaDescription">
|
||||
<el-input v-model="form.areaDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序号" prop="sortOrder">
|
||||
<el-input v-model="form.sortOrder" placeholder="请输入排序号" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DormArea" lang="ts">
|
||||
import { listDormArea, getDormArea, delDormArea, addDormArea, updateDormArea } from '@/api/ssqxx/dormArea';
|
||||
import { DormAreaVO, DormAreaQuery, DormAreaForm } from '@/api/ssqxx/dormArea/types';
|
||||
import { listDormCampus } from '@/api/xqxx/dormCampus';
|
||||
import type { DormCampusVO } from '@/api/xqxx/dormCampus/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const dormAreaList = ref<DormAreaVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const dormAreaFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const campusOptions = ref<DormCampusVO[]>([]);
|
||||
|
||||
const initFormData: DormAreaForm = {
|
||||
id: undefined,
|
||||
areaCode: undefined,
|
||||
areaName: undefined,
|
||||
campusId: undefined,
|
||||
areaDescription: undefined,
|
||||
sortOrder: undefined
|
||||
};
|
||||
const data = reactive<PageData<DormAreaForm, DormAreaQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
areaCode: undefined,
|
||||
areaName: undefined,
|
||||
areaDescription: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
areaCode: [{ required: true, message: '宿舍区编码不能为空', trigger: 'blur' }],
|
||||
areaName: [{ required: true, message: '宿舍区名称不能为空', trigger: 'blur' }],
|
||||
campusId: [{ required: true, message: '所属校区ID不能为空', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询宿舍区信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDormArea(queryParams.value);
|
||||
dormAreaList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
dormAreaFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DormAreaVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = async () => {
|
||||
reset();
|
||||
await loadCampusOptions();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加宿舍区信息';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DormAreaVO) => {
|
||||
reset();
|
||||
await loadCampusOptions();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDormArea(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改宿舍区信息';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
dormAreaFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateDormArea(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addDormArea(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DormAreaVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
let confirmMsg = '';
|
||||
if (row) {
|
||||
confirmMsg = `是否确认删除宿舍区信息编号为"${row?.areaName}"的数据项?`;
|
||||
} else if (Array.isArray(ids.value) && ids.value.length > 1) {
|
||||
confirmMsg = `是否确认删除选中的${ids.value.length}个宿舍区信息?`;
|
||||
} else {
|
||||
confirmMsg = '是否确认删除选中的宿舍区信息?';
|
||||
}
|
||||
await proxy?.$modal.confirm(confirmMsg).finally(() => (loading.value = false));
|
||||
await delDormArea(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'ssqxx/dormArea/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`dormArea_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
const loadCampusOptions = async () => {
|
||||
const res = await listDormCampus();
|
||||
// 兼容分页和非分页返回
|
||||
campusOptions.value = Array.isArray(res) ? res : res.rows || [];
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.image-gallery {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.image-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 6px;
|
||||
background-color: #fff;
|
||||
padding: 4px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.image-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.no-image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.no-image-text {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.table-no-image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.table-no-image-text {
|
||||
color: #909399;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.view-text {
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.view-description {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
overflow-y: auto;
|
||||
}
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,250 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="校区编码" prop="campusCode">
|
||||
<el-input v-model="queryParams.campusCode" placeholder="请输入校区编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="校区名称" prop="campusName">
|
||||
<el-input v-model="queryParams.campusName" placeholder="请输入校区名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['xqxx:dormCampus:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['xqxx:dormCampus:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['xqxx:dormCampus:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['xqxx:dormCampus:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="dormCampusList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="校区编码" align="center" prop="campusCode" />
|
||||
<el-table-column label="校区名称" align="center" prop="campusName" />
|
||||
<el-table-column label="校区描述" align="center" prop="campusDescription" />
|
||||
<el-table-column label="排序号" align="center" prop="sortOrder" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" plain icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['xqxx:dormCampus:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" plain icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['xqxx:dormCampus:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改校区信息对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="dormCampusFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="校区编码" prop="campusCode">
|
||||
<el-input v-model="form.campusCode" placeholder="请输入校区编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="校区名称" prop="campusName">
|
||||
<el-input v-model="form.campusName" placeholder="请输入校区名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="校区描述" prop="campusDescription">
|
||||
<el-input v-model="form.campusDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序号" prop="sortOrder">
|
||||
<el-input v-model="form.sortOrder" placeholder="请输入排序号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DormCampus" lang="ts">
|
||||
import { listDormCampus, getDormCampus, delDormCampus, addDormCampus, updateDormCampus } from '@/api/xqxx/dormCampus';
|
||||
import { DormCampusVO, DormCampusQuery, DormCampusForm } from '@/api/xqxx/dormCampus/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const dormCampusList = ref<DormCampusVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const dormCampusFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: DormCampusForm = {
|
||||
id: undefined,
|
||||
campusCode: undefined,
|
||||
campusName: undefined,
|
||||
campusDescription: undefined,
|
||||
sortOrder: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<DormCampusForm, DormCampusQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
campusCode: undefined,
|
||||
campusName: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
campusCode: [{ required: true, message: '校区编码不能为空', trigger: 'blur' }],
|
||||
campusName: [{ required: true, message: '校区名称不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询校区信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDormCampus(queryParams.value);
|
||||
dormCampusList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
dormCampusFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DormCampusVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加校区信息';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DormCampusVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDormCampus(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改校区信息';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
dormCampusFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateDormCampus(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addDormCampus(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DormCampusVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
let confirmMsg = '';
|
||||
if (row) {
|
||||
confirmMsg = `是否确认删除校区信息编号为"${row.campusName}"的数据项?`;
|
||||
} else if (Array.isArray(ids.value) && ids.value.length > 1) {
|
||||
confirmMsg = `是否确认删除选中的${ids.value.length}个校区信息?`;
|
||||
} else {
|
||||
confirmMsg = '是否确认删除选中的校区信息?';
|
||||
}
|
||||
await proxy?.$modal.confirm(confirmMsg).finally(() => (loading.value = false));
|
||||
await delDormCampus(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'xqxx/dormCampus/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`dormCampus_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,355 @@
|
||||
<template>
|
||||
<el-dialog :title="getDialogTitle()" v-model="dialogVisible" width="500px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<template v-if="mode === 'edit'">
|
||||
<el-input v-model="form.name" disabled class="w-full" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-select
|
||||
v-model="form.name"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入姓名"
|
||||
:remote-method="queryTeachers"
|
||||
:loading="loading"
|
||||
clearable
|
||||
class="w-full"
|
||||
@change="handleTeacherSelect"
|
||||
@focus="handleFocus"
|
||||
>
|
||||
<el-option v-for="item in teacherOptions" :key="item.value" :label="item.label" :value="item.value" :data-info="item" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入手机号码" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-radio-group v-model="form.sex">
|
||||
<el-radio :label="0">男</el-radio>
|
||||
<el-radio :label="1">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, reactive, computed, watch, onMounted } from 'vue';
|
||||
import { getTeacherList } from '@/api/xsssgly/dormManager';
|
||||
import { addDormManager, updateDormManager } from '@/api/ssglyxx/dormManager/index';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'AdminDialog',
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'add'
|
||||
},
|
||||
admin: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'school'
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue', 'submit'],
|
||||
setup(props, { emit }) {
|
||||
const loading = ref(false);
|
||||
const teacherOptions = ref<any[]>([]);
|
||||
|
||||
// 根据类型获取对话框标题
|
||||
const getDialogTitle = () => {
|
||||
const typeText =
|
||||
{
|
||||
'school': '全校',
|
||||
'campus': '校区',
|
||||
'area': '宿舍区',
|
||||
'building': '宿舍楼'
|
||||
}[props.type] || '';
|
||||
|
||||
return props.mode === 'add' ? `新增${typeText}管理员` : `编辑${typeText}管理员`;
|
||||
};
|
||||
|
||||
// 对话框可见性
|
||||
const dialogVisible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => {
|
||||
emit('update:modelValue', val);
|
||||
}
|
||||
});
|
||||
|
||||
const formRef = ref();
|
||||
const form = reactive({
|
||||
id: null,
|
||||
name: '',
|
||||
phone: '',
|
||||
remark: '',
|
||||
nickName: '',
|
||||
sex: 0,
|
||||
userId: null // 存储选中的用户ID
|
||||
});
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请选择姓名', trigger: 'change' }],
|
||||
phone: [
|
||||
{ required: true, message: '请输入手机号码', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
|
||||
],
|
||||
sex: [{ required: true, message: '请选择性别', trigger: 'change' }]
|
||||
};
|
||||
|
||||
// 使用真实API查询教师用户
|
||||
const queryTeachers = async (query: string) => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getTeacherList(
|
||||
query,
|
||||
(() => {
|
||||
switch (props.type) {
|
||||
case 'school':
|
||||
return '1';
|
||||
case 'campus':
|
||||
return '2';
|
||||
case 'area':
|
||||
return '3';
|
||||
case 'building':
|
||||
return '4';
|
||||
default:
|
||||
return '1';
|
||||
}
|
||||
})()
|
||||
);
|
||||
if (res.code === 200 && res.data) {
|
||||
teacherOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
value: item.value,
|
||||
label: item.label,
|
||||
username: item.username,
|
||||
nickName: item.label,
|
||||
userId: item.value, // 直接使用API返回的value作为userId
|
||||
phonenumber: item.phonenumber, // 保存手机号码
|
||||
sex: item.sex // 保存性别
|
||||
};
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取教师数据失败', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 监听admin属性变化,更新表单
|
||||
watch(
|
||||
() => props.admin,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
Object.assign(form, newVal);
|
||||
// 如果没有性别值,设置默认值0
|
||||
if (form.sex === undefined) {
|
||||
form.sex = 0;
|
||||
} else {
|
||||
// 确保性别值为数字类型
|
||||
form.sex = Number(form.sex);
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
// 选择教师后处理逻辑
|
||||
const handleTeacherSelect = (value: any) => {
|
||||
const selectedTeacher = teacherOptions.value.find((item) => item.value === value);
|
||||
if (selectedTeacher) {
|
||||
form.userId = selectedTeacher.userId;
|
||||
// 自动填充手机号码和性别
|
||||
form.phone = selectedTeacher.phonenumber || '';
|
||||
// 确保性别值为数字类型
|
||||
form.sex = selectedTeacher.sex !== undefined ? Number(selectedTeacher.sex) : 0;
|
||||
form.nickName = selectedTeacher.nickName;
|
||||
form.name = selectedTeacher.label;
|
||||
// form.id = selectedTeacher.userId;
|
||||
form.remark = '';
|
||||
console.log('选中教师信息:', selectedTeacher, '转换后性别值:', form.sex);
|
||||
}
|
||||
};
|
||||
|
||||
// 处理下拉框获得焦点事件
|
||||
const handleFocus = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getTeacherList(
|
||||
'',
|
||||
(() => {
|
||||
switch (props.type) {
|
||||
case 'school':
|
||||
return '1';
|
||||
case 'campus':
|
||||
return '2';
|
||||
case 'area':
|
||||
return '3';
|
||||
case 'building':
|
||||
return '4';
|
||||
default:
|
||||
return '1';
|
||||
}
|
||||
})()
|
||||
);
|
||||
if (res.code === 200 && res.data) {
|
||||
teacherOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
value: item.value,
|
||||
label: item.label,
|
||||
username: item.username,
|
||||
userId: item.value,
|
||||
nickName: item.label,
|
||||
phonenumber: item.phonenumber, // 保存手机号码
|
||||
sex: item.sex // 保存性别
|
||||
};
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取教师数据失败', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 页面加载时预加载一些教师数据
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const res = await getTeacherList(
|
||||
'',
|
||||
(() => {
|
||||
switch (props.type) {
|
||||
case 'school':
|
||||
return '1';
|
||||
case 'campus':
|
||||
return '2';
|
||||
case 'area':
|
||||
return '3';
|
||||
case 'building':
|
||||
return '4';
|
||||
default:
|
||||
return '1';
|
||||
}
|
||||
})()
|
||||
);
|
||||
if (res.code === 200 && res.data) {
|
||||
teacherOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
value: item.value,
|
||||
label: item.label,
|
||||
username: item.username,
|
||||
userId: item.value,
|
||||
nickName: item.label,
|
||||
phonenumber: item.phonenumber, // 保存手机号码
|
||||
sex: item.sex // 保存性别
|
||||
};
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('初始化教师数据失败', error);
|
||||
}
|
||||
});
|
||||
|
||||
// 提交表单
|
||||
const submitForm = async () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (!valid) return;
|
||||
// 字段映射
|
||||
const payload: any = {
|
||||
id: form.id,
|
||||
managerName: form.nickName || form.name,
|
||||
gender: String(form.sex),
|
||||
userId: form.userId,
|
||||
phone: form.phone,
|
||||
remark: form.remark,
|
||||
// 下面字段可根据props.type补充
|
||||
managerType: (() => {
|
||||
switch (props.type) {
|
||||
case 'school':
|
||||
return '1';
|
||||
case 'campus':
|
||||
return '2';
|
||||
case 'area':
|
||||
return '3';
|
||||
case 'building':
|
||||
return '4';
|
||||
default:
|
||||
return '1';
|
||||
}
|
||||
})(),
|
||||
managerLevel: (() => {
|
||||
switch (props.type) {
|
||||
case 'school':
|
||||
return 1;
|
||||
case 'campus':
|
||||
return 2;
|
||||
case 'area':
|
||||
return 3;
|
||||
case 'building':
|
||||
return 4;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
})()
|
||||
};
|
||||
console.log(payload);
|
||||
try {
|
||||
if (props.mode === 'add') {
|
||||
await addDormManager(payload);
|
||||
ElMessage.success('新增成功');
|
||||
} else if (props.mode === 'edit') {
|
||||
await updateDormManager(payload);
|
||||
ElMessage.success('修改成功');
|
||||
}
|
||||
emit('submit', { ...form }); // 通知父组件刷新
|
||||
dialogVisible.value = false;
|
||||
} catch (e) {
|
||||
ElMessage.error(props.mode === 'add' ? '新增失败' : '修改失败');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
dialogVisible,
|
||||
form,
|
||||
formRef,
|
||||
loading,
|
||||
teacherOptions,
|
||||
rules,
|
||||
getDialogTitle,
|
||||
queryTeachers,
|
||||
handleTeacherSelect,
|
||||
handleFocus,
|
||||
submitForm
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button type="primary" @click="$emit('add')" style="margin-bottom: 16px">新增管理员</el-button>
|
||||
<el-table :data="data" border style="width: 100%">
|
||||
<el-table-column prop="name" label="姓名" width="120" />
|
||||
<el-table-column prop="phone" label="手机号" width="150" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-if="showScope" prop="scope" label="数据范围" />
|
||||
<el-table-column label="操作" width="220">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="showScope" size="small" @click="$emit('scope', row)">数据范围</el-button>
|
||||
<el-button size="small" @click="$emit('edit', row)">修改</el-button>
|
||||
<el-button size="small" type="danger" @click="$emit('delete', row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
defineProps<{ data: any[]; showScope?: boolean }>();
|
||||
</script>
|
||||
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<el-dialog title="分配管理范围" v-model="dialogVisible" width="500px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" label-width="100px">
|
||||
<el-form-item label="管理员姓名">
|
||||
<span>{{ admin?.name }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理范围" prop="scope">
|
||||
<el-select
|
||||
v-model="form.scope"
|
||||
placeholder="请选择管理范围"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
filterable
|
||||
:multiple="isCampusType"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
>
|
||||
<el-option v-for="item in scopeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, reactive, computed, watch, onMounted } from 'vue';
|
||||
import { listDormCampus } from '@/api/xqxx/dormCampus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ScopeDialog',
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
admin: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue', 'submit'],
|
||||
setup(props, { emit }) {
|
||||
const dialogVisible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => {
|
||||
emit('update:modelValue', val);
|
||||
}
|
||||
});
|
||||
|
||||
// 判断是否为校区类型的计算属性
|
||||
const isCampusType = computed(() => props.type === 'campus');
|
||||
|
||||
const formRef = ref();
|
||||
const form = reactive({
|
||||
scope: isCampusType.value ? [] : ''
|
||||
});
|
||||
|
||||
// 选项数据
|
||||
const scopeOptions = ref<any[]>([]);
|
||||
|
||||
// 根据类型加载选项
|
||||
const loadScopeOptions = async () => {
|
||||
if (isCampusType.value) {
|
||||
// 调用API获取校区列表
|
||||
const res = await listDormCampus();
|
||||
// 适配el-select格式
|
||||
console.log(res);
|
||||
scopeOptions.value = (res.rows || []).map((item: any) => ({
|
||||
value: item.id,
|
||||
label: item.campusName
|
||||
}));
|
||||
// 校区支持多选,初始化为数组
|
||||
form.scope = Array.isArray(form.scope) ? form.scope : [];
|
||||
} else if (props.type === 'area') {
|
||||
scopeOptions.value = [
|
||||
{ value: '1号宿舍区', label: '1号宿舍区' },
|
||||
{ value: '2号宿舍区', label: '2号宿舍区' },
|
||||
{ value: '3号宿舍区', label: '3号宿舍区' }
|
||||
];
|
||||
// 非校区为单选,初始化为字符串
|
||||
form.scope = Array.isArray(form.scope) ? '' : form.scope;
|
||||
} else if (props.type === 'building') {
|
||||
scopeOptions.value = [
|
||||
{ value: '1号楼', label: '1号楼' },
|
||||
{ value: '2号楼', label: '2号楼' },
|
||||
{ value: '3号楼', label: '3号楼' },
|
||||
{ value: '4号楼', label: '4号楼' }
|
||||
];
|
||||
// 非校区为单选,初始化为字符串
|
||||
form.scope = Array.isArray(form.scope) ? '' : form.scope;
|
||||
} else {
|
||||
scopeOptions.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
// 监听type变化,动态加载选项
|
||||
watch(
|
||||
() => props.type,
|
||||
() => {
|
||||
loadScopeOptions();
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.admin,
|
||||
(newVal) => {
|
||||
if (newVal && newVal.scope) {
|
||||
// 根据类型决定如何设置scope值
|
||||
if (isCampusType.value) {
|
||||
// 校区支持多选,确保scope是数组
|
||||
form.scope = Array.isArray(newVal.scope) ? newVal.scope : [newVal.scope];
|
||||
} else {
|
||||
// 其他类型是单选
|
||||
form.scope = newVal.scope;
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
const submitForm = () => {
|
||||
emit('submit', form.scope);
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
return {
|
||||
dialogVisible,
|
||||
form,
|
||||
formRef,
|
||||
scopeOptions,
|
||||
submitForm,
|
||||
isCampusType
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,445 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<el-card>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="全校管理员" name="school">
|
||||
<!-- 检索栏(全校管理员) -->
|
||||
<div class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form :inline="true" :model="schoolSearchForm" class="search-form">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="schoolSearchForm.name" placeholder="请输入姓名" clearable @keyup.enter="handleSearch('school')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码">
|
||||
<el-input v-model="schoolSearchForm.phone" placeholder="请输入手机号码" clearable @keyup.enter="handleSearch('school')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch('school')">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset('school')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
<!-- 按钮+列表区域(参考校区信息管理) -->
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="onAdd('school')">新增管理员</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :data="filteredAdmins('school')" border>
|
||||
<el-table-column prop="name" label="姓名" align="center" />
|
||||
<el-table-column prop="phone" label="手机号码" align="center" />
|
||||
<el-table-column prop="sex" label="性别" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.sex === 0 ? '男' : '女' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" align="center" />
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" plain icon="Edit" @click="onEdit('school', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" plain icon="Delete" @click="onDelete('school', scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="校区管理员" name="campus">
|
||||
<!-- 检索栏(校区管理员) -->
|
||||
<div class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form :inline="true" :model="campusSearchForm" class="search-form">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="campusSearchForm.name" placeholder="请输入姓名" clearable @keyup.enter="handleSearch('campus')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码">
|
||||
<el-input v-model="campusSearchForm.phone" placeholder="请输入手机号码" clearable @keyup.enter="handleSearch('campus')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch('campus')">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset('campus')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="onAdd('campus')">新增管理员</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :data="filteredAdmins('campus')" border>
|
||||
<el-table-column prop="name" label="姓名" align="center" />
|
||||
<el-table-column prop="phone" label="手机号码" align="center" />
|
||||
<el-table-column prop="sex" label="性别" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.sex === 0 ? '男' : '女' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="scope" label="校区" align="center" />
|
||||
<el-table-column prop="remark" label="备注" align="center" />
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" plain icon="Edit" @click="onEdit('campus', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="分配范围" placement="top">
|
||||
<el-button link type="warning" plain icon="Setting" @click="onScope('campus', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" plain icon="Delete" @click="onDelete('campus', scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="宿舍区管理员" name="area">
|
||||
<!-- 检索栏(宿舍区管理员) -->
|
||||
<div class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form :inline="true" :model="areaSearchForm" class="search-form">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="areaSearchForm.name" placeholder="请输入姓名" clearable @keyup.enter="handleSearch('area')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码">
|
||||
<el-input v-model="areaSearchForm.phone" placeholder="请输入手机号码" clearable @keyup.enter="handleSearch('area')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch('area')">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset('area')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="onAdd('area')">新增管理员</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :data="filteredAdmins('area')" border>
|
||||
<el-table-column prop="name" label="姓名" align="center" />
|
||||
<el-table-column prop="phone" label="手机号码" align="center" />
|
||||
<el-table-column prop="sex" label="性别" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.sex === 0 ? '男' : '女' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="scope" label="宿舍区" align="center" />
|
||||
<el-table-column prop="remark" label="备注" align="center" />
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" plain icon="Edit" @click="onEdit('area', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="分配范围" placement="top">
|
||||
<el-button link type="warning" plain icon="Setting" @click="onScope('area', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" plain icon="Delete" @click="onDelete('area', scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="宿舍楼管理员" name="building">
|
||||
<!-- 检索栏(宿舍楼管理员) -->
|
||||
<div class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form :inline="true" :model="buildingSearchForm" class="search-form">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="buildingSearchForm.name" placeholder="请输入姓名" clearable @keyup.enter="handleSearch('building')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码">
|
||||
<el-input v-model="buildingSearchForm.phone" placeholder="请输入手机号码" clearable @keyup.enter="handleSearch('building')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch('building')">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset('building')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="onAdd('building')">新增管理员</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :data="filteredAdmins('building')" border>
|
||||
<el-table-column prop="name" label="姓名" align="center" />
|
||||
<el-table-column prop="phone" label="手机号码" align="center" />
|
||||
<el-table-column prop="sex" label="性别" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.sex === 0 ? '男' : '女' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="scope" label="宿舍楼" align="center" />
|
||||
<el-table-column prop="remark" label="备注" align="center" />
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" plain icon="Edit" @click="onEdit('building', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="分配范围" placement="top">
|
||||
<el-button link type="warning" plain icon="Setting" @click="onScope('building', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" plain icon="Delete" @click="onDelete('building', scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<admin-dialog v-model="dialogVisible" :mode="dialogMode" :admin="currentAdmin" :type="activeTab" @submit="onDialogSubmit" />
|
||||
<scope-dialog v-model="scopeDialogVisible" :admin="currentAdmin" :type="scopeType" @submit="onScopeSubmit" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import AdminDialog from './components/AdminDialog.vue';
|
||||
import ScopeDialog from './components/ScopeDialog.vue';
|
||||
import axios from 'axios';
|
||||
import { listDormManager } from '@/api/ssglyxx/dormManager';
|
||||
import { delDormManager } from '@/api/ssglyxx/dormManager';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
|
||||
const activeTab = ref('school');
|
||||
|
||||
// 各tab独立检索表单
|
||||
const schoolSearchForm = reactive({ name: '', phone: '' });
|
||||
const campusSearchForm = reactive({ name: '', phone: '' });
|
||||
const areaSearchForm = reactive({ name: '', phone: '' });
|
||||
const buildingSearchForm = reactive({ name: '', phone: '' });
|
||||
|
||||
// 管理员数据
|
||||
const schoolAdmins = ref([]);
|
||||
const campusAdmins = ref([]);
|
||||
const areaAdmins = ref([]);
|
||||
const buildingAdmins = ref([]);
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const dialogMode = ref<'add' | 'edit'>('add');
|
||||
const currentAdmin = ref<any>(null);
|
||||
const scopeDialogVisible = ref(false);
|
||||
const scopeType = ref('');
|
||||
|
||||
// API请求方法
|
||||
async function fetchAdmins(type: string) {
|
||||
let managerType = 1;
|
||||
switch (type) {
|
||||
case 'school':
|
||||
managerType = 1;
|
||||
break;
|
||||
case 'campus':
|
||||
managerType = 2;
|
||||
break;
|
||||
case 'area':
|
||||
managerType = 3;
|
||||
break;
|
||||
case 'building':
|
||||
managerType = 4;
|
||||
break;
|
||||
}
|
||||
// 检索条件
|
||||
let form;
|
||||
switch (type) {
|
||||
case 'school':
|
||||
form = schoolSearchForm;
|
||||
break;
|
||||
case 'campus':
|
||||
form = campusSearchForm;
|
||||
break;
|
||||
case 'area':
|
||||
form = areaSearchForm;
|
||||
break;
|
||||
case 'building':
|
||||
form = buildingSearchForm;
|
||||
break;
|
||||
default:
|
||||
form = schoolSearchForm;
|
||||
}
|
||||
const params: any = {
|
||||
managerType: managerType,
|
||||
managerName: form.name,
|
||||
phone: form.phone
|
||||
};
|
||||
// 移除空参数
|
||||
Object.keys(params).forEach((key) => {
|
||||
if (params[key] === '' || params[key] === undefined) delete params[key];
|
||||
});
|
||||
// const res = await axios.get('/ssglyxx/dormManager/list', { params });
|
||||
const res = await listDormManager(params);
|
||||
// 兼容TableDataInfo和R结构
|
||||
let data = [];
|
||||
if (Array.isArray(res.data)) {
|
||||
data = res.data;
|
||||
} else if (res.rows) {
|
||||
data = res?.rows;
|
||||
}
|
||||
// console.log(data);
|
||||
const mappedData = data.map((item: any) => ({
|
||||
id: item.id,
|
||||
name: item.managerName, // 映射
|
||||
phone: item.phone,
|
||||
sex: typeof item.gender === 'number' ? item.gender : Number(item.gender), // gender转数字
|
||||
remark: item.remark
|
||||
// 其他字段按需添加
|
||||
}));
|
||||
// console.log(mappedData);
|
||||
switch (type) {
|
||||
case 'school':
|
||||
schoolAdmins.value = mappedData;
|
||||
break;
|
||||
case 'campus':
|
||||
campusAdmins.value = mappedData;
|
||||
break;
|
||||
case 'area':
|
||||
areaAdmins.value = mappedData;
|
||||
break;
|
||||
case 'building':
|
||||
buildingAdmins.value = mappedData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchAdmins('school');
|
||||
fetchAdmins('campus');
|
||||
fetchAdmins('area');
|
||||
fetchAdmins('building');
|
||||
});
|
||||
|
||||
function onAdd(type: string) {
|
||||
dialogMode.value = 'add';
|
||||
currentAdmin.value = { id: null, name: '', phone: '', sex: 0, remark: '', scope: '' };
|
||||
activeTab.value = type; // 确保当前标签页与点击的按钮一致
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
function onEdit(type: string, admin: any) {
|
||||
console.log('onEdit=============');
|
||||
console.log(admin);
|
||||
dialogMode.value = 'edit';
|
||||
currentAdmin.value = { ...admin };
|
||||
activeTab.value = type; // 确保当前标签页与编辑的管理员类型一致
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
async function onDelete(type: string, admin: any) {
|
||||
// 二次确认
|
||||
ElMessageBox.confirm(`确定要删除管理员【${admin.name}】吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
try {
|
||||
await delDormManager(admin.id);
|
||||
ElMessage.success('删除成功');
|
||||
fetchAdmins(type); // 删除后刷新
|
||||
} catch (e) {
|
||||
ElMessage.error('删除失败');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户取消
|
||||
});
|
||||
}
|
||||
function onScope(type: string, admin: any) {
|
||||
currentAdmin.value = { ...admin };
|
||||
scopeType.value = type;
|
||||
scopeDialogVisible.value = true;
|
||||
}
|
||||
function onDialogSubmit(admin: any) {
|
||||
// TODO: 新增/编辑时调用API,成功后刷新
|
||||
const list = getListByType(activeTab.value);
|
||||
if (dialogMode.value === 'add') {
|
||||
admin.id = Date.now();
|
||||
list.value.push(admin);
|
||||
} else {
|
||||
const idx = list.value.findIndex((a: any) => a.id === admin.id);
|
||||
if (idx !== -1) list.value[idx] = { ...admin };
|
||||
}
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
function onScopeSubmit(scope: string) {
|
||||
// TODO: 分配范围时调用API,成功后刷新
|
||||
const list = getListByType(scopeType.value);
|
||||
const idx = list.value.findIndex((a: any) => a.id === currentAdmin.value.id);
|
||||
if (idx !== -1) list.value[idx].scope = scope;
|
||||
scopeDialogVisible.value = false;
|
||||
}
|
||||
function getListByType(type: string) {
|
||||
switch (type) {
|
||||
case 'school':
|
||||
return schoolAdmins;
|
||||
case 'campus':
|
||||
return campusAdmins;
|
||||
case 'area':
|
||||
return areaAdmins;
|
||||
case 'building':
|
||||
return buildingAdmins;
|
||||
default:
|
||||
return schoolAdmins;
|
||||
}
|
||||
}
|
||||
// 前端过滤(按tab区分检索表单)
|
||||
function filteredAdmins(type: string) {
|
||||
// 真实API已做过滤,这里直接返回
|
||||
return getListByType(type).value;
|
||||
}
|
||||
function handleSearch(type: string) {
|
||||
fetchAdmins(type);
|
||||
}
|
||||
function handleReset(type: string) {
|
||||
switch (type) {
|
||||
case 'school':
|
||||
schoolSearchForm.name = '';
|
||||
schoolSearchForm.phone = '';
|
||||
break;
|
||||
case 'campus':
|
||||
campusSearchForm.name = '';
|
||||
campusSearchForm.phone = '';
|
||||
break;
|
||||
case 'area':
|
||||
areaSearchForm.name = '';
|
||||
areaSearchForm.phone = '';
|
||||
break;
|
||||
case 'building':
|
||||
buildingSearchForm.name = '';
|
||||
buildingSearchForm.phone = '';
|
||||
break;
|
||||
}
|
||||
fetchAdmins(type);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card {
|
||||
/* min-height: 600px; */
|
||||
padding: 8px !important;
|
||||
}
|
||||
.search-form {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user