yijiusmile
2021-02-19 734e2ad327e241fa40e31ff07329f032de689df1
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpInsuranceController.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,9 +25,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
@@ -53,7 +57,7 @@
try {
this.empInsuranceService.createEmpInsurance(empInsurance);
} catch (Exception e) {
String message = "新增EmpInsurance失败";
String message = "新增员工社保申请失败";
log.error(message, e);
throw new FebsException(message);
}
@@ -65,7 +69,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 +93,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);
        }
    }
}