2026-03-14 09:54:40 +08:00
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-03-18 10:53:14 +08:00
|
|
|
|
* 员工异动(入职/离职/转正)
|
2026-03-14 09:54:40 +08:00
|
|
|
|
*
|
|
|
|
|
|
* @author klp
|
|
|
|
|
|
* @date 2026-03-14
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Validated
|
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/wms/employeeChange")
|
|
|
|
|
|
public class WmsEmployeeChangeController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private final IWmsEmployeeChangeService iWmsEmployeeChangeService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-03-18 10:53:14 +08:00
|
|
|
|
* 查询员工异动(入职/离职/转正)列表
|
2026-03-14 09:54:40 +08:00
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
|
public TableDataInfo<WmsEmployeeChangeVo> list(WmsEmployeeChangeBo bo, PageQuery pageQuery) {
|
|
|
|
|
|
return iWmsEmployeeChangeService.queryPageList(bo, pageQuery);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-03-18 10:53:14 +08:00
|
|
|
|
* 导出员工异动(入职/离职/转正)列表
|
2026-03-14 09:54:40 +08:00
|
|
|
|
*/
|
2026-03-18 10:53:14 +08:00
|
|
|
|
@Log(title = "员工异动(入职/离职/转正)", businessType = BusinessType.EXPORT)
|
2026-03-14 09:54:40 +08:00
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
|
public void export(WmsEmployeeChangeBo bo, HttpServletResponse response) {
|
|
|
|
|
|
List<WmsEmployeeChangeVo> list = iWmsEmployeeChangeService.queryList(bo);
|
2026-03-18 10:53:14 +08:00
|
|
|
|
ExcelUtil.exportExcel(list, "员工异动(入职/离职/转正)", WmsEmployeeChangeVo.class, response);
|
2026-03-14 09:54:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-03-18 10:53:14 +08:00
|
|
|
|
* 获取员工异动(入职/离职/转正)详细信息
|
2026-03-14 09:54:40 +08:00
|
|
|
|
*
|
|
|
|
|
|
* @param changeId 主键
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/{changeId}")
|
|
|
|
|
|
public R<WmsEmployeeChangeVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
|
|
@PathVariable Long changeId) {
|
|
|
|
|
|
return R.ok(iWmsEmployeeChangeService.queryById(changeId));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-03-18 10:53:14 +08:00
|
|
|
|
* 新增员工异动(入职/离职/转正)
|
2026-03-14 09:54:40 +08:00
|
|
|
|
*/
|
2026-03-18 10:53:14 +08:00
|
|
|
|
@Log(title = "员工异动(入职/离职/转正)", businessType = BusinessType.INSERT)
|
2026-03-14 09:54:40 +08:00
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PostMapping()
|
|
|
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
|
|
|
|
|
return toAjax(iWmsEmployeeChangeService.insertByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-03-18 10:53:14 +08:00
|
|
|
|
* 修改员工异动(入职/离职/转正)
|
2026-03-14 09:54:40 +08:00
|
|
|
|
*/
|
2026-03-18 10:53:14 +08:00
|
|
|
|
@Log(title = "员工异动(入职/离职/转正)", businessType = BusinessType.UPDATE)
|
2026-03-14 09:54:40 +08:00
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PutMapping()
|
|
|
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
|
|
|
|
|
return toAjax(iWmsEmployeeChangeService.updateByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-03-18 10:53:14 +08:00
|
|
|
|
* 删除员工异动(入职/离职/转正)
|
2026-03-14 09:54:40 +08:00
|
|
|
|
*
|
|
|
|
|
|
* @param changeIds 主键串
|
|
|
|
|
|
*/
|
2026-03-18 10:53:14 +08:00
|
|
|
|
@Log(title = "员工异动(入职/离职/转正)", businessType = BusinessType.DELETE)
|
2026-03-14 09:54:40 +08:00
|
|
|
|
@DeleteMapping("/{changeIds}")
|
|
|
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
|
|
@PathVariable Long[] changeIds) {
|
|
|
|
|
|
return toAjax(iWmsEmployeeChangeService.deleteWithValidByIds(Arrays.asList(changeIds), true));
|
|
|
|
|
|
}
|
2026-03-14 10:40:44 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 员工入职
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "员工入职", businessType = BusinessType.INSERT)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PostMapping("/entry")
|
|
|
|
|
|
public R<Void> entry(@Validated(AddGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
|
|
|
|
|
return toAjax(iWmsEmployeeChangeService.employeeEntry(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 员工离职
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "员工离职", businessType = BusinessType.INSERT)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PostMapping("/leave")
|
|
|
|
|
|
public R<Void> leave(@Validated(AddGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
|
|
|
|
|
return toAjax(iWmsEmployeeChangeService.employeeLeave(bo));
|
|
|
|
|
|
}
|
2026-03-18 10:53:14 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 员工转正
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "员工转正", businessType = BusinessType.INSERT)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PostMapping("/regular")
|
|
|
|
|
|
public R<Void> regular(@Validated(AddGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
|
|
|
|
|
return toAjax(iWmsEmployeeChangeService.employeeRegular(bo));
|
|
|
|
|
|
}
|
2026-03-14 09:54:40 +08:00
|
|
|
|
}
|