You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
weaver-hrm-organization/src/com/engine/organization/util/relation/EcHrmRelationUtil.java

80 lines
2.3 KiB
Java

package com.engine.organization.util.relation;
3 years ago
import com.engine.organization.entity.commom.RecordInfo;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2022/07/13
* @version: 1.0
*/
public class EcHrmRelationUtil {
private static final String HRM_COMPANY = "hrmsubcompany";
private static final String HRM_DEPARTMENT = "hrmdepartment";
private static SystemDataMapper getSystemDataMapper() {
return MapperProxyFactory.getProxy(SystemDataMapper.class);
}
private static CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private static DepartmentMapper getDepartmentMapper() {
return MapperProxyFactory.getProxy(DepartmentMapper.class);
}
private static JobMapper getJobMapper() {
return MapperProxyFactory.getProxy(JobMapper.class);
}
public static String getEcJobId(Long jclJobId) {
JobPO jobById = getJobMapper().getJobById(jclJobId);
if (null == jobById) {
return "";
}
RecordInfo hrmJobTitleByName = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmJobTitleByName(jobById.getJobName());
if (null == hrmJobTitleByName) {
return "";
}
return hrmJobTitleByName.getId();
}
/**
*
* <p>true</p>
*
* @param jobName
* @param id
* @return
*/
public static boolean isExistJob(String jobName, Long id) {
List<JobPO> jobPOS = getJobMapper().listByNameExceptId(jobName, id);
return CollectionUtils.isNotEmpty(jobPOS);
}
/**
*
* <p>true</p>
*
* @param jobName
* @param id
* @return
*/
public static boolean isNotExistJob(String jobName, Long id) {
return !isExistJob(jobName, id);
}
}