|
|
|
@ -52,17 +52,34 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
|
|
Employee employee = JSONObject.toJavaObject(jsonObject, Employee.class);
|
|
|
|
|
Example.Criteria criteria = example.createCriteria();
|
|
|
|
|
criteria.andEqualTo("state",Constants.STATE_VALID);
|
|
|
|
|
String honorLevel = jsonObject.getString("honorLevel");
|
|
|
|
|
String honorDescription = jsonObject.getString("honorDescription");
|
|
|
|
|
JSONArray jsonArray = jsonObject.getJSONArray("ptqIds");
|
|
|
|
|
List<Long> ptqIds = jsonArray != null ? jsonArray.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray ptqIdsJson = jsonObject.getJSONArray("ptqIds");
|
|
|
|
|
List<Long> ptqIds = ptqIdsJson != null ? ptqIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray postIdsJson = jsonObject.getJSONArray("postIds");
|
|
|
|
|
List<Long> postIds = postIdsJson != null ? postIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray groupsIdsJson = jsonObject.getJSONArray("groupsIds");
|
|
|
|
|
List<Long> groupsIds = groupsIdsJson != null ? groupsIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray skillLevelIdsJson = jsonObject.getJSONArray("skillLevelIds");
|
|
|
|
|
List<Long> skillLevelIds = skillLevelIdsJson != null ? skillLevelIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray highestEducationIdsJson = jsonObject.getJSONArray("highestEducationIds");
|
|
|
|
|
List<Long> highestEducationIds = highestEducationIdsJson != null ? highestEducationIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray unitIdsJson = jsonObject.getJSONArray("unitIds");
|
|
|
|
|
List<Long> unitIds = unitIdsJson != null ? unitIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray honorLevelsJson = jsonObject.getJSONArray("honorLevels");
|
|
|
|
|
List<Long> honorLevels = honorLevelsJson != null ? honorLevelsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray sexesJson = jsonObject.getJSONArray("sexes");
|
|
|
|
|
List<Integer> sexes = sexesJson != null ? sexesJson.toJavaList(Integer.class) : new ArrayList<>();
|
|
|
|
|
JSONArray departmentIdsJson = jsonObject.getJSONArray("departmentIds");
|
|
|
|
|
List<Long> departmentIds = departmentIdsJson != null ? departmentIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray ageIdsJson = jsonObject.getJSONArray("ageIds");
|
|
|
|
|
List<Long> ageIds = ageIdsJson != null ? ageIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
List<String> honorEmployees = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotEmpty(honorLevel) || StringUtils.isNotEmpty(honorDescription)) {
|
|
|
|
|
if ((null != honorLevels && honorLevels.size() > 0) || StringUtils.isNotEmpty(honorDescription)) {
|
|
|
|
|
Example example1 = new Example(Honor.class);
|
|
|
|
|
Example.Criteria criteria1 = example1.createCriteria();
|
|
|
|
|
criteria1.andEqualTo("state",Constants.STATE_VALID);
|
|
|
|
|
if (StringUtils.isNotEmpty(honorLevel)) {
|
|
|
|
|
criteria1.andEqualTo("honorLevel", honorLevel);
|
|
|
|
|
if (null != honorLevels && honorLevels.size() > 0) {
|
|
|
|
|
criteria1.andIn("honorLevel", honorLevels);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(honorDescription)) {
|
|
|
|
|
criteria1.andLike("honorDescription", "%"+honorDescription+"%");
|
|
|
|
@ -76,13 +93,17 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
|
|
if (honorEmployees.size() > 0) criteria.andIn("employeeNo", honorEmployees);
|
|
|
|
|
if (StringUtils.isNotEmpty(employee.getEmployeeName())) criteria.andLike("employeeName", "%"+employee.getEmployeeName()+"%");
|
|
|
|
|
if (StringUtils.isNotEmpty(employee.getMobile())) criteria.andLike("mobile", "%"+employee.getMobile()+"%");
|
|
|
|
|
if (null != employee.getPostId()) criteria.andEqualTo("postId", employee.getPostId());
|
|
|
|
|
if (null != employee.getGroupsId()) criteria.andEqualTo("groupsId", employee.getGroupsId());
|
|
|
|
|
if (null != sexes && sexes.size() > 0) criteria.andIn("sex", sexes);
|
|
|
|
|
if (null != departmentIds && departmentIds.size() > 0) criteria.andIn("departmentId", departmentIds);
|
|
|
|
|
if (null != ageIds && ageIds.size() > 0) criteria.andIn("ageId", ageIds);
|
|
|
|
|
if (null != ptqIds && ptqIds.size() > 0) criteria.andIn("ptqId", ptqIds);
|
|
|
|
|
if (null != employee.getSkillLevelId()) criteria.andEqualTo("skillLevelId", employee.getSkillLevelId());
|
|
|
|
|
if (null != employee.getHighestEducationId()) criteria.andEqualTo("highestEducationId", employee.getHighestEducationId());
|
|
|
|
|
if (null != unitIds && unitIds.size() > 0) criteria.andIn("unitId", unitIds);
|
|
|
|
|
if (null != postIds && postIds.size() > 0) criteria.andIn("postId", postIds);
|
|
|
|
|
if (null != groupsIds && groupsIds.size() > 0) criteria.andIn("groupsId", groupsIds);
|
|
|
|
|
if (null != skillLevelIds && skillLevelIds.size() > 0) criteria.andIn("skillLevelId", skillLevelIds);
|
|
|
|
|
if (null != highestEducationIds && highestEducationIds.size() > 0) criteria.andIn("highestEducationId", highestEducationIds);
|
|
|
|
|
List<Employee> employeeList = employeeMapper.selectByExample(example);
|
|
|
|
|
if ((StringUtils.isNotEmpty(honorLevel) || StringUtils.isNotEmpty(honorDescription)) && honorEmployees.size() == 0) employeeList = new ArrayList<>();
|
|
|
|
|
if (((null != honorLevels && honorLevels.size() > 0) || StringUtils.isNotEmpty(honorDescription)) && honorEmployees.size() == 0) employeeList = new ArrayList<>();
|
|
|
|
|
JSONObject pageJson = PageUtils.page(employeeList,current,pageSize);
|
|
|
|
|
return pageJson;
|
|
|
|
|
}
|
|
|
|
@ -94,17 +115,34 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
|
|
Employee employee = JSONObject.toJavaObject(jsonObject, Employee.class);
|
|
|
|
|
Example.Criteria criteria = example.createCriteria();
|
|
|
|
|
criteria.andEqualTo("state",Constants.STATE_VALID);
|
|
|
|
|
String honorLevel = jsonObject.getString("honorLevel");
|
|
|
|
|
String honorDescription = jsonObject.getString("honorDescription");
|
|
|
|
|
JSONArray jsonArray = jsonObject.getJSONArray("ptqIds");
|
|
|
|
|
List<Long> ptqIds = jsonArray.toJavaList(Long.class);
|
|
|
|
|
JSONArray ptqIdsJson = jsonObject.getJSONArray("ptqIds");
|
|
|
|
|
List<Long> ptqIds = ptqIdsJson != null ? ptqIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray postIdsJson = jsonObject.getJSONArray("postIds");
|
|
|
|
|
List<Long> postIds = postIdsJson != null ? postIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray groupsIdsJson = jsonObject.getJSONArray("groupsIds");
|
|
|
|
|
List<Long> groupsIds = groupsIdsJson != null ? groupsIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray skillLevelIdsJson = jsonObject.getJSONArray("skillLevelIds");
|
|
|
|
|
List<Long> skillLevelIds = skillLevelIdsJson != null ? skillLevelIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray highestEducationIdsJson = jsonObject.getJSONArray("highestEducationIds");
|
|
|
|
|
List<Long> highestEducationIds = highestEducationIdsJson != null ? highestEducationIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray unitIdsJson = jsonObject.getJSONArray("unitIds");
|
|
|
|
|
List<Long> unitIds = unitIdsJson != null ? unitIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray honorLevelsJson = jsonObject.getJSONArray("honorLevels");
|
|
|
|
|
List<Long> honorLevels = honorLevelsJson != null ? honorLevelsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray sexesJson = jsonObject.getJSONArray("sexes");
|
|
|
|
|
List<Integer> sexes = sexesJson != null ? sexesJson.toJavaList(Integer.class) : new ArrayList<>();
|
|
|
|
|
JSONArray departmentIdsJson = jsonObject.getJSONArray("departmentIds");
|
|
|
|
|
List<Long> departmentIds = departmentIdsJson != null ? departmentIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
JSONArray ageIdsJson = jsonObject.getJSONArray("ageIds");
|
|
|
|
|
List<Long> ageIds = ageIdsJson != null ? ageIdsJson.toJavaList(Long.class) : new ArrayList<>();
|
|
|
|
|
List<String> honorEmployees = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotEmpty(honorLevel) || StringUtils.isNotEmpty(honorDescription)) {
|
|
|
|
|
if ((null != honorLevels && honorLevels.size() > 0) || StringUtils.isNotEmpty(honorDescription)) {
|
|
|
|
|
Example example1 = new Example(Honor.class);
|
|
|
|
|
Example.Criteria criteria1 = example1.createCriteria();
|
|
|
|
|
criteria1.andEqualTo("state",Constants.STATE_VALID);
|
|
|
|
|
if (StringUtils.isNotEmpty(honorLevel)) {
|
|
|
|
|
criteria1.andEqualTo("honorLevel", honorLevel);
|
|
|
|
|
if (null != honorLevels && honorLevels.size() > 0) {
|
|
|
|
|
criteria1.andIn("honorLevel", honorLevels);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(honorDescription)) {
|
|
|
|
|
criteria1.andLike("honorDescription", "%"+honorDescription+"%");
|
|
|
|
@ -116,13 +154,17 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
|
|
if (honorEmployees.size() > 0) criteria.andIn("employeeNo", honorEmployees);
|
|
|
|
|
if (StringUtils.isNotEmpty(employee.getEmployeeName())) criteria.andLike("employeeName", "%"+employee.getEmployeeName()+"%");
|
|
|
|
|
if (StringUtils.isNotEmpty(employee.getMobile())) criteria.andLike("mobile", "%"+employee.getMobile()+"%");
|
|
|
|
|
if (null != employee.getPostId()) criteria.andEqualTo("postId", employee.getPostId());
|
|
|
|
|
if (null != employee.getGroupsId()) criteria.andEqualTo("groupsId", employee.getGroupsId());
|
|
|
|
|
if (null != ptqIds && ptqIds.size() > 0) criteria.andIn("ptqId", ptqIds);
|
|
|
|
|
if (null != employee.getSkillLevelId()) criteria.andEqualTo("skillLevelId", employee.getSkillLevelId());
|
|
|
|
|
if (null != employee.getHighestEducationId()) criteria.andEqualTo("highestEducationId", employee.getHighestEducationId());
|
|
|
|
|
if (null != sexes && sexes.size() > 0) criteria.andIn("sex", sexes);
|
|
|
|
|
if (null != departmentIds && departmentIds.size() > 0) criteria.andIn("departmentId", departmentIds);
|
|
|
|
|
if (null != ageIds && ageIds.size() > 0) criteria.andIn("ageId", ageIds);
|
|
|
|
|
if (null != unitIds && unitIds.size() > 0) criteria.andIn("unitId", unitIds);
|
|
|
|
|
if (null != postIds && postIds.size() > 0) criteria.andIn("postId", postIds);
|
|
|
|
|
if (null != groupsIds && groupsIds.size() > 0) criteria.andIn("groupsId", groupsIds);
|
|
|
|
|
if (null != skillLevelIds && skillLevelIds.size() > 0) criteria.andIn("skillLevelId", skillLevelIds);
|
|
|
|
|
if (null != highestEducationIds && highestEducationIds.size() > 0) criteria.andIn("highestEducationId", highestEducationIds);
|
|
|
|
|
List<Employee> employeeList = employeeMapper.selectByExample(example);
|
|
|
|
|
if ((StringUtils.isNotEmpty(honorLevel) || StringUtils.isNotEmpty(honorDescription)) && honorEmployees.size() == 0) employeeList = new ArrayList<>();
|
|
|
|
|
if (((null != honorLevels && honorLevels.size() > 0) || StringUtils.isNotEmpty(honorDescription)) && honorEmployees.size() == 0) employeeList = new ArrayList<>();
|
|
|
|
|
ExportParams exportParams = new ExportParams();
|
|
|
|
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams,Employee.class, employeeList);
|
|
|
|
|
ExcelUtils.export(workbook, response, "员工导出");
|
|
|
|
@ -205,6 +247,22 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
|
|
employee.setHighestEducationId(infoSettingValuesFilter.get(0).getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//年龄
|
|
|
|
|
if (StringUtils.isNotEmpty(employee.getAge())) {
|
|
|
|
|
List<InfoSettingValue> infoSettingValues = infoSettingValueService.getAllInfoSettingValueBySettingName("年龄");
|
|
|
|
|
List<InfoSettingValue> infoSettingValuesFilter = infoSettingValues.stream().filter(item -> item.getSettingValue().equals(employee.getAge())).collect(Collectors.toList());
|
|
|
|
|
if (infoSettingValuesFilter.size() > 0) {
|
|
|
|
|
employee.setAgeId(infoSettingValuesFilter.get(0).getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//部门
|
|
|
|
|
if (StringUtils.isNotEmpty(employee.getDepartment())) {
|
|
|
|
|
List<InfoSettingValue> infoSettingValues = infoSettingValueService.getAllInfoSettingValueBySettingName("部门");
|
|
|
|
|
List<InfoSettingValue> infoSettingValuesFilter = infoSettingValues.stream().filter(item -> item.getSettingValue().equals(employee.getDepartment())).collect(Collectors.toList());
|
|
|
|
|
if (infoSettingValuesFilter.size() > 0) {
|
|
|
|
|
employee.setDepartmentId(infoSettingValuesFilter.get(0).getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Employee employeeSelect = new Employee();
|
|
|
|
|
employeeSelect.setEmployeeNo(employee.getEmployeeNo());
|
|
|
|
|
employeeSelect.setState(Constants.ENABLE);
|
|
|
|
@ -253,15 +311,21 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult dataStatistics(JSONObject jsonObject) {
|
|
|
|
|
AjaxResult ajaxResult = new AjaxResult();
|
|
|
|
|
String postName = jsonObject.getString("postName");
|
|
|
|
|
JSONArray postNamesJson = jsonObject.getJSONArray("postNames");
|
|
|
|
|
List<String> postNames = postNamesJson != null ? postNamesJson.toJavaList(String.class) : new ArrayList<>();
|
|
|
|
|
JSONArray departmentsJson = jsonObject.getJSONArray("departments");
|
|
|
|
|
List<String> departments = departmentsJson != null ? departmentsJson.toJavaList(String.class) : new ArrayList<>();
|
|
|
|
|
// List<Long> postIdList = (List<Long>) Arrays.stream(postIds.split(",")).mapToLong(num -> Long.parseLong(num));
|
|
|
|
|
Integer isEdu = jsonObject.getInteger("isEdu");
|
|
|
|
|
Integer isSkill = jsonObject.getInteger("isSkill");
|
|
|
|
|
Integer isPtq = jsonObject.getInteger("isPtq");
|
|
|
|
|
Integer isDepartment = jsonObject.getInteger("isDepartment");
|
|
|
|
|
Integer isAge = jsonObject.getInteger("isAge");
|
|
|
|
|
Integer isSex = jsonObject.getInteger("isSex");
|
|
|
|
|
List<DataStatisticsVO> dataStatisticsVOS = new ArrayList<>();
|
|
|
|
|
List<String> postNameList = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotEmpty(postName)) {
|
|
|
|
|
postNameList.add(postName);
|
|
|
|
|
if (postNames != null && postNames.size() > 0) {
|
|
|
|
|
postNameList = postNames;
|
|
|
|
|
} else {
|
|
|
|
|
List<InfoSettingValue> infoSettingValues = infoSettingValueService.getAllInfoSettingValueBySettingName("岗位");
|
|
|
|
|
postNameList = infoSettingValues.stream().map(item -> item.getSettingValue()).collect(Collectors.toList());
|
|
|
|
@ -282,6 +346,27 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
|
|
List<DataAnalysisVO> dataAnalysisVOS = employeeMapper.dataStatistics(3, s);
|
|
|
|
|
dataStatisticsVO.setSkillLevelList(dataAnalysisVOS);
|
|
|
|
|
}
|
|
|
|
|
if (null != isSex && isSex == 1) {
|
|
|
|
|
List<DataAnalysisVO> dataAnalysisVOS = employeeMapper.dataStatistics(4, s);
|
|
|
|
|
dataStatisticsVO.setSexList(dataAnalysisVOS);
|
|
|
|
|
}
|
|
|
|
|
if (null != isAge && isAge == 1) {
|
|
|
|
|
List<DataAnalysisVO> dataAnalysisVOS = employeeMapper.dataStatistics(5, s);
|
|
|
|
|
dataStatisticsVO.setAgeList(dataAnalysisVOS);
|
|
|
|
|
}
|
|
|
|
|
if (null != isDepartment && isDepartment == 1) {
|
|
|
|
|
List<DataAnalysisVO> dataAnalysisVOS = employeeMapper.dataStatistics(6, s);
|
|
|
|
|
if (departments != null && departments.size()>0) {
|
|
|
|
|
List<DataAnalysisVO> dataAnalysisVOS1 = new ArrayList<>();
|
|
|
|
|
for (DataAnalysisVO dataAnalysisVO : dataAnalysisVOS) {
|
|
|
|
|
if (departments.contains(dataAnalysisVO.getAnalysisName())) {
|
|
|
|
|
dataAnalysisVOS1.add(dataAnalysisVO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dataAnalysisVOS = dataAnalysisVOS1;
|
|
|
|
|
}
|
|
|
|
|
dataStatisticsVO.setDepartmentList(dataAnalysisVOS);
|
|
|
|
|
}
|
|
|
|
|
dataStatisticsVOS.add(dataStatisticsVO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|