luoyb
2021-03-16 57fc705f91f6972b956d92da85e1ab2771709874
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpBaseInfoController.java
@@ -2,6 +2,7 @@
import cc.mrbird.febs.common.core.entity.FebsResponse;
import cc.mrbird.febs.common.core.entity.QueryRequest;
import cc.mrbird.febs.common.core.entity.constant.StringConstant;
import cc.mrbird.febs.common.core.entity.system.DicItem;
import cc.mrbird.febs.common.core.exception.FebsException;
import cc.mrbird.febs.common.core.utils.FebsUtil;
@@ -9,6 +10,7 @@
import cc.mrbird.febs.server.hr.entity.EmpBaseInfo;
import cc.mrbird.febs.server.hr.entity.EmpDimissionLog;
import cc.mrbird.febs.server.hr.entity.EmpJobChange;
import cc.mrbird.febs.server.hr.feign.IRemoteDeptService;
import cc.mrbird.febs.server.hr.feign.IRemoteDicItemService;
import cc.mrbird.febs.server.hr.service.*;
import cc.mrbird.febs.server.hr.util.PoiExportExcel;
@@ -51,7 +53,7 @@
@RequestMapping("empBaseInfo")
@RequiredArgsConstructor
public class EmpBaseInfoController {
    private final IRemoteDeptService remoteDeptService;
    private final IEmpBaseInfoService empBaseInfoService;
    private final IEmpWorkExperienceService empWorkExperienceService;
    private final IEmpPhysicalExamService empPhysicalExamService;
@@ -96,6 +98,9 @@
    public void addEmpBaseInfo(@Valid EmpBaseInfo empBaseinfo) throws FebsException {
       if(this.empBaseInfoService.verifyEmpNumb(empBaseinfo)){
           throw new FebsException("已存在此员工编号:" + empBaseinfo.getEmpNumb());
       }
       if(this.empBaseInfoService.verifyCertificateNumb(empBaseinfo)){
           throw new FebsException("已存在此身份证号:" + empBaseinfo.getCertificateNumb());
       }
        try {
            this.empBaseInfoService.createEmpBaseInfo(empBaseinfo);
@@ -162,10 +167,11 @@
    @GetMapping("options")
    public FebsResponse roles() {
        QueryWrapper<EmpBaseInfo> wrapper=new QueryWrapper();
        wrapper.eq("empStatus",0);
        wrapper.eq("delFlag",0);
        wrapper.orderByDesc("createTime");
        List<EmpBaseInfo> allRoles = empBaseInfoService.list(wrapper);
        wrapper.eq("a.empStatus",0);
        wrapper.eq("a.delFlag",0);
        wrapper.orderByDesc("a.createTime");
        wrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA));
        List<EmpBaseInfo> allRoles = empBaseInfoService.listAll(wrapper);
        return new FebsResponse().data(allRoles);
    }