|
@@ -1,21 +1,25 @@
|
|
|
package nckd.jimin.jyyy.hr.plugin.workflow;
|
|
|
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.entity.datamodel.IDataModel;
|
|
|
import kd.bos.logging.Log;
|
|
|
import kd.bos.logging.LogFactory;
|
|
|
+import kd.bos.orm.query.QCP;
|
|
|
+import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
+import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import kd.hrmp.hrpi.business.domian.service.impl.PersonServiceImpl;
|
|
|
+import kd.hrmp.hrpi.business.infrastructure.utils.QFilterUtil;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
public class HRWorkflowUtils {
|
|
|
|
|
|
private static final Log log = LogFactory.getLog(GetFirstDeptChargerWorkflowPlugin.class);
|
|
|
|
|
|
+ public static String CONTRACT_ENTITY = "hlcm_contractfileother";
|
|
|
+
|
|
|
/**
|
|
|
* 根据部门ID获取一级部门ID
|
|
|
* @param adminOrgId
|
|
@@ -97,7 +101,21 @@ public class HRWorkflowUtils {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 按照人员查询未终止的其他附属协议
|
|
|
+ * @param personId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static DynamicObjectCollection getOtherContractByPersonId(String personId) {
|
|
|
+ QFilter filter = QFilterUtil.getCurrentQf();
|
|
|
+ filter.and("datastatus", QCP.equals, "1");
|
|
|
+ filter.and("person.id", QCP.equals, Long.valueOf(personId));
|
|
|
+ filter.and("startdate", QCP.less_equals, new Date());
|
|
|
+ filter.and("enddate", QCP.large_equals, new Date());
|
|
|
+ filter.and("actualenddate", QCP.is_null, null);
|
|
|
+ filter.and("contracttype.number", QCP.equals, "1030_S");
|
|
|
+ String selectFields = "entryentity.contracttemplate.name";
|
|
|
+ DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter},"startdate desc,signstatus desc");
|
|
|
+ return contractCols;
|
|
|
+ }
|
|
|
}
|