2026-03-18 10:06:48 +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.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));
|
|
|
|
|
}
|
2026-03-18 11:03:43 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 员工转岗
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "员工转岗", businessType = BusinessType.INSERT)
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PostMapping("/transfer")
|
|
|
|
|
public R<Void> transfer(@Validated(AddGroup.class) @RequestBody WmsEmployeeTransferBo bo) {
|
|
|
|
|
return toAjax(iWmsEmployeeTransferService.employeeTransfer(bo));
|
|
|
|
|
}
|
2026-03-18 10:06:48 +08:00
|
|
|
}
|