|
@@ -12,7 +12,7 @@
|
|
*/
|
|
*/
|
|
package vip.xiaonuo.hr.modular.baseemployeeinfo.controller;
|
|
package vip.xiaonuo.hr.modular.baseemployeeinfo.controller;
|
|
|
|
|
|
-import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
@@ -27,15 +27,18 @@ import vip.xiaonuo.common.annotation.CommonLog;
|
|
import vip.xiaonuo.common.pojo.CommonResult;
|
|
import vip.xiaonuo.common.pojo.CommonResult;
|
|
import vip.xiaonuo.common.pojo.CommonValidList;
|
|
import vip.xiaonuo.common.pojo.CommonValidList;
|
|
import vip.xiaonuo.hr.modular.baseemployeeinfo.entity.HrBaseEmployeeInfo;
|
|
import vip.xiaonuo.hr.modular.baseemployeeinfo.entity.HrBaseEmployeeInfo;
|
|
-import vip.xiaonuo.hr.modular.baseemployeeinfo.param.HrBaseEmployeeInfoAddParam;
|
|
|
|
-import vip.xiaonuo.hr.modular.baseemployeeinfo.param.HrBaseEmployeeInfoEditParam;
|
|
|
|
-import vip.xiaonuo.hr.modular.baseemployeeinfo.param.HrBaseEmployeeInfoIdParam;
|
|
|
|
-import vip.xiaonuo.hr.modular.baseemployeeinfo.param.HrBaseEmployeeInfoPageParam;
|
|
|
|
|
|
+import vip.xiaonuo.hr.modular.baseemployeeinfo.entity.vo.CountPerson;
|
|
|
|
+import vip.xiaonuo.hr.modular.baseemployeeinfo.entity.vo.EoucationVo;
|
|
|
|
+import vip.xiaonuo.hr.modular.baseemployeeinfo.entity.vo.CountNum;
|
|
|
|
+import vip.xiaonuo.hr.modular.baseemployeeinfo.entity.vo.PerNum;
|
|
|
|
+import vip.xiaonuo.hr.modular.baseemployeeinfo.param.*;
|
|
import vip.xiaonuo.hr.modular.baseemployeeinfo.service.HrBaseEmployeeInfoService;
|
|
import vip.xiaonuo.hr.modular.baseemployeeinfo.service.HrBaseEmployeeInfoService;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import javax.validation.constraints.NotEmpty;
|
|
import javax.validation.constraints.NotEmpty;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 人员明细控制器
|
|
* 人员明细控制器
|
|
@@ -52,62 +55,34 @@ public class HrBaseEmployeeInfoController {
|
|
@Resource
|
|
@Resource
|
|
private HrBaseEmployeeInfoService hrBaseEmployeeInfoService;
|
|
private HrBaseEmployeeInfoService hrBaseEmployeeInfoService;
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取人员明细分页
|
|
|
|
- *
|
|
|
|
- * @author 余
|
|
|
|
- * @date 2024/11/14 15:02
|
|
|
|
- */
|
|
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperation("获取人员明细分页")
|
|
@ApiOperation("获取人员明细分页")
|
|
- @SaCheckPermission("/hr/baseemployeeinfo/page")
|
|
|
|
@GetMapping("/hr/baseemployeeinfo/page")
|
|
@GetMapping("/hr/baseemployeeinfo/page")
|
|
public CommonResult<Page<HrBaseEmployeeInfo>> page(HrBaseEmployeeInfoPageParam hrBaseEmployeeInfoPageParam) {
|
|
public CommonResult<Page<HrBaseEmployeeInfo>> page(HrBaseEmployeeInfoPageParam hrBaseEmployeeInfoPageParam) {
|
|
return CommonResult.data(hrBaseEmployeeInfoService.page(hrBaseEmployeeInfoPageParam));
|
|
return CommonResult.data(hrBaseEmployeeInfoService.page(hrBaseEmployeeInfoPageParam));
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 添加人员明细
|
|
|
|
- *
|
|
|
|
- * @author 余
|
|
|
|
- * @date 2024/11/14 15:02
|
|
|
|
- */
|
|
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperation("添加人员明细")
|
|
@ApiOperation("添加人员明细")
|
|
@CommonLog("添加人员明细")
|
|
@CommonLog("添加人员明细")
|
|
- @SaCheckPermission("/hr/baseemployeeinfo/add")
|
|
|
|
@PostMapping("/hr/baseemployeeinfo/add")
|
|
@PostMapping("/hr/baseemployeeinfo/add")
|
|
public CommonResult<String> add(@RequestBody @Valid HrBaseEmployeeInfoAddParam hrBaseEmployeeInfoAddParam) {
|
|
public CommonResult<String> add(@RequestBody @Valid HrBaseEmployeeInfoAddParam hrBaseEmployeeInfoAddParam) {
|
|
hrBaseEmployeeInfoService.add(hrBaseEmployeeInfoAddParam);
|
|
hrBaseEmployeeInfoService.add(hrBaseEmployeeInfoAddParam);
|
|
return CommonResult.ok();
|
|
return CommonResult.ok();
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 编辑人员明细
|
|
|
|
- *
|
|
|
|
- * @author 余
|
|
|
|
- * @date 2024/11/14 15:02
|
|
|
|
- */
|
|
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperation("编辑人员明细")
|
|
@ApiOperation("编辑人员明细")
|
|
@CommonLog("编辑人员明细")
|
|
@CommonLog("编辑人员明细")
|
|
- @SaCheckPermission("/hr/baseemployeeinfo/edit")
|
|
|
|
@PostMapping("/hr/baseemployeeinfo/edit")
|
|
@PostMapping("/hr/baseemployeeinfo/edit")
|
|
public CommonResult<String> edit(@RequestBody @Valid HrBaseEmployeeInfoEditParam hrBaseEmployeeInfoEditParam) {
|
|
public CommonResult<String> edit(@RequestBody @Valid HrBaseEmployeeInfoEditParam hrBaseEmployeeInfoEditParam) {
|
|
hrBaseEmployeeInfoService.edit(hrBaseEmployeeInfoEditParam);
|
|
hrBaseEmployeeInfoService.edit(hrBaseEmployeeInfoEditParam);
|
|
return CommonResult.ok();
|
|
return CommonResult.ok();
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 删除人员明细
|
|
|
|
- *
|
|
|
|
- * @author 余
|
|
|
|
- * @date 2024/11/14 15:02
|
|
|
|
- */
|
|
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperation("删除人员明细")
|
|
@ApiOperation("删除人员明细")
|
|
@CommonLog("删除人员明细")
|
|
@CommonLog("删除人员明细")
|
|
- @SaCheckPermission("/hr/baseemployeeinfo/delete")
|
|
|
|
@PostMapping("/hr/baseemployeeinfo/delete")
|
|
@PostMapping("/hr/baseemployeeinfo/delete")
|
|
public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
|
|
public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
|
|
CommonValidList<HrBaseEmployeeInfoIdParam> hrBaseEmployeeInfoIdParamList) {
|
|
CommonValidList<HrBaseEmployeeInfoIdParam> hrBaseEmployeeInfoIdParamList) {
|
|
@@ -115,17 +90,151 @@ public class HrBaseEmployeeInfoController {
|
|
return CommonResult.ok();
|
|
return CommonResult.ok();
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取人员明细详情
|
|
|
|
- *
|
|
|
|
- * @author 余
|
|
|
|
- * @date 2024/11/14 15:02
|
|
|
|
- */
|
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
|
|
|
+
|
|
@ApiOperation("获取人员明细详情")
|
|
@ApiOperation("获取人员明细详情")
|
|
- @SaCheckPermission("/hr/baseemployeeinfo/detail")
|
|
|
|
@GetMapping("/hr/baseemployeeinfo/detail")
|
|
@GetMapping("/hr/baseemployeeinfo/detail")
|
|
public CommonResult<HrBaseEmployeeInfo> detail(@Valid HrBaseEmployeeInfoIdParam hrBaseEmployeeInfoIdParam) {
|
|
public CommonResult<HrBaseEmployeeInfo> detail(@Valid HrBaseEmployeeInfoIdParam hrBaseEmployeeInfoIdParam) {
|
|
return CommonResult.data(hrBaseEmployeeInfoService.detail(hrBaseEmployeeInfoIdParam));
|
|
return CommonResult.data(hrBaseEmployeeInfoService.detail(hrBaseEmployeeInfoIdParam));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ApiOperation("部门本科及以上学历")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/listByEoucation")
|
|
|
|
+ public CommonResult<List<EoucationVo>> listByEoucation(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ return CommonResult.data(hrBaseEmployeeInfoService.listByEoucation(employeeInfoEoucation));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("数量统计及退休人员")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/countPerson")
|
|
|
|
+ public CommonResult<CountPerson> countPerson(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ return CommonResult.data(hrBaseEmployeeInfoService.countPerson(employeeInfoEoucation));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("历史总人数等")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/countNum")
|
|
|
|
+ public CommonResult<CountNum> countNum(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ QueryWrapper<HrBaseEmployeeInfo> mapper = new QueryWrapper<>();
|
|
|
|
+ CountNum countNum = new CountNum();
|
|
|
|
+
|
|
|
|
+ long historyNum = hrBaseEmployeeInfoService.count(mapper.eq("ORG_ID", employeeInfoEoucation.getOrgId()));
|
|
|
|
+ long jobNum = hrBaseEmployeeInfoService.count(mapper.eq("USER_TYPE",0));
|
|
|
|
+ long maleNum = hrBaseEmployeeInfoService.count(mapper.eq("GENDER",0));
|
|
|
|
+
|
|
|
|
+ countNum.setHistoryNum(historyNum);
|
|
|
|
+ countNum.setMaleNum(maleNum);
|
|
|
|
+ countNum.setFemaleNum(jobNum -maleNum);
|
|
|
|
+ countNum.setJobNum(jobNum);
|
|
|
|
+ return CommonResult.data(countNum);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("部门人数统计")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/listByDepart")
|
|
|
|
+ public CommonResult<List<EoucationVo>> listByDepart(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ return CommonResult.data(hrBaseEmployeeInfoService.listByDepart(employeeInfoEoucation));
|
|
|
|
+ }
|
|
|
|
+ @ApiOperation("部门人数统计")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/listByDepartGender")
|
|
|
|
+ public CommonResult<List<EoucationVo>> listByDepartGender(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ return CommonResult.data(hrBaseEmployeeInfoService.listByDepartGender(employeeInfoEoucation));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("年龄分布")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/ageDis")
|
|
|
|
+ public CommonResult<List<PerNum>> ageDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ String orgId = employeeInfoEoucation.getOrgId();
|
|
|
|
+ long age22 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).between("AGE", 18,22));
|
|
|
|
+ long age30 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).between("AGE", 23,30));
|
|
|
|
+ long age40 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).between("AGE", 31,40));
|
|
|
|
+ long age45 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).between("AGE", 41,45));
|
|
|
|
+ long age60 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).between("AGE", 46,60));
|
|
|
|
+ long age61 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).ge("AGE", 60));
|
|
|
|
+ ArrayList<PerNum> perNums = new ArrayList<>();
|
|
|
|
+ perNums.add(new PerNum("18-22",age22));
|
|
|
|
+ perNums.add(new PerNum("23-30",age30));
|
|
|
|
+ perNums.add(new PerNum("31-40",age40));
|
|
|
|
+ perNums.add(new PerNum("41-45",age45));
|
|
|
|
+ perNums.add(new PerNum("46-60",age60));
|
|
|
|
+ perNums.add(new PerNum("60以上",age61));
|
|
|
|
+ return CommonResult.data(perNums);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("性别分布")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/genderDis")
|
|
|
|
+ public CommonResult<List<PerNum>> genderDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ String orgId = employeeInfoEoucation.getOrgId();
|
|
|
|
+ long age22 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("GENDER", 0));
|
|
|
|
+ long age30 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("GENDER", 1));
|
|
|
|
+ ArrayList<PerNum> perNums = new ArrayList<>();
|
|
|
|
+ perNums.add(new PerNum("男性",age22));
|
|
|
|
+ perNums.add(new PerNum("女性",age30));
|
|
|
|
+ return CommonResult.data(perNums);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("婚姻状况")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/marrDis")
|
|
|
|
+ public CommonResult<List<PerNum>> marrDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ String orgId = employeeInfoEoucation.getOrgId();
|
|
|
|
+ long age22 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("MARRIAGE", 0));
|
|
|
|
+ long age30 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("MARRIAGE", 1));
|
|
|
|
+ ArrayList<PerNum> perNums = new ArrayList<>();
|
|
|
|
+ perNums.add(new PerNum("未婚",age22));
|
|
|
|
+ perNums.add(new PerNum("已婚",age30));
|
|
|
|
+ return CommonResult.data(perNums);
|
|
|
|
+ }
|
|
|
|
+ @ApiOperation("民族分布")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/nationDis")
|
|
|
|
+ public CommonResult<List<PerNum>> nationDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ String orgId = employeeInfoEoucation.getOrgId();
|
|
|
|
+ long age22 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("NATION", "汉族"));
|
|
|
|
+ long age30 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).ne("NATION", "汉族"));
|
|
|
|
+ ArrayList<PerNum> perNums = new ArrayList<>();
|
|
|
|
+ perNums.add(new PerNum("汉族",age22));
|
|
|
|
+ perNums.add(new PerNum("其他",age30));
|
|
|
|
+ return CommonResult.data(perNums);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("学历分布")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/educationDis")
|
|
|
|
+ public CommonResult<List<PerNum>> educationDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ String orgId = employeeInfoEoucation.getOrgId();
|
|
|
|
+ long age22 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("EDUCATION", 0));
|
|
|
|
+ long age2 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("EDUCATION", 1));
|
|
|
|
+ long age3 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("EDUCATION", 2));
|
|
|
|
+ long age4 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("EDUCATION", 3));
|
|
|
|
+ long age5 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("EDUCATION", 4));
|
|
|
|
+ long age6 = hrBaseEmployeeInfoService.count(new QueryWrapper<HrBaseEmployeeInfo>().eq("ORG_ID", orgId).eq("USER_TYPE",0).eq("EDUCATION", 5));
|
|
|
|
+
|
|
|
|
+ ArrayList<PerNum> perNums = new ArrayList<>();
|
|
|
|
+ perNums.add(new PerNum("小学",age22));
|
|
|
|
+ perNums.add(new PerNum("初中",age2));
|
|
|
|
+ perNums.add(new PerNum("高中",age3));
|
|
|
|
+ perNums.add(new PerNum("本科",age4));
|
|
|
|
+ perNums.add(new PerNum("研究生",age5));
|
|
|
|
+ perNums.add(new PerNum("博士研究生",age6));
|
|
|
|
+ return CommonResult.data(perNums);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("部门学历分布")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/listByDepartGenderEducationDis")
|
|
|
|
+ public CommonResult<List<EoucationVo>> listByDepartGenderEducationDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ return CommonResult.data(hrBaseEmployeeInfoService.listByDepartGenderEducationDis(employeeInfoEoucation));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("生日分布")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/birthDis")
|
|
|
|
+ public CommonResult<List<PerNum>> birthDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ return CommonResult.data(hrBaseEmployeeInfoService.birthDis(employeeInfoEoucation));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("生日分布")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/siLingDis")
|
|
|
|
+ public CommonResult<List<PerNum>> siLingDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ return CommonResult.data(hrBaseEmployeeInfoService.siLingDis(employeeInfoEoucation));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("生日分布")
|
|
|
|
+ @GetMapping("/hr/baseemployeeinfo/gongLingDis")
|
|
|
|
+ public CommonResult<List<PerNum>> gongLingDis(@Valid EmployeeInfoEoucation employeeInfoEoucation) {
|
|
|
|
+ return CommonResult.data(hrBaseEmployeeInfoService.gongLingDis(employeeInfoEoucation));
|
|
|
|
+ }
|
|
}
|
|
}
|