From eb9efc5d8315a75393a86e1f237107cbd1faf30d Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期日, 31 一月 2021 13:54:37 +0800
Subject: [PATCH] feat(人力资源微服务): 合同信息基本增、删、改功能实现
---
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpPhysicalExamController.java | 121 ++++++++++++++++++++++------------------
1 files changed, 66 insertions(+), 55 deletions(-)
diff --git a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpPhysicalExamController.java b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpPhysicalExamController.java
index fde104a..6532f69 100644
--- a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpPhysicalExamController.java
+++ b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpPhysicalExamController.java
@@ -16,70 +16,81 @@
import java.util.Map;
/**
-*
-* name:EmpPhysicalexam
-* package:cc.mrbird.febs.server.hr.controller
-* description:员工体检信息控制器
-*
-* @author luoyibo
-* @date 2021-01-24 20:35:19
-* @since JDK1.8
-*/
+ * name:EmpPhysicalexam
+ * package:cc.mrbird.febs.server.hr.controller
+ * description:员工体检信息控制器
+ *
+ * @author luoyibo
+ * @date 2021-01-31 09:11:00
+ * @since JDK1.8
+ */
@Slf4j
@Validated
@RestController
-@RequestMapping("empPhysicalexam")
+@RequestMapping("empPhysicalExam")
@RequiredArgsConstructor
public class EmpPhysicalExamController {
-private final IEmpPhysicalExamService empPhysicalexamService;
+ private final IEmpPhysicalExamService empPhysicalExamService;
-@GetMapping
-@PreAuthorize("hasAuthority('empPhysicalexam:list')")
-public FebsResponse getAllEmpPhysicalexams(EmpPhysicalExam empPhysicalexam) {
-return new FebsResponse().data(empPhysicalexamService.findEmpPhysicalexams(empPhysicalexam));
-}
+ @GetMapping
+ @PreAuthorize("hasAuthority('empPhysicalexam:list')")
+ public FebsResponse getAllEmpPhysicalExams(EmpPhysicalExam empPhysicalexam) {
+ return new FebsResponse().data(empPhysicalExamService.findEmpPhysicalExams(empPhysicalexam));
+ }
-@GetMapping("list")
-@PreAuthorize("hasAuthority('empPhysicalexam:list')")
-public FebsResponse empPhysicalexamList(QueryRequest request, EmpPhysicalExam empPhysicalexam) {
-Map<String, Object> dataTable = FebsUtil.getDataTable(this.empPhysicalexamService.findEmpPhysicalexams(request, empPhysicalexam));
-return new FebsResponse().data(dataTable);
-}
+ @GetMapping("list")
+ @PreAuthorize("hasAuthority('empPhysicalexam:list')")
+ public FebsResponse empPhysicalExamList(QueryRequest request, EmpPhysicalExam empPhysicalexam) {
+ Map<String, Object> dataTable = FebsUtil.getDataTable(this.empPhysicalExamService.findEmpPhysicalExams(request, empPhysicalexam));
+ return new FebsResponse().data(dataTable);
+ }
-@PostMapping
-@PreAuthorize("hasAuthority('empPhysicalexam:add')")
-public void addEmpPhysicalexam(@Valid EmpPhysicalExam empPhysicalexam) throws FebsException {
-try {
-this.empPhysicalexamService.createEmpPhysicalexam(empPhysicalexam);
-} catch (Exception e) {
-String message = "新增EmpPhysicalexam失败";
-log.error(message, e);
-throw new FebsException(message);
-}
-}
+ @PostMapping
+ @PreAuthorize("hasAuthority('empPhysicalexam:add')")
+ public void addEmpPhysicalExam(@Valid EmpPhysicalExam empPhysicalexam) throws FebsException {
+ try {
+ this.empPhysicalExamService.createEmpPhysicalExam(empPhysicalexam);
+ } catch (Exception e) {
+ String message = "新增员工体检信息失败";
+ log.error(message, e);
+ throw new FebsException(message);
+ }
+ }
-@DeleteMapping
-@PreAuthorize("hasAuthority('empPhysicalexam:delete')")
-public void deleteEmpPhysicalexam(EmpPhysicalExam empPhysicalexam) throws FebsException {
-try {
-this.empPhysicalexamService.deleteEmpPhysicalexam(empPhysicalexam);
-} catch (Exception e) {
-String message = "删除EmpPhysicalexam失败";
-log.error(message, e);
-throw new FebsException(message);
-}
-}
+ @DeleteMapping
+ @PreAuthorize("hasAuthority('empPhysicalexam:delete')")
+ public void deleteEmpPhysicalExam(EmpPhysicalExam empPhysicalexam) throws FebsException {
+ try {
+ this.empPhysicalExamService.deleteEmpPhysicalExam(empPhysicalexam);
+ } catch (Exception e) {
+ String message = "删除员工体检信息失败";
+ log.error(message, e);
+ throw new FebsException(message);
+ }
+ }
-@PutMapping
-@PreAuthorize("hasAuthority('empPhysicalexam:update')")
-public void updateEmpPhysicalexam(EmpPhysicalExam empPhysicalexam) throws FebsException {
-try {
-this.empPhysicalexamService.updateEmpPhysicalexam(empPhysicalexam);
-} catch (Exception e) {
-String message = "修改EmpPhysicalexam失败";
-log.error(message, e);
-throw new FebsException(message);
-}
-}
+ @DeleteMapping("{ids}")
+ @PreAuthorize("hasAuthority('empPhysicalexam:delete')")
+ public void logicDeleteEmpPhysicalExam(@PathVariable("ids") String ids) throws FebsException {
+ try {
+ this.empPhysicalExamService.logicDelEmpPhysicalExam(ids);
+ } catch (Exception e) {
+ String message = "逻辑删除员工体检信息失败";
+ log.error(message, e);
+ throw new FebsException(message);
+ }
+ }
+
+ @PutMapping
+ @PreAuthorize("hasAuthority('empPhysicalexam:update')")
+ public void updateEmpPhysicalExam(EmpPhysicalExam empPhysicalexam) throws FebsException {
+ try {
+ this.empPhysicalExamService.updateEmpPhysicalExam(empPhysicalexam);
+ } catch (Exception e) {
+ String message = "修改员工体检信息失败";
+ log.error(message, e);
+ throw new FebsException(message);
+ }
+ }
}
--
Gitblit v1.8.0