100 lines
3.0 KiB
Java
100 lines
3.0 KiB
Java
|
|
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.WmsPostDutyVo;
|
||
|
|
import com.klp.domain.bo.WmsPostDutyBo;
|
||
|
|
import com.klp.service.IWmsPostDutyService;
|
||
|
|
import com.klp.common.core.page.TableDataInfo;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 岗位职责
|
||
|
|
*
|
||
|
|
* @author klp
|
||
|
|
* @date 2026-06-15
|
||
|
|
*/
|
||
|
|
@Validated
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/wms/postDuty")
|
||
|
|
public class WmsPostDutyController extends BaseController {
|
||
|
|
|
||
|
|
private final IWmsPostDutyService iWmsPostDutyService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 查询岗位职责列表
|
||
|
|
*/
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo<WmsPostDutyVo> list(WmsPostDutyBo bo, PageQuery pageQuery) {
|
||
|
|
return iWmsPostDutyService.queryPageList(bo, pageQuery);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出岗位职责列表
|
||
|
|
*/
|
||
|
|
@Log(title = "岗位职责", businessType = BusinessType.EXPORT)
|
||
|
|
@PostMapping("/export")
|
||
|
|
public void export(WmsPostDutyBo bo, HttpServletResponse response) {
|
||
|
|
List<WmsPostDutyVo> list = iWmsPostDutyService.queryList(bo);
|
||
|
|
ExcelUtil.exportExcel(list, "岗位职责", WmsPostDutyVo.class, response);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取岗位职责详细信息
|
||
|
|
*
|
||
|
|
* @param dutyId 主键
|
||
|
|
*/
|
||
|
|
@GetMapping("/{dutyId}")
|
||
|
|
public R<WmsPostDutyVo> getInfo(@NotNull(message = "主键不能为空")
|
||
|
|
@PathVariable Long dutyId) {
|
||
|
|
return R.ok(iWmsPostDutyService.queryById(dutyId));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 新增岗位职责
|
||
|
|
*/
|
||
|
|
@Log(title = "岗位职责", businessType = BusinessType.INSERT)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PostMapping()
|
||
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsPostDutyBo bo) {
|
||
|
|
return toAjax(iWmsPostDutyService.insertByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 修改岗位职责
|
||
|
|
*/
|
||
|
|
@Log(title = "岗位职责", businessType = BusinessType.UPDATE)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PutMapping()
|
||
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsPostDutyBo bo) {
|
||
|
|
return toAjax(iWmsPostDutyService.updateByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 删除岗位职责
|
||
|
|
*
|
||
|
|
* @param dutyIds 主键串
|
||
|
|
*/
|
||
|
|
@Log(title = "岗位职责", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{dutyIds}")
|
||
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||
|
|
@PathVariable Long[] dutyIds) {
|
||
|
|
return toAjax(iWmsPostDutyService.deleteWithValidByIds(Arrays.asList(dutyIds), true));
|
||
|
|
}
|
||
|
|
}
|