|
|
@@ -21,6 +21,7 @@ import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
+import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import kd.bos.servicehelper.basedata.BaseDataServiceHelper;
|
|
|
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
|
|
import kd.hr.hbp.business.servicehelper.HRQueryEntityHelper;
|
|
|
@@ -51,6 +52,7 @@ import java.util.Set;
|
|
|
import java.util.StringJoiner;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* 周期生成
|
|
|
@@ -165,10 +167,18 @@ public class CycleGenerateOpPlugin extends AbstractOperationServicePlugIn implem
|
|
|
LocalDateTime lastEnd = DateUtil.endOfYear(lastDate);
|
|
|
|
|
|
Long currUserId = RequestContext.get().getCurrUserId();
|
|
|
+ Map<Long, PerfManagerSaveOpPlugin.PersonPerfInfo> personPerfInfoMap = new HashMap<>();
|
|
|
|
|
|
+ //查询岗位工资制单位
|
|
|
+ DynamicObjectCollection postWageUnitList = QueryServiceHelper.query(PerfManagerFormConstant.POSTWAGEUNITLIST_ENTITYID, QueryFieldBuilder.create().addIdNumberName(FormConstant.NCKD_ORG).buildSelect(), null);
|
|
|
+ List<Long> postWageUnitIds = postWageUnitList.stream().map(postWageUnit -> postWageUnit.getLong(String.join(".", FormConstant.NCKD_ORG, FormConstant.ID_KEY))).collect(Collectors.toList());
|
|
|
// 在职并去年入职的人员
|
|
|
QFilter newHireFilter = buildNewHireFilter(lastBegin, lastEnd);
|
|
|
-
|
|
|
+ if(!postWageUnitIds.isEmpty()){
|
|
|
+ newHireFilter.and(String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.COMPANY_KEY), QCP.in, postWageUnitIds);
|
|
|
+ }else{
|
|
|
+ return personPerfInfoMap;
|
|
|
+ }
|
|
|
// 只处理权限范围内的人员
|
|
|
AuthorizedOrgResultWithSub userAdminOrgWithSub = HRPermissionServiceHelper.getUserAdminOrgsWithSub(
|
|
|
currUserId, "nckd_pm", PerfManagerFormConstant.PERFMANAGER_ENTITYID,
|
|
|
@@ -179,11 +189,12 @@ public class CycleGenerateOpPlugin extends AbstractOperationServicePlugIn implem
|
|
|
newHireFilter.and(String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG), QCP.in, orgIds);
|
|
|
}
|
|
|
|
|
|
- Map<Long, PerfManagerSaveOpPlugin.PersonPerfInfo> personPerfInfoMap = new HashMap<>();
|
|
|
+
|
|
|
DynamicObjectCollection newHirePersonList = queryNewHirePersons(newHireFilter);
|
|
|
|
|
|
// 构建考核周期查询条件
|
|
|
QFilter perfManagerFilter = buildPerfManagerFilter(userAdminOrgWithSub);
|
|
|
+ perfManagerFilter.and(String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.COMPANY_KEY), QCP.in, postWageUnitIds);
|
|
|
QueryFieldBuilder perfManagerQueryFieldBuilder = buildPerfManagerQueryFieldBuilder();
|
|
|
QueryEntityType perfManagerQueryEntityType = (QueryEntityType) EntityMetadataCache.getDataEntityTypeNoCache("nckd_perfmanager_query");
|
|
|
|