中介 代码重写
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.dpc.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.dpc.domain.DpcEmployee;
|
||||
@@ -12,6 +15,8 @@ import com.ruoyi.dpc.domain.dto.DpcEmployeeEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeQueryDTO;
|
||||
import com.ruoyi.dpc.domain.vo.DpcEmployeeVO;
|
||||
import com.ruoyi.dpc.service.IDpcEmployeeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -27,6 +32,7 @@ import java.util.List;
|
||||
* @author ruoyi
|
||||
* @date 2026-01-28
|
||||
*/
|
||||
@Tag(name = "员工信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/dpc/employee")
|
||||
public class DpcEmployeeController extends BaseController {
|
||||
@@ -37,17 +43,21 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 查询员工列表
|
||||
*/
|
||||
@Operation(summary = "查询员工列表")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DpcEmployeeQueryDTO queryDTO) {
|
||||
startPage();
|
||||
List<DpcEmployeeVO> list = employeeService.selectEmployeeList(queryDTO);
|
||||
return getDataTable(list);
|
||||
// 使用MyBatis Plus分页
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Page<DpcEmployee> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||
Page<DpcEmployeeVO> result = employeeService.selectEmployeePage(page, queryDTO);
|
||||
return getDataTable(result.getRecords(), result.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出员工列表
|
||||
*/
|
||||
@Operation(summary = "导出员工列表")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:export')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@@ -60,6 +70,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 获取员工详细信息
|
||||
*/
|
||||
@Operation(summary = "获取员工详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:query')")
|
||||
@GetMapping(value = "/{employeeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long employeeId) {
|
||||
@@ -69,6 +80,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 新增员工
|
||||
*/
|
||||
@Operation(summary = "新增员工")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:add')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@@ -79,6 +91,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 修改员工
|
||||
*/
|
||||
@Operation(summary = "修改员工")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:edit')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@@ -89,6 +102,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 删除员工
|
||||
*/
|
||||
@Operation(summary = "删除员工")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:remove')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{employeeIds}")
|
||||
@@ -99,6 +113,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 下载导入模板
|
||||
*/
|
||||
@Operation(summary = "下载导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<DpcEmployee> util = new ExcelUtil<>(DpcEmployee.class);
|
||||
@@ -108,6 +123,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 导入员工信息
|
||||
*/
|
||||
@Operation(summary = "导入员工信息")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:import')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
|
||||
Reference in New Issue
Block a user