feat(wms): 添加员工转岗记录管理功能
- 创建员工转岗记录实体类 WmsEmployeeTransfer - 实现员工转岗记录服务接口 IWmsEmployeeTransferService - 添加员工转岗记录控制器 WmsEmployeeTransferController - 创建员工转岗记录数据访问层 WmsEmployeeTransferMapper - 实现员工转岗记录业务逻辑 WmsEmployeeTransferServiceImpl - 定义员工转岗记录业务对象 WmsEmployeeTransferBo 和视图对象 WmsEmployeeTransferVo - 配置员工转岗记录 MyBatis 映射文件 - 实现员工转岗记录的增删改查功能 - 添加员工转岗记录导出功能
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.vo.WmsEmployeeTransferVo;
|
||||
import com.klp.domain.bo.WmsEmployeeTransferBo;
|
||||
import com.klp.service.IWmsEmployeeTransferService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 员工转岗记录
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wms/employeeTransfer")
|
||||
public class WmsEmployeeTransferController extends BaseController {
|
||||
|
||||
private final IWmsEmployeeTransferService iWmsEmployeeTransferService;
|
||||
|
||||
/**
|
||||
* 查询员工转岗记录列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsEmployeeTransferVo> list(WmsEmployeeTransferBo bo, PageQuery pageQuery) {
|
||||
return iWmsEmployeeTransferService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出员工转岗记录列表
|
||||
*/
|
||||
@Log(title = "员工转岗记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsEmployeeTransferBo bo, HttpServletResponse response) {
|
||||
List<WmsEmployeeTransferVo> list = iWmsEmployeeTransferService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "员工转岗记录", WmsEmployeeTransferVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工转岗记录详细信息
|
||||
*
|
||||
* @param transferId 主键
|
||||
*/
|
||||
@GetMapping("/{transferId}")
|
||||
public R<WmsEmployeeTransferVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long transferId) {
|
||||
return R.ok(iWmsEmployeeTransferService.queryById(transferId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工转岗记录
|
||||
*/
|
||||
@Log(title = "员工转岗记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsEmployeeTransferBo bo) {
|
||||
return toAjax(iWmsEmployeeTransferService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工转岗记录
|
||||
*/
|
||||
@Log(title = "员工转岗记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsEmployeeTransferBo bo) {
|
||||
return toAjax(iWmsEmployeeTransferService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工转岗记录
|
||||
*
|
||||
* @param transferIds 主键串
|
||||
*/
|
||||
@Log(title = "员工转岗记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{transferIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] transferIds) {
|
||||
return toAjax(iWmsEmployeeTransferService.deleteWithValidByIds(Arrays.asList(transferIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user