From b4672b5f60e6d299405442b56454a4750f15ff61 Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期日, 21 二月 2021 23:05:48 +0800
Subject: [PATCH] fix(信息录入): 工伤案件与意外险案件
---
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpInsuranceController.java | 49 +++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpInsuranceController.java b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpInsuranceController.java
index 9b5ce6b..ecd4add 100644
--- a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpInsuranceController.java
+++ b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpInsuranceController.java
@@ -1,18 +1,26 @@
package cc.mrbird.febs.server.hr.controller;
+import cc.mrbird.febs.server.hr.annotation.ControllerEndpoint;
+import cc.mrbird.febs.server.hr.entity.EmpDimissionLog;
import cc.mrbird.febs.server.hr.entity.EmpInsurance;
import cc.mrbird.febs.server.hr.service.IEmpInsuranceService;
import cc.mrbird.febs.common.core.entity.FebsResponse;
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 com.wuwenze.poi.ExcelKit;
+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;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
+import javax.validation.constraints.NotBlank;
+import java.util.List;
import java.util.Map;
/**
@@ -22,9 +30,10 @@
* description:员工社保申请控制器
*
* @author luoyibo
-* @date 2021-01-24 20:35:33
+* @date 2021-01-31 11:26:23
* @since JDK1.8
*/
+@Api(tags = "人员社保申请信息录入接口")
@Slf4j
@Validated
@RestController
@@ -46,14 +55,21 @@
Map<String, Object> dataTable = FebsUtil.getDataTable(this.empInsuranceService.findEmpInsurances(request, empInsurance));
return new FebsResponse().data(dataTable);
}
+ @ApiOperation(value = "导出员工")
+ @RequestMapping(value = "export",method= RequestMethod.POST)
+ @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败")
+ public void export(QueryRequest request, EmpInsurance empBaseinfo, HttpServletResponse response) {
+ List<EmpInsurance> records = this.empInsuranceService.findEmpInsurances(request, empBaseinfo).getRecords();
+ ExcelKit.$Export(EmpInsurance.class, response).downXlsx(records, false);
+ }
@PostMapping
@PreAuthorize("hasAuthority('empInsurance:add')")
public void addEmpInsurance(@Valid EmpInsurance empInsurance) throws FebsException {
try {
this.empInsuranceService.createEmpInsurance(empInsurance);
} catch (Exception e) {
-String message = "新增EmpInsurance失败";
+String message = "新增员工社保申请失败";
log.error(message, e);
throw new FebsException(message);
}
@@ -65,7 +81,19 @@
try {
this.empInsuranceService.deleteEmpInsurance(empInsurance);
} catch (Exception e) {
-String message = "删除EmpInsurance失败";
+String message = "删除员工社保申请失败";
+log.error(message, e);
+throw new FebsException(message);
+}
+}
+
+@DeleteMapping("{ids}")
+@PreAuthorize("hasAuthority('empInsurance:delete')")
+public void logicDeleteEmpInsurance(@PathVariable("ids") String ids) throws FebsException {
+try {
+this.empInsuranceService.logicDelEmpInsurance(ids);
+} catch (Exception e) {
+String message = "逻辑删除员工社保申请失败";
log.error(message, e);
throw new FebsException(message);
}
@@ -77,9 +105,22 @@
try {
this.empInsuranceService.updateEmpInsurance(empInsurance);
} catch (Exception e) {
-String message = "修改EmpInsurance失败";
+String message = "修改员工社保申请失败";
log.error(message, e);
throw new FebsException(message);
}
}
+
+ @ApiOperation(value = "社保申请信息提交")
+ @DeleteMapping("toNormal/{ids}")
+ @PreAuthorize("hasAuthority('empInsurance:delete')")
+ public void momentToNormal(@NotBlank(message = "{required}") @PathVariable("ids") String ids) throws FebsException {
+ try {
+ this.empInsuranceService.momentToNormal(ids);
+ } catch (Exception e) {
+ String message = "社保申请信息提交失败";
+ log.error(message, e);
+ throw new FebsException(message);
+ }
+ }
}
--
Gitblit v1.8.0