|
|
@@ -27,6 +27,7 @@ import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
import java.util.StringJoiner;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import kd.bos.dataentity.utils.ObjectUtils;
|
|
|
|
|
|
/**
|
|
|
* 绩效排名管理保存验证插件
|
|
|
@@ -39,8 +40,17 @@ public class PerfRankMgmtSaveValidate extends AbstractValidator {
|
|
|
private final Map<String, BigDecimal> appraisalResultRatioMap = new HashMap<>();
|
|
|
@Override
|
|
|
public void validate() {
|
|
|
- String invoker = (String)this.getOption().getVariables().get(FormConstant.HR_INVOKER_PARAM_INVOKER);
|
|
|
- boolean dataMigration = FormConstant.DATA_MIGRATION.equalsIgnoreCase(invoker);
|
|
|
+ boolean dataMigration = false;
|
|
|
+ Object invoker = this.getOption().getVariables().get(FormConstant.HR_INVOKER_PARAM_INVOKER);
|
|
|
+ if(ObjectUtils.isEmpty(invoker)){
|
|
|
+ Object invoker1 = this.getOption().getVariables().get("hr_hrdmvalidatetag_of_datasource");
|
|
|
+ Object invoker2 = this.getOption().getVariables().get("hr_hrdmsynctag_of_datasource");
|
|
|
+ if(!ObjectUtils.isEmpty(invoker1) || !ObjectUtils.isEmpty(invoker2)){
|
|
|
+ dataMigration = true;
|
|
|
+ }
|
|
|
+ } else{
|
|
|
+ dataMigration = FormConstant.DATA_MIGRATION.equalsIgnoreCase(invoker.toString());
|
|
|
+ }
|
|
|
if(!dataMigration) {
|
|
|
QueryFieldBuilder queryFieldBuilder = QueryFieldBuilder.create()
|
|
|
.addGroup(new String[]{FormConstant.NCKD_ENTRYENTITY}, PerfRankMgmtConstant.NCKD_RATIO)
|
|
|
@@ -262,8 +272,17 @@ public class PerfRankMgmtSaveValidate extends AbstractValidator {
|
|
|
*/
|
|
|
private void validateEntry(DynamicObject entry, ExtendedDataEntity rowDataEntity,
|
|
|
int rowIndex, Set<Long> personIds, ValidationContext context) {
|
|
|
- String invoker = (String)this.getOption().getVariables().get(FormConstant.HR_INVOKER_PARAM_INVOKER);
|
|
|
- boolean dataMigration = FormConstant.DATA_MIGRATION.equalsIgnoreCase(invoker);
|
|
|
+ boolean dataMigration = false;
|
|
|
+ Object invoker = this.getOption().getVariables().get(FormConstant.HR_INVOKER_PARAM_INVOKER);
|
|
|
+ if(ObjectUtils.isEmpty(invoker)){
|
|
|
+ Object invoker1 = this.getOption().getVariables().get("hr_hrdmvalidatetag_of_datasource");
|
|
|
+ Object invoker2 = this.getOption().getVariables().get("hr_hrdmsynctag_of_datasource");
|
|
|
+ if(!ObjectUtils.isEmpty(invoker1) || !ObjectUtils.isEmpty(invoker2)){
|
|
|
+ dataMigration = true;
|
|
|
+ }
|
|
|
+ } else{
|
|
|
+ dataMigration = FormConstant.DATA_MIGRATION.equalsIgnoreCase(invoker.toString());
|
|
|
+ }
|
|
|
DynamicObject empPosOrgRel = entry.getDynamicObject(PerfRankMgmtConstant.NCKD_EMPPOSORGREL);
|
|
|
DynamicObject person = entry.getDynamicObject(PerfRankMgmtConstant.NCKD_PERSON);
|
|
|
if(!dataMigration && empPosOrgRel == null){
|