From aca3faffd3e2450254f6701efcbd272e1c0561c3 Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期三, 17 二月 2021 16:54:07 +0800
Subject: [PATCH] feat(员工信息service): 信息录入时身份证校验
---
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpLeaveInfoController.java | 43 ++++++++++++++++++++++++++++++++++++-------
1 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpLeaveInfoController.java b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpLeaveInfoController.java
index 28b1d64..49faf24 100644
--- a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpLeaveInfoController.java
+++ b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpLeaveInfoController.java
@@ -6,6 +6,8 @@
import cc.mrbird.febs.common.core.entity.QueryRequest;
import cc.mrbird.febs.common.core.exception.FebsException;
import cc.mrbird.febs.common.core.utils.FebsUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -13,6 +15,7 @@
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
+import javax.validation.constraints.NotBlank;
import java.util.Map;
/**
@@ -22,13 +25,14 @@
* description:员工请假记录控制器
*
* @author luoyibo
-* @date 2021-01-24 20:35:29
+* @date 2021-01-31 11:26:13
* @since JDK1.8
*/
+@Api(tags = "人员请假信息录入接口")
@Slf4j
@Validated
@RestController
-@RequestMapping("empLeaveinfo")
+@RequestMapping("empLeaveInfo")
@RequiredArgsConstructor
public class EmpLeaveInfoController {
@@ -37,13 +41,13 @@
@GetMapping
@PreAuthorize("hasAuthority('empLeaveinfo:list')")
public FebsResponse getAllEmpLeaveinfos(EmpLeaveInfo empLeaveinfo) {
-return new FebsResponse().data(empLeaveinfoService.findEmpLeaveinfos(empLeaveinfo));
+return new FebsResponse().data(empLeaveinfoService.findEmpLeaveInfos(empLeaveinfo));
}
@GetMapping("list")
@PreAuthorize("hasAuthority('empLeaveinfo:list')")
public FebsResponse empLeaveinfoList(QueryRequest request, EmpLeaveInfo empLeaveinfo) {
-Map<String, Object> dataTable = FebsUtil.getDataTable(this.empLeaveinfoService.findEmpLeaveinfos(request, empLeaveinfo));
+Map<String, Object> dataTable = FebsUtil.getDataTable(this.empLeaveinfoService.findEmpLeaveInfos(request, empLeaveinfo));
return new FebsResponse().data(dataTable);
}
@@ -53,7 +57,7 @@
try {
this.empLeaveinfoService.createEmpLeaveinfo(empLeaveinfo);
} catch (Exception e) {
-String message = "新增EmpLeaveinfo失败";
+String message = "新增员工请假记录失败";
log.error(message, e);
throw new FebsException(message);
}
@@ -65,7 +69,19 @@
try {
this.empLeaveinfoService.deleteEmpLeaveinfo(empLeaveinfo);
} catch (Exception e) {
-String message = "删除EmpLeaveinfo失败";
+String message = "删除员工请假记录失败";
+log.error(message, e);
+throw new FebsException(message);
+}
+}
+
+@DeleteMapping("{ids}")
+@PreAuthorize("hasAuthority('empLeaveinfo:delete')")
+public void logicDeleteEmpLeaveinfo(@PathVariable("ids") String ids) throws FebsException {
+try {
+this.empLeaveinfoService.logicDelEmpLeaveinfo(ids);
+} catch (Exception e) {
+String message = "逻辑删除员工请假记录失败";
log.error(message, e);
throw new FebsException(message);
}
@@ -77,9 +93,22 @@
try {
this.empLeaveinfoService.updateEmpLeaveinfo(empLeaveinfo);
} catch (Exception e) {
-String message = "修改EmpLeaveinfo失败";
+String message = "修改员工请假记录失败";
log.error(message, e);
throw new FebsException(message);
}
}
+
+ @ApiOperation(value = "请假申请信息提交")
+ @DeleteMapping("toNormal/{ids}")
+ @PreAuthorize("hasAuthority('empLeaveinfo:delete')")
+ public void momentToNormal(@NotBlank(message = "{required}") @PathVariable("ids") String ids) throws FebsException {
+ try {
+ this.empLeaveinfoService.momentToNormal(ids);
+ } catch (Exception e) {
+ String message = "请假申请信息提交失败";
+ log.error(message, e);
+ throw new FebsException(message);
+ }
+ }
}
--
Gitblit v1.8.0