|
@@ -1,9 +1,14 @@
|
|
|
package nckd.jimin.jyyy.hr.tsrsc.plugin.util;
|
|
|
|
|
|
import kd.bos.algo.DataSet;
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.db.DBRoute;
|
|
|
import kd.bos.orm.ORM;
|
|
|
+import kd.bos.orm.query.QCP;
|
|
|
+import kd.bos.orm.query.QFilter;
|
|
|
+import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
+import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import kd.hr.hbp.common.util.HRDBUtil;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
|
@@ -12,7 +17,11 @@ import java.util.Date;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
public class RecUtils {
|
|
|
-
|
|
|
+ private static String appFile_entity = "tspr_appfile"; //应聘档案/候选人
|
|
|
+ private static String arfrsm_entity = "tstpm_arfrsm"; //应聘登记表
|
|
|
+ private static String casApply_entity = "nckd_casrecrapply"; //临时招聘申请
|
|
|
+ private static String yearApply_entity = "nckd_yearapply"; //年度招聘申请
|
|
|
+ private static String applyEntry_entity = "entryentity"; //招聘申请分录标识
|
|
|
/**
|
|
|
* 获取组织对应人员编制总数(包含下级)
|
|
|
* @param orgId 组织ID
|
|
@@ -58,4 +67,31 @@ public class RecUtils {
|
|
|
return nckdRellownum2.get();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据候选人管理ID 获取 临时/年度招聘申请分录的招聘部门和岗位
|
|
|
+ * @param appFileId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static DynamicObject getCasApplyEntryDyn (Long appFileId) {
|
|
|
+ //先查询候选人档案
|
|
|
+ DynamicObject appFile = BusinessDataServiceHelper.loadSingle(appFileId, appFile_entity);
|
|
|
+ //获取应聘登记表ID
|
|
|
+ Long arfRsmId = appFile.getLong("arfrsm.id");
|
|
|
+ DynamicObject arfRsm = BusinessDataServiceHelper.loadSingle(arfRsmId, arfrsm_entity);
|
|
|
+ String applyEntryId = arfRsm.getString("nckd_mokahcnum");
|
|
|
+ QFilter filter = new QFilter(applyEntry_entity + ".id", QCP.equals, applyEntryId);
|
|
|
+ String selectFields = "entryentity.nckd_recruitorg.id,entryentity.nckd_recruitpost.id";
|
|
|
+ if(QueryServiceHelper.exists(casApply_entity, applyEntryId)) {
|
|
|
+ return QueryServiceHelper.queryOne(casApply_entity, selectFields, new QFilter[]{filter});
|
|
|
+ }
|
|
|
+ else if(QueryServiceHelper.exists(yearApply_entity, applyEntryId)) {
|
|
|
+ return QueryServiceHelper.queryOne(yearApply_entity, selectFields, new QFilter[]{filter});
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|