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.WmsAttendanceScheduleVo; import com.klp.domain.bo.WmsAttendanceScheduleBo; import com.klp.service.IWmsAttendanceScheduleService; import com.klp.common.core.page.TableDataInfo; /** * 排班(谁在哪天上班) * * @author klp * @date 2026-05-08 */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/wms/attendanceSchedule") public class WmsAttendanceScheduleController extends BaseController { private final IWmsAttendanceScheduleService iWmsAttendanceScheduleService; /** * 查询排班(谁在哪天上班)列表 */ @GetMapping("/list") public TableDataInfo list(WmsAttendanceScheduleBo bo, PageQuery pageQuery) { return iWmsAttendanceScheduleService.queryPageList(bo, pageQuery); } /** * 导出排班(谁在哪天上班)列表 */ @Log(title = "排班(谁在哪天上班)", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(WmsAttendanceScheduleBo bo, HttpServletResponse response) { List list = iWmsAttendanceScheduleService.queryList(bo); ExcelUtil.exportExcel(list, "排班(谁在哪天上班)", WmsAttendanceScheduleVo.class, response); } /** * 获取排班(谁在哪天上班)详细信息 * * @param scheduleId 主键 */ @GetMapping("/{scheduleId}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long scheduleId) { return R.ok(iWmsAttendanceScheduleService.queryById(scheduleId)); } /** * 新增排班(谁在哪天上班) */ @Log(title = "排班(谁在哪天上班)", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody WmsAttendanceScheduleBo bo) { return toAjax(iWmsAttendanceScheduleService.insertByBo(bo)); } /** * 修改排班(谁在哪天上班) */ @Log(title = "排班(谁在哪天上班)", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody WmsAttendanceScheduleBo bo) { return toAjax(iWmsAttendanceScheduleService.updateByBo(bo)); } /** * 删除排班(谁在哪天上班) * * @param scheduleIds 主键串 */ @Log(title = "排班(谁在哪天上班)", businessType = BusinessType.DELETE) @DeleteMapping("/{scheduleIds}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] scheduleIds) { return toAjax(iWmsAttendanceScheduleService.deleteWithValidByIds(Arrays.asList(scheduleIds), true)); } }