|
@@ -0,0 +1,53 @@
|
|
|
+package com.ym.mec.web.controller;
|
|
|
+
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.page.QueryInfo;
|
|
|
+import com.ym.mec.web.dal.entity.ChargeType;
|
|
|
+import com.ym.mec.web.dal.entity.LeaveCategory;
|
|
|
+import com.ym.mec.web.service.ChargeTypeService;
|
|
|
+import com.ym.mec.web.service.LeaveCategoryService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+@RequestMapping("leaveCategory")
|
|
|
+@Api(tags = "请假类型服务")
|
|
|
+@RestController
|
|
|
+public class LeaveCategoryController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private LeaveCategoryService leaveCategoryService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "新增请假类型")
|
|
|
+ @PostMapping("/add")
|
|
|
+ public Object add(@RequestBody LeaveCategory leaveCategory) {
|
|
|
+ leaveCategoryService.insert(leaveCategory);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除请假类型")
|
|
|
+ @DeleteMapping("/del/{id}")
|
|
|
+ public Object del(@ApiParam(value = "请假类型编号", required = true) @PathVariable("id") Integer id) {
|
|
|
+ leaveCategoryService.delete(id);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "修改请假类型")
|
|
|
+ @PutMapping("/update")
|
|
|
+ public Object update(@RequestBody LeaveCategory leaveCategory) {
|
|
|
+ leaveCategory.setUpdateTime(new Date());
|
|
|
+ leaveCategoryService.update(leaveCategory);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分页查询请假类型列表")
|
|
|
+ @PostMapping("/queryPage")
|
|
|
+ public Object queryPage(@RequestBody QueryInfo queryInfo) {
|
|
|
+ return succeed(leaveCategoryService.queryPage(queryInfo));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|