浏览代码

SgTimeSheet

zhoutao 5 年之前
父节点
当前提交
923a09e18a

+ 110 - 0
pigx-inventory/pigx-inventory-biz/src/main/java/com/pig4cloud/pigx/qa/controller/SgTimeSheetController.java

@@ -0,0 +1,110 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.qa.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.pig4cloud.pigx.common.core.util.R;
+import com.pig4cloud.pigx.common.log.annotation.SysLog;
+import com.pig4cloud.pigx.qa.entity.SgTimeSheet;
+import com.pig4cloud.pigx.qa.service.SgTimeSheetService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 
+ *
+ * @author georgejiao
+ * @date 2020-08-26 13:11:49
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/sgtimesheet" )
+@Api(value = "sgtimesheet", tags = "考勤管理")
+public class SgTimeSheetController {
+
+    private final  SgTimeSheetService sgTimeSheetService;
+
+    /**
+     * 分页查询
+     * @param page 分页对象
+     * @param sgTimeSheet 
+     * @return
+     */
+    @ApiOperation(value = "分页查询", notes = "分页查询")
+    @GetMapping("/page" )
+    public R getSgTimeSheetPage(Page page, SgTimeSheet sgTimeSheet) {
+        return R.ok(sgTimeSheetService.page(page, Wrappers.query(sgTimeSheet)));
+    }
+
+
+    /**
+     * 通过id查询
+     * @param id id
+     * @return R
+     */
+    @ApiOperation(value = "通过id查询", notes = "通过id查询")
+    @GetMapping("/{id}" )
+    public R getById(@PathVariable("id" ) Integer id) {
+        return R.ok(sgTimeSheetService.getById(id));
+    }
+
+    /**
+     * 新增
+     * @param sgTimeSheet 
+     * @return R
+     */
+    @ApiOperation(value = "新增", notes = "新增")
+    @SysLog("新增" )
+    @PostMapping
+    @PreAuthorize("@pms.hasPermission('qa_sgtimesheet_add')" )
+    public R save(@RequestBody SgTimeSheet sgTimeSheet) {
+        return R.ok(sgTimeSheetService.save(sgTimeSheet));
+    }
+
+    /**
+     * 修改
+     * @param sgTimeSheet 
+     * @return R
+     */
+    @ApiOperation(value = "修改", notes = "修改")
+    @SysLog("修改" )
+    @PutMapping
+    @PreAuthorize("@pms.hasPermission('qa_sgtimesheet_edit')" )
+    public R updateById(@RequestBody SgTimeSheet sgTimeSheet) {
+        return R.ok(sgTimeSheetService.updateById(sgTimeSheet));
+    }
+
+    /**
+     * 通过id删除
+     * @param id id
+     * @return R
+     */
+    @ApiOperation(value = "通过id删除", notes = "通过id删除")
+    @SysLog("通过id删除" )
+    @DeleteMapping("/{id}" )
+    @PreAuthorize("@pms.hasPermission('qa_sgtimesheet_del')" )
+    public R removeById(@PathVariable Integer id) {
+        return R.ok(sgTimeSheetService.removeById(id));
+    }
+
+}