feat(wms): 添加员工异动管理功能
- 创建员工异动实体类 WmsEmployeeChange,包含异动记录主键、员工信息关联、异动类型等字段 - 定义员工异动业务对象 WmsEmployeeChangeBo 和视图对象 WmsEmployeeChangeVo - 实现员工异动服务接口 IWmsEmployeeChangeService 及其具体实现类 WmsEmployeeChangeServiceImpl - 添加员工异动数据访问层 WmsEmployeeChangeMapper 及对应的 MyBatis XML 映射文件 - 开发员工异动控制器 WmsEmployeeChangeController,提供增删改查及导出功能 - 集成分页查询、数据校验、重复提交防护等通用功能
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.WmsEmployeeChangeVo;
|
||||
import com.klp.domain.bo.WmsEmployeeChangeBo;
|
||||
import com.klp.service.IWmsEmployeeChangeService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 员工异动(入职/离职)
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wms/employeeChange")
|
||||
public class WmsEmployeeChangeController extends BaseController {
|
||||
|
||||
private final IWmsEmployeeChangeService iWmsEmployeeChangeService;
|
||||
|
||||
/**
|
||||
* 查询员工异动(入职/离职)列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsEmployeeChangeVo> list(WmsEmployeeChangeBo bo, PageQuery pageQuery) {
|
||||
return iWmsEmployeeChangeService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出员工异动(入职/离职)列表
|
||||
*/
|
||||
@Log(title = "员工异动(入职/离职)", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsEmployeeChangeBo bo, HttpServletResponse response) {
|
||||
List<WmsEmployeeChangeVo> list = iWmsEmployeeChangeService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "员工异动(入职/离职)", WmsEmployeeChangeVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工异动(入职/离职)详细信息
|
||||
*
|
||||
* @param changeId 主键
|
||||
*/
|
||||
@GetMapping("/{changeId}")
|
||||
public R<WmsEmployeeChangeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long changeId) {
|
||||
return R.ok(iWmsEmployeeChangeService.queryById(changeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工异动(入职/离职)
|
||||
*/
|
||||
@Log(title = "员工异动(入职/离职)", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
||||
return toAjax(iWmsEmployeeChangeService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工异动(入职/离职)
|
||||
*/
|
||||
@Log(title = "员工异动(入职/离职)", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
||||
return toAjax(iWmsEmployeeChangeService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工异动(入职/离职)
|
||||
*
|
||||
* @param changeIds 主键串
|
||||
*/
|
||||
@Log(title = "员工异动(入职/离职)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{changeIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] changeIds) {
|
||||
return toAjax(iWmsEmployeeChangeService.deleteWithValidByIds(Arrays.asList(changeIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user