feat(wms): 添加考勤排班、班次及倒班规则功能模块
- 新增 IWmsAttendanceScheduleService 接口及其实现类 - 新增 IWmsAttendanceShiftService 接口及其实现类 - 新增 IWmsAttendanceShiftRuleService 接口及其实现类 - 添加 WmsAttendanceSchedule、WmsAttendanceShift、WmsAttendanceShiftRule 实体类 - 创建对应的 BO 和 VO 类用于数据传输 - 添加 WmsAttendanceScheduleController、WmsAttendanceShiftController、WmsAttendanceShiftRuleController 控制器 - 新增相应的 Mapper 接口和 XML 映射文件 - 实现分页查询、新增、修改、删除等基础功能 - 集成 Excel 导出功能和数据校验机制
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.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<WmsAttendanceScheduleVo> 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<WmsAttendanceScheduleVo> list = iWmsAttendanceScheduleService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "排班(谁在哪天上班)", WmsAttendanceScheduleVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排班(谁在哪天上班)详细信息
|
||||
*
|
||||
* @param scheduleId 主键
|
||||
*/
|
||||
@GetMapping("/{scheduleId}")
|
||||
public R<WmsAttendanceScheduleVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long scheduleId) {
|
||||
return R.ok(iWmsAttendanceScheduleService.queryById(scheduleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排班(谁在哪天上班)
|
||||
*/
|
||||
@Log(title = "排班(谁在哪天上班)", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsAttendanceScheduleBo bo) {
|
||||
return toAjax(iWmsAttendanceScheduleService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排班(谁在哪天上班)
|
||||
*/
|
||||
@Log(title = "排班(谁在哪天上班)", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsAttendanceScheduleBo bo) {
|
||||
return toAjax(iWmsAttendanceScheduleService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排班(谁在哪天上班)
|
||||
*
|
||||
* @param scheduleIds 主键串
|
||||
*/
|
||||
@Log(title = "排班(谁在哪天上班)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{scheduleIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] scheduleIds) {
|
||||
return toAjax(iWmsAttendanceScheduleService.deleteWithValidByIds(Arrays.asList(scheduleIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user