Просмотр исходного кода

Merge branch 'refs/heads/feat-swc-mas_1.0'

wyc 3 дней назад
Родитель
Сommit
ce472a679a

+ 10 - 0
code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/constant/FormConstant.java

@@ -68,6 +68,14 @@ public class FormConstant {
     public static final String NCKD_HRPI_PARTYPOSH = "nckd_hrpi_partyposh";
     /** 人员附表-法人单位任职信息-实体 */
     public static final String NCKD_HRPI_LEGALPOST = "nckd_hrpi_legalpost";
+    /** 计薪人员 */
+    public static final String HSBS_EMPLOYEE = "hsbs_employee";
+    /** 法人单位 */
+    public static final String HBSS_LAWENTITY = "hbss_lawentity";
+    /** 法人岗位层级 */
+    public static final String NCKD_HBSS_LEGPOSTLV = "nckd_hbss_legpostlv";
+    /** 岗位管理层级 */
+    public static final String NCKD_HPFS_POSTLEVEL = "nckd_hpfs_postlevel";
 
     //====================================== 标品op ======================================
     /** 确认框确认按钮 */
@@ -311,6 +319,8 @@ public class FormConstant {
     public static final String NCKD_WORKNATURE = "nckd_worknature";
     /** 行政组织 */
     public static final String NCKD_ORG = "nckd_org";
+    /** 人员 */
+    public static final String NCKD_EMPLOYEE = "nckd_employee";
 
 
 

+ 31 - 0
code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/enums/ProjectCategoryEnum.java

@@ -0,0 +1,31 @@
+package nckd.jxccl.base.common.enums;
+
+/**
+* 【薪酬福利云】-项目分类枚举
+* @author W.Y.C
+* @date 2025/7/14 14:25
+* @version 1.0
+*/
+public enum ProjectCategoryEnum {
+
+    BASIC_YEARLY("01", "基本年薪"),
+    PERFORMANCE_YEARLY("02", "绩效年薪"),
+    ITEM_AWARD("03", "单项奖"),
+    TERM_INCENTIVE("04", "任期激励"),
+    LONGTERM_INCENTIVE("05", "中长期激励");
+    private final String code;
+    private final String name;
+
+    ProjectCategoryEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

+ 20 - 0
code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/utils/DateUtil.java

@@ -711,4 +711,24 @@ public class DateUtil {
         }
         return result;
     }
+
+    /**
+     * 获取远期截止日期(2199年12月31日)
+     * 常用于表示无截止日期限制的场景
+     *
+     * @return 2199年12月31日 23:59:59.999999999
+     */
+    public static LocalDateTime getMaxDate() {
+        return LocalDateTime.of(2199, 12, 31, 23, 59, 59, 999999999);
+    }
+
+    /**
+     * 获取远期截止日期(2199年12月31日)
+     * 常用于表示无截止日期限制的场景
+     *
+     * @return 2199年12月31日
+     */
+    public static Date getMaxDateAsDate() {
+        return toDate(getMaxDate());
+    }
 }

+ 33 - 11
code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/utils/ShowOperExecuteResult.java

@@ -4,6 +4,7 @@ import kd.bos.dataentity.resource.ResManager;
 import kd.bos.dataentity.serialization.DataEntitySerializer;
 import kd.bos.dataentity.serialization.DataEntitySerializerOption;
 import kd.bos.entity.operate.result.IOperateInfo;
+import kd.bos.entity.operate.result.OperateErrorInfo;
 import kd.bos.entity.operate.result.OperationResult;
 import kd.bos.form.FormShowParameter;
 import kd.bos.form.IPageCache;
@@ -11,6 +12,7 @@ import kd.bos.form.ShowType;
 import org.apache.commons.lang3.StringUtils;
 
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.StringJoiner;
 
@@ -65,11 +67,37 @@ public class ShowOperExecuteResult {
 
         // 收集所有错误或验证信息
         StringJoiner errorMsgJoiner = new StringJoiner(StrFormatter.LINE_SEPARATOR);
-        for (IOperateInfo error : operationResult.getAllErrorOrValidateInfo()) {
-            errorMsgJoiner.add(error.getMessage());
+
+        // 构建自定义参数
+        Map<String, Object> customParam = new HashMap(2);
+        // 如果有成功记录映射关系,则添加到参数中
+        if (successMap != null && !successMap.isEmpty()) {
+            // 成功消息
+            customParam.put("pkNumbers", successMap);
+            for (Map.Entry<Object, Object> objectObjectEntry : successMap.entrySet()) {
+                Object key = objectObjectEntry.getKey();
+                Object value = objectObjectEntry.getValue();
+                String tip = value != null ? ConvertUtil.toStr( value) : ConvertUtil.toStr( key);
+                errorMsgJoiner.add(String.format(ResManager.loadKDString("%s:执行成功。", "ShowOperationResultPlugin_2", "bos-designer-plugin", new Object[0]), tip));
+            }
+        }
+
+        if(operationResult.getAllErrorOrValidateInfo() != null && !operationResult.getAllErrorOrValidateInfo().isEmpty()){
+            Iterator<IOperateInfo> iterator = operationResult.getAllErrorOrValidateInfo().iterator();
+            while (iterator.hasNext()) {
+                IOperateInfo operateInfo = iterator.next();
+                if(operateInfo instanceof OperateErrorInfo){
+                    OperateErrorInfo operateErrorInfo = (OperateErrorInfo) operateInfo;
+                    int dataEntityIndex = operateErrorInfo.getDataEntityIndex();
+                    String prefix = operationResult.getCustomData().get("DataEntityIndex_" + dataEntityIndex);
+                    if(StringUtils.isNotBlank(prefix)){
+                        operateErrorInfo.setMessage(prefix + operateErrorInfo.getMessage());
+                    }
+                }
+                errorMsgJoiner.add(operateInfo.getMessage());
+            }
         }
         String errorMsg = errorMsgJoiner.toString();
-        
         // 如果没有具体的错误详情,则使用操作结果中的通用消息
         if (StringUtils.isBlank(errorMsg)) {
             errorMsg = operationResult.getMessage();
@@ -80,8 +108,7 @@ public class ShowOperExecuteResult {
         option.setIncludeComplexProperty(true);
         pageCache.put("operationresult", DataEntitySerializer.serializerToString(operationResult, option));
         
-        // 构建自定义参数
-        Map<String, Object> customParam = new HashMap(2);
+
         customParam.put("operateName", operateName);
         
         // 设置标题:如果有自定义标题则使用,否则根据成功/失败数量自动生成
@@ -93,16 +120,11 @@ public class ShowOperExecuteResult {
             int validError = billCount - successCount;
             customParam.put("title", ResManager.loadKDString("成功数量:%1$s,失败数量:%2$s", "AbstractFormView_8", "bos-form-metadata", new Object[]{successCount, validError}));
         }
-        
         // 添加其他参数
         customParam.put("hasMore", true);
         customParam.put("errorMsg", errorMsg);
         
-        // 如果有成功记录映射关系,则添加到参数中
-        if (successMap != null && !successMap.isEmpty()) {
-            // 成功消息
-            customParam.put("pkNumbers", successMap);
-        }
+
         
         // 构造表单显示参数对象
         FormShowParameter parameter = new FormShowParameter();

+ 154 - 0
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/common/MasConstant.java

@@ -0,0 +1,154 @@
+package nckd.jxccl.swc.mas.common;
+
+import nckd.jxccl.base.common.constant.FormConstant;
+
+/**
+ * 中高层年薪常量类
+ *
+ * @author W.Y.C
+ * @version 1.0
+ * @date 2025-11-27 18:37:26
+ */
+public class MasConstant extends FormConstant {
+    /** 子企业负责人任职情况-实体标识 */
+    public static final String SUBCOHEADSERVICE_ENTITYID = "nckd_subcoheadservice";
+    /** 年度 */
+    public static final String NCKD_YEAR = "nckd_year";
+    /** 所属二级单位 */
+    public static final String NCKD_PAYUNIT = "nckd_payunit";
+    /** 法人单位 */
+    public static final String NCKD_LAWENTITY = "nckd_lawentity";
+    /** 员工 */
+    public static final String NCKD_EMPLOYEE = "nckd_employee";
+    /** 职务 */
+    public static final String NCKD_POSNAME = "nckd_posname";
+    /** 任职开始时间 */
+    public static final String NCKD_STARTDATE = "nckd_startdate";
+    /** 任职结束时间 */
+    public static final String NCKD_ENDDATE = "nckd_enddate";
+    /** 本年任职月数 */
+    public static final String NCKD_SERVICEMONTHS = "nckd_servicemonths";
+    /** 是否直管干部 */
+    public static final String NCKD_ISDIRCADRE = "nckd_isdircadre";
+    /** 是否职业经理人 */
+    public static final String NCKD_ISPROFMAN = "nckd_isprofman";
+    /** 是否经理层成员 */
+    public static final String NCKD_ISMANAGER = "nckd_ismanager";
+    /** 薪酬是否一人一议 */
+    public static final String NCKD_SALNEGOT = "nckd_salnegot";
+    /** 岗位管理层级 */
+    public static final String NCKD_POSTLEVEL = "nckd_postlevel";
+    /** 法人岗位层级 */
+    public static final String NCKD_LEGPOSTLV = "nckd_legpostlv";
+    /** 薪酬核算岗位 */
+    public static final String NCKD_SALCALCPOST = "nckd_salcalcpost";
+    /** 载入党政职务履历 */
+    public static final String LOADPARTYPOSITION_OP = "loadpartyposition";
+    /** 是否高管*/
+    public static final String NCKD_ISEXEC = "nckd_isexec";
+
+
+    /*-------------------------------------- 企业负责人信息常量类 begin --------------------------------------*/
+    /** 企业负责人类型 */
+    public static final String NCKD_HEADTYPE = "nckd_headtype";
+    /** 职业经理人类型 */
+    public static final String NCKD_PROFMANTYP = "nckd_profmantyp";
+    /** 任期 */
+    public static final String NCKD_TERM = "nckd_term";
+    /** 是否实行任期制和契约化管理 */
+    public static final String NCKD_TERMCONT = "nckd_termcont";
+    /*-------------------------------------- 企业负责人信息常量类 end --------------------------------------*/
+
+    /*-------------------------------------- 党政职务变更履历常量类 begin --------------------------------------*/
+    /** 变动时间 */
+    public static final String NCKD_CHANGETIME = "nckd_changetime";
+    /** 职务变动类别 */
+    public static final String NCKD_POSCHTP = "nckd_poschtp";
+    /** 职务层次 */
+    public static final String NCKD_POSLEVEL = "nckd_poslevel";
+    /** 职务级别 */
+    public static final String NCKD_POSGRADE = "nckd_posgrade";
+    /** 任免方式 */
+    public static final String NCKD_APPRWAY = "nckd_apprway";
+    /** 任职部门 */
+    public static final String NCKD_OFFICEDEPT = "nckd_officedept";
+    /** 任免职文号 */
+    public static final String NCKD_APPRDOCNO = "nckd_apprdocno";
+    /** 原职务级别 */
+    public static final String NCKD_ORGPOSGRD = "nckd_orgposgrd";
+    /*-------------------------------------- 党政职务变更履历常量类 end --------------------------------------*/
+
+
+    /*-------------------------------------- 子企业负责人薪酬结构常量类 begin --------------------------------------*/
+    /** 子企业负责人薪酬结构-实体标识 */
+    public static final String SUBCORPSALARY_ENTITYID = "nckd_subcorpsalary";
+    /** 项目分类 */
+    public static final String NCKD_PROJECTCATEGORY = "nckd_projectcategory";
+    /** 薪酬项目 */
+    public static final String NCKD_SALARYITEM = "nckd_salaryitem";
+    /** 是否延期支付项目 */
+    public static final String NCKD_DEFERREDPAYITEM = "nckd_deferredpayitem";
+    /** 延期支付薪酬项目支付说明 */
+    public static final String NCKD_DEFERREDPAYDESC = "nckd_deferredpaydesc";
+    /** 任期激励支付说明 */
+    public static final String NCKD_TERMPAYDESC = "nckd_termpaydesc";
+
+    /*-------------------------------------- 子企业负责人薪酬结构常量类 end --------------------------------------*/
+
+
+    /*-------------------------------------- 子企业负责人薪酬结构常量类 begin --------------------------------------*/
+    /** 子企业负责人正职年度薪酬核定标准-实体标识 */
+    public static final String SUBCORPCHIEFSALSTD_ENTITYID = "nckd_subcorpchiefsalstd";
+    /** 单据体 */
+    public static final String NCKD_ENTRYENTITY = "nckd_entryentity";
+    /** 分期支付总年数 */
+    public static final String NCKD_INSTALLMENTYEARS = "nckd_installmentyears";
+    /** 支付年份1 */
+    public static final String NCKD_PAYYEAR = "nckd_payyear";
+    /** 支付金额1 */
+    public static final String NCKD_PAYAMOUNT = "nckd_payamount";
+    /** 支付年份1 */
+    public static final String NCKD_PAYYEAR1 = "nckd_payyear1";
+    /** 支付金额1 */
+    public static final String NCKD_PAYAMOUNT1 = "nckd_payamount1";
+    /** 支付年份2 */
+    public static final String NCKD_PAYYEAR2 = "nckd_payyear2";
+    /** 支付金额2 */
+    public static final String NCKD_PAYAMOUNT2 = "nckd_payamount2";
+    /** 支付年份3 */
+    public static final String NCKD_PAYYEAR3 = "nckd_payyear3";
+    /** 支付金额3 */
+    public static final String NCKD_PAYAMOUNT3 = "nckd_payamount3";
+    /** 支付年份4 */
+    public static final String NCKD_PAYYEAR4 = "nckd_payyear4";
+    /** 支付金额4 */
+    public static final String NCKD_PAYAMOUNT4 = "nckd_payamount4";
+    /** 支付年份5 */
+    public static final String NCKD_PAYYEAR5 = "nckd_payyear5";
+    /** 支付金额5 */
+    public static final String NCKD_PAYAMOUNT5 = "nckd_payamount5";
+    /** 支付年份6 */
+    public static final String NCKD_PAYYEAR6 = "nckd_payyear6";
+    /** 支付金额6 */
+    public static final String NCKD_PAYAMOUNT6 = "nckd_payamount6";
+    /** 支付年份7 */
+    public static final String NCKD_PAYYEAR7 = "nckd_payyear7";
+    /** 支付金额7 */
+    public static final String NCKD_PAYAMOUNT7 = "nckd_payamount7";
+    /** 支付年份8 */
+    public static final String NCKD_PAYYEAR8 = "nckd_payyear8";
+    /** 支付金额8 */
+    public static final String NCKD_PAYAMOUNT8 = "nckd_payamount8";
+    /** 支付年份9 */
+    public static final String NCKD_PAYYEAR9 = "nckd_payyear9";
+    /** 支付金额9 */
+    public static final String NCKD_PAYAMOUNT9 = "nckd_payamount9";
+    /** 支付年份10 */
+    public static final String NCKD_PAYYEAR10 = "nckd_payyear10";
+    /** 支付金额10 */
+    public static final String NCKD_PAYAMOUNT10 = "nckd_payamount10";
+    /** 子企业负责人薪酬结构(分录) */
+    public static final String NCKD_SUBCORPSALARYENTRY = "nckd_subcorpsalaryentry";
+    /*-------------------------------------- 子企业负责人薪酬结构常量类 begin --------------------------------------*/
+
+}

+ 0 - 80
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/common/SubCoHeadServiceConstant.java

@@ -1,80 +0,0 @@
-package nckd.jxccl.swc.mas.common;
-
-import nckd.jxccl.base.common.constant.FormConstant;
-
-/**
- * 子企业负责人任职情况常量类
- *
- * @author W.Y.C
- * @version 1.0
- * @date 2025-11-27 18:37:26
- */
-public class SubCoHeadServiceConstant extends FormConstant {
-    /** 子企业负责人任职情况-实体标识 */
-    public static final String SUBCOHEADSERVICE_ENTITYID = "nckd_subcoheadservice";
-    /** 年度 */
-    public static final String NCKD_YEAR = "nckd_year";
-    /** 所属二级单位 */
-    public static final String NCKD_PAYUNIT = "nckd_payunit";
-    /** 法人单位 */
-    public static final String NCKD_LAWENTITY = "nckd_lawentity";
-    /** 员工 */
-    public static final String NCKD_EMPLOYEE = "nckd_employee";
-    /** 职务 */
-    public static final String NCKD_POSNAME = "nckd_posname";
-    /** 任职开始时间 */
-    public static final String NCKD_STARTDATE = "nckd_startdate";
-    /** 任职结束时间 */
-    public static final String NCKD_ENDDATE = "nckd_enddate";
-    /** 本年任职月数 */
-    public static final String NCKD_SERVICEMONTHS = "nckd_servicemonths";
-    /** 是否直管干部 */
-    public static final String NCKD_ISDIRCADRE = "nckd_isdircadre";
-    /** 是否职业经理人 */
-    public static final String NCKD_ISPROFMAN = "nckd_isprofman";
-    /** 是否经理层成员 */
-    public static final String NCKD_ISMANAGER = "nckd_ismanager";
-    /** 薪酬是否一人一议 */
-    public static final String NCKD_SALNEGOT = "nckd_salnegot";
-    /** 岗位管理层级 */
-    public static final String NCKD_POSTLEVEL = "nckd_postlevel";
-    /** 法人岗位层级 */
-    public static final String NCKD_LEGPOSTLV = "nckd_legpostlv";
-    /** 薪酬核算岗位 */
-    public static final String NCKD_SALCALCPOST = "nckd_salcalcpost";
-    /** 载入党政职务履历 */
-    public static final String LOADPARTYPOSITION_OP = "loadpartyposition";
-    /** 是否高管*/
-    public static final String NCKD_ISEXEC = "nckd_isexec";
-
-
-    /*-------------------------------------- 企业负责人信息常量类 begin --------------------------------------*/
-    /** 企业负责人类型 */
-    public static final String NCKD_HEADTYPE = "nckd_headtype";
-    /** 职业经理人类型 */
-    public static final String NCKD_PROFMANTYP = "nckd_profmantyp";
-    /** 任期 */
-    public static final String NCKD_TERM = "nckd_term";
-    /** 是否实行任期制和契约化管理 */
-    public static final String NCKD_TERMCONT = "nckd_termcont";
-    /*-------------------------------------- 企业负责人信息常量类 end --------------------------------------*/
-
-    /*-------------------------------------- 党政职务变更履历常量类 begin --------------------------------------*/
-    /** 变动时间 */
-    public static final String NCKD_CHANGETIME = "nckd_changetime";
-    /** 职务变动类别 */
-    public static final String NCKD_POSCHTP = "nckd_poschtp";
-    /** 职务层次 */
-    public static final String NCKD_POSLEVEL = "nckd_poslevel";
-    /** 职务级别 */
-    public static final String NCKD_POSGRADE = "nckd_posgrade";
-    /** 任免方式 */
-    public static final String NCKD_APPRWAY = "nckd_apprway";
-    /** 任职部门 */
-    public static final String NCKD_OFFICEDEPT = "nckd_officedept";
-    /** 任免职文号 */
-    public static final String NCKD_APPRDOCNO = "nckd_apprdocno";
-    /** 原职务级别 */
-    public static final String NCKD_ORGPOSGRD = "nckd_orgposgrd";
-    /*-------------------------------------- 党政职务变更履历常量类 end --------------------------------------*/
-}

+ 199 - 96
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/empmgt/SubCoHeadServiceListPlugin.java

@@ -8,11 +8,11 @@ import kd.bos.dataentity.entity.DynamicObject;
 import kd.bos.dataentity.entity.DynamicObjectCollection;
 import kd.bos.entity.EntityMetadataCache;
 import kd.bos.entity.MainEntityType;
+import kd.bos.entity.constant.StatusEnum;
 import kd.bos.entity.operate.result.OperationResult;
 import kd.bos.form.IFormView;
 import kd.bos.form.IPageCache;
 import kd.bos.form.MessageBoxOptions;
-import kd.bos.form.ShowType;
 import kd.bos.form.events.AfterDoOperationEventArgs;
 import kd.bos.list.plugin.AbstractListPlugin;
 import kd.bos.mvc.SessionManager;
@@ -20,7 +20,6 @@ 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.bos.servicehelper.operation.SaveServiceHelper;
 import kd.hr.hbp.common.model.AuthorizedOrgResultWithSub;
 import kd.sdk.hr.hbp.business.helper.permission.HRPermissionServiceHelper;
@@ -29,11 +28,9 @@ import nckd.jxccl.base.common.constant.FormConstant;
 import nckd.jxccl.base.common.utils.DateUtil;
 import nckd.jxccl.base.common.utils.QueryFieldBuilder;
 import nckd.jxccl.base.common.utils.ShowOperExecuteResult;
-import nckd.jxccl.base.common.utils.StrFormatter;
 import nckd.jxccl.base.entity.helper.EntityHelper;
 import nckd.jxccl.base.hrpi.helper.EmpPosOrgRelHelper;
-import nckd.jxccl.base.orm.helper.QFilterCommonHelper;
-import nckd.jxccl.swc.mas.common.SubCoHeadServiceConstant;
+import nckd.jxccl.swc.mas.common.MasConstant;
 
 import java.time.LocalDateTime;
 import java.time.temporal.ChronoUnit;
@@ -44,6 +41,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.function.BinaryOperator;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -61,7 +59,7 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
     public void afterDoOperation(AfterDoOperationEventArgs e) {
         String operateKey = e.getOperateKey();
         if(e.getOperationResult() != null && e.getOperationResult().isSuccess()){
-            if(SubCoHeadServiceConstant.LOADPARTYPOSITION_OP.equals(operateKey)){
+            if(MasConstant.LOADPARTYPOSITION_OP.equals(operateKey)){
                 //载入党政职务履历
                 loadParTyPosition();
             }
@@ -101,105 +99,186 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
         // 只处理权限范围内的人员
         Long currUserId = RequestContext.get().getCurrUserId();
         AuthorizedOrgResultWithSub userAdminOrgWithSub = HRPermissionServiceHelper.getUserAdminOrgsWithSub(
-                currUserId, "nckd_pm", SubCoHeadServiceConstant.SUBCOHEADSERVICE_ENTITYID,
+                currUserId, "nckd_pm", MasConstant.SUBCOHEADSERVICE_ENTITYID,
                 PermItemConst.ITEM_VIEW, "nckd_employee.hsbs_empposorgrel.adminorg", new HashMap<>());
         QueryFieldBuilder subCoHeadServiceFieldBuilder = QueryFieldBuilder.create()
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_EMPLOYEE);
+                .addIdNumberName(MasConstant.NCKD_EMPLOYEE);
         //查询当年已生成子企业负责人任职情况的人员
-        QFilter subCoHeadServiceFilter = new QFilter(SubCoHeadServiceConstant.NCKD_YEAR, QCP.large_equals, startOfYear)
-                .and(SubCoHeadServiceConstant.NCKD_YEAR, QCP.less_equals, endOfYear);
-        DynamicObjectCollection subCoHeadServiceFilterQuery = QueryServiceHelper.query(SubCoHeadServiceConstant.SUBCOHEADSERVICE_ENTITYID, subCoHeadServiceFieldBuilder.buildSelect(), new QFilter[]{subCoHeadServiceFilter});
+        QFilter subCoHeadServiceFilter = new QFilter(MasConstant.NCKD_YEAR, QCP.large_equals, startOfYear)
+                .and(MasConstant.NCKD_YEAR, QCP.less_equals, endOfYear);
+        DynamicObjectCollection subCoHeadServiceFilterQuery = QueryServiceHelper.query(MasConstant.SUBCOHEADSERVICE_ENTITYID, subCoHeadServiceFieldBuilder.buildSelect(), new QFilter[]{subCoHeadServiceFilter});
         List<Long> employeeIds = subCoHeadServiceFilterQuery.stream()
-                .map(dynamicObject -> dynamicObject.getLong(String.join(".", SubCoHeadServiceConstant.NCKD_EMPLOYEE, FormConstant.ID_KEY)))
+                .map(dynamicObject -> dynamicObject.getLong(String.join(".", MasConstant.NCKD_EMPLOYEE, FormConstant.ID_KEY)))
                 .collect(Collectors.toList());
 
         //查询党政履历
 //        nckd_hrpi_partyposh
         QueryFieldBuilder partyPoshFieldBuilder = QueryFieldBuilder.create()
-                .add(SubCoHeadServiceConstant.STARTDATE)
-                .add(SubCoHeadServiceConstant.ENDDATE)
-                .add(SubCoHeadServiceConstant.NCKD_PAYUNIT)
+                .add(MasConstant.STARTDATE)
+                .add(MasConstant.ENDDATE)
+                .add(MasConstant.NCKD_PAYUNIT)
                 //变动时间
-                .add(SubCoHeadServiceConstant.NCKD_CHANGETIME)
-                .add(SubCoHeadServiceConstant.NCKD_POSNAME)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_POSCHTP)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_POSLEVEL)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_POSGRADE)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_APPRWAY)
-                .add(SubCoHeadServiceConstant.NCKD_OFFICEDEPT)
-                .add(SubCoHeadServiceConstant.NCKD_APPRDOCNO)
-                .add(SubCoHeadServiceConstant.NCKD_ISDIRCADRE)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_ORGPOSGRD)
-                .addIdNumberName(SubCoHeadServiceConstant.EMPLOYEE_KEY)
-                .orderDesc(SubCoHeadServiceConstant.STARTDATE,SubCoHeadServiceConstant.ENDDATE);
-        QFilter partyPoshFilter = new QFilter(SubCoHeadServiceConstant.STARTDATE, QCP.less_equals, endOfYear)
-                .and(new QFilter(SubCoHeadServiceConstant.ENDDATE, QCP.is_null,null)
-                        .or(SubCoHeadServiceConstant.ENDDATE, QCP.large_equals, startOfYear))
-                //TODO 法人岗位层级为高管
-                .and(FormConstant.EMPLOYEE_KEY, QCP.not_in, employeeIds);
-        DynamicObjectCollection partyPoshQuery = QueryServiceHelper.query(FormConstant.NCKD_HRPI_PARTYPOSH, partyPoshFieldBuilder.buildSelect(), new QFilter[]{partyPoshFilter});
+                .add(MasConstant.NCKD_CHANGETIME)
+                .add(MasConstant.NCKD_POSNAME)
+                .addIdNumberName(MasConstant.NCKD_POSCHTP)
+                .addIdNumberName(MasConstant.NCKD_POSLEVEL)
+                .addIdNumberName(MasConstant.NCKD_POSGRADE)
+                .addIdNumberName(MasConstant.NCKD_APPRWAY)
+                .add(MasConstant.NCKD_OFFICEDEPT)
+                .add(MasConstant.NCKD_APPRDOCNO)
+                .add(MasConstant.NCKD_ISDIRCADRE)
+                .addIdNumberName(MasConstant.NCKD_ORGPOSGRD)
+                .addIdNumberName(MasConstant.EMPLOYEE_KEY)
+                .addIdNumberName(MasConstant.NCKD_ORG)
+                .orderDesc(MasConstant.STARTDATE, MasConstant.ENDDATE);
+        QFilter allPartyPoshFilter = new QFilter(MasConstant.EMPLOYEE_KEY, QCP.not_in, employeeIds);
+                //TODO 法人岗位层级为高管;
+        DynamicObjectCollection allPartyPoshQuery = QueryServiceHelper.query(FormConstant.NCKD_HRPI_PARTYPOSH, partyPoshFieldBuilder.buildSelect(), new QFilter[]{allPartyPoshFilter});
         //按员工ID分组
-        Map<Long, DynamicObject> latestPartyPoshRecordMap = partyPoshQuery.stream()
-                .collect(Collectors.toMap(obj -> obj.getLong(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY)), Function.identity(), BinaryOperator.maxBy(Comparator.comparing(
-                        // 按 STARTDATE 字段比较
-                        obj -> obj.getDate(SubCoHeadServiceConstant.STARTDATE)
-                ))));
+        Map<Long, List<DynamicObject>> groupedPartyPoshQuery = allPartyPoshQuery.stream()
+                .collect(Collectors.groupingBy(
+                        obj -> obj.getLong(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY))
+                ));
+
+        // 找出当年范围内的党政履历信息(如果有多条则取开始时间最新一条)
+        Map<Long, DynamicObject> latestPartyPoshRecordMap = new HashMap<>();
+        // 用于存储下一条党政履历记录的映射
+        Map<Long, DynamicObject> nextPartyPoshRecordMap = new HashMap<>();
+        for (Map.Entry<Long, List<DynamicObject>> entry : groupedPartyPoshQuery.entrySet()) {
+            Long employeeId = entry.getKey();
+            List<DynamicObject> records = entry.getValue();
+
+            // 筛选出在当年时间范围内的记录,然后取STARTDATE最新的那一条
+            Optional<DynamicObject> latestRecord = records.stream()
+                    .filter(record -> {
+                        Date startDate = record.getDate(MasConstant.STARTDATE);
+                        Date endDate = record.getDate(MasConstant.ENDDATE);
+                        // 判断记录是否在当年范围内
+                        return startDate != null && !startDate.after(endOfYear) &&
+                                (endDate == null || !endDate.before(startOfYear));
+                    })
+                    .max(Comparator.comparing(record -> record.getDate(MasConstant.STARTDATE),
+                            Comparator.nullsFirst(Comparator.naturalOrder())));
+
+            if (latestRecord.isPresent()) {
+                DynamicObject currentRecord = latestRecord.get();
+                latestPartyPoshRecordMap.put(employeeId, currentRecord);
+
+                // 根据当前记录的结束时间查找下一条记录
+                Date currentEndDate = currentRecord.getDate(MasConstant.ENDDATE);
+                if (currentEndDate != null) {
+                    // 查找开始时间等于当前记录结束时间的下一条记录
+                    Optional<DynamicObject> nextRecord = records.stream()
+                            .filter(record -> {
+                                Date startDate = record.getDate(MasConstant.STARTDATE);
+                                // 查找开始时间等于当前记录结束时间的记录
+                                return startDate != null && !startDate.before(currentEndDate);
+                            })
+                            .findFirst();
+
+                    nextRecord.ifPresent(record -> nextPartyPoshRecordMap.put(employeeId, record));
+                }
+            }
+        }
+
 
         //查询企业负责人信息
         QueryFieldBuilder entHeadFieldBuilder = QueryFieldBuilder.create()
-                .add(SubCoHeadServiceConstant.STARTDATE)
-                .add(SubCoHeadServiceConstant.ENDDATE)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_HEADTYPE)
-                .add(SubCoHeadServiceConstant.NCKD_ISPROFMAN)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_PROFMANTYP)
-                .add(SubCoHeadServiceConstant.NCKD_ISMANAGER)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_SALCALCPOST)
-                .add(SubCoHeadServiceConstant.NCKD_SALNEGOT)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_TERM)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_POSTLEVEL)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_LEGPOSTLV)
-                .addIdNumberName(SubCoHeadServiceConstant.EMPLOYEE_KEY)
-                .add(SubCoHeadServiceConstant.NCKD_TERMCONT)
-                .orderDesc(SubCoHeadServiceConstant.STARTDATE,SubCoHeadServiceConstant.ENDDATE);
-        QFilter entHeadFilter = new QFilter(SubCoHeadServiceConstant.STARTDATE, QCP.less_equals, endOfYear)
-                .and(new QFilter(SubCoHeadServiceConstant.ENDDATE, QCP.is_null,null)
-                        .or(SubCoHeadServiceConstant.ENDDATE, QCP.large_equals, startOfYear))
-                .and(FormConstant.EMPLOYEE_KEY,QCP.not_in, employeeIds)
+                .add(MasConstant.STARTDATE)
+                .add(MasConstant.ENDDATE)
+                .addIdNumberName(MasConstant.NCKD_HEADTYPE)
+                .add(MasConstant.NCKD_ISPROFMAN)
+                .addIdNumberName(MasConstant.NCKD_PROFMANTYP)
+                .add(MasConstant.NCKD_ISMANAGER)
+                .addIdNumberName(MasConstant.NCKD_SALCALCPOST)
+                .add(MasConstant.NCKD_SALNEGOT)
+                .addIdNumberName(MasConstant.NCKD_TERM)
+                .addIdNumberName(MasConstant.NCKD_POSTLEVEL)
+                .addIdNumberName(MasConstant.NCKD_LEGPOSTLV)
+                .addIdNumberName(MasConstant.EMPLOYEE_KEY)
+                .add(MasConstant.NCKD_TERMCONT)
+                .orderDesc(MasConstant.STARTDATE, MasConstant.ENDDATE);
+
+        //查询下一段的企业负责人信息;用于后续逻辑查找下一段的负责人信息
+        QFilter allEntHeadFilter = new QFilter(FormConstant.EMPLOYEE_KEY, QCP.not_in, employeeIds)
                 //法人岗位层级为高管
-                .and(String.join(".", SubCoHeadServiceConstant.NCKD_LEGPOSTLV, SubCoHeadServiceConstant.NCKD_ISEXEC),QCP.equals, EnableEnum.YES.getCode());
-        DynamicObjectCollection entHeadQuery = QueryServiceHelper.query(FormConstant.NCKD_HRPI_ENTHEAD, entHeadFieldBuilder.buildSelect(), new QFilter[]{entHeadFilter});
-        Map<Long, DynamicObject> entHeadRecordMap = entHeadQuery.stream()
-                .collect(Collectors.toMap(obj -> obj.getLong(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY)), Function.identity(), BinaryOperator.maxBy(Comparator.comparing(
-                        // 按 STARTDATE 字段比较
-                        obj -> obj.getDate(SubCoHeadServiceConstant.STARTDATE)
-                ))));
+                .and(String.join(".", MasConstant.NCKD_LEGPOSTLV, MasConstant.NCKD_ISEXEC),QCP.equals, EnableEnum.YES.getCode());
+        //查询出人员所有的企业负责人信息
+        DynamicObjectCollection allEntHeadQuery = QueryServiceHelper.query(FormConstant.NCKD_HRPI_ENTHEAD, entHeadFieldBuilder.buildSelect(), new QFilter[]{allEntHeadFilter});
+        Map<Long, List<DynamicObject>> groupedEntHeadQuery = allEntHeadQuery.stream()
+                .collect(Collectors.groupingBy(
+                        obj -> obj.getLong(String.join(".", MasConstant.EMPLOYEE_KEY, FormConstant.ID_KEY))
+                ));
+        // 找出当年范围内的企业负责人信息(如果有多条则取开始时间最新一条)
+        Map<Long, DynamicObject> entHeadRecordMap = new HashMap<>();
+        // 用于存储下一条记录的映射
+        Map<Long, DynamicObject> nextEntHeadRecordMap = new HashMap<>();
+        for (Map.Entry<Long, List<DynamicObject>> entry : groupedEntHeadQuery.entrySet()) {
+            Long employeeId = entry.getKey();
+            List<DynamicObject> records = entry.getValue();
+
+            // 筛选出在当年时间范围内的记录,然后取STARTDATE最新的那一条
+            Optional<DynamicObject> latestRecord = records.stream()
+                    .filter(record -> {
+                        Date startDate = record.getDate(MasConstant.STARTDATE);
+                        Date endDate = record.getDate(MasConstant.ENDDATE);
+                        // 判断记录是否在当年范围内
+                        return startDate != null && !startDate.after(endOfYear) &&
+                                (endDate == null || !endDate.before(startOfYear));
+                    })
+                    .max(Comparator.comparing(record -> record.getDate(MasConstant.STARTDATE),
+                            Comparator.nullsFirst(Comparator.naturalOrder())));
+
+            if (latestRecord.isPresent()) {
+                DynamicObject currentRecord = latestRecord.get();
+                entHeadRecordMap.put(employeeId, currentRecord);
+                // 根据当前记录的结束时间查找下一条记录
+                Date currentEndDate = currentRecord.getDate(MasConstant.ENDDATE);
+                if (currentEndDate != null) {
+                    // 查找开始时间等于当前记录结束时间的下一条记录
+                    Optional<DynamicObject> nextRecord = records.stream()
+                            .filter(record -> {
+                                Date startDate = record.getDate(MasConstant.STARTDATE);
+                                // 查找开始时间等于当前记录结束时间的记录
+                                // 查找开始时间大于等于当前记录结束时间的记录
+                                return startDate != null && !startDate.before(currentEndDate);
+                            })
+                            .findFirst();
+
+                    nextRecord.ifPresent(record -> nextEntHeadRecordMap.put(employeeId, record));
+                }
+            }
+        }
+
 
         //查询人员最新任职经历
         DynamicObject[] empPosOrgRelArray = EmpPosOrgRelHelper.queryEmpPosOrgRelByEmployees(entHeadRecordMap.keySet());
         List<Long> empPosOrgRelIds = Arrays.stream(empPosOrgRelArray).map(empPosOrgRel -> empPosOrgRel.getLong(FormConstant.ID_KEY)).collect(Collectors.toList());
         //查询人员法人单位
         QueryFieldBuilder legalPostFieldBuilder = QueryFieldBuilder.create()
-                .add(SubCoHeadServiceConstant.STARTDATE)
-                .add(SubCoHeadServiceConstant.ENDDATE)
+                .add(MasConstant.STARTDATE)
+                .add(MasConstant.ENDDATE)
                 .addIdNumberName(FormConstant.NCKD_EMPPOSORGREL,FormConstant.EMPLOYEE_KEY)
-                .addIdNumberName(SubCoHeadServiceConstant.NCKD_LAWENTITY);
-        QFilter legalPostFilter = QFilterCommonHelper.getValidDateFilter(SubCoHeadServiceConstant.STARTDATE,SubCoHeadServiceConstant.ENDDATE)
+                .addIdNumberName(MasConstant.NCKD_LAWENTITY);
+        QFilter legalPostFilter = new QFilter(MasConstant.STARTDATE, QCP.less_equals, endOfYear)
+                .and(new QFilter(MasConstant.ENDDATE, QCP.is_null,null)
+                        .or(MasConstant.ENDDATE, QCP.large_equals, startOfYear))
                 .and(FormConstant.NCKD_EMPPOSORGREL,QCP.in, empPosOrgRelIds);
         DynamicObjectCollection legalPostQuery = QueryServiceHelper.query(FormConstant.NCKD_HRPI_LEGALPOST, legalPostFieldBuilder.buildSelect(), new QFilter[]{legalPostFilter});
         Map<Long, DynamicObject> legalPostMap = legalPostQuery.stream()
                 .collect(Collectors.toMap(obj -> obj.getLong(String.join(".",FormConstant.NCKD_EMPPOSORGREL, FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY)), Function.identity(), BinaryOperator.maxBy(Comparator.comparing(
                         // 按 STARTDATE 字段比较
-                        obj -> obj.getDate(SubCoHeadServiceConstant.STARTDATE)
+                        obj -> obj.getDate(MasConstant.STARTDATE)
                 ))));
 
 
-        List<Long> createOrgList = BaseDataServiceHelper.getCreateOrgList(SubCoHeadServiceConstant.SUBCOHEADSERVICE_ENTITYID);
+        List<Long> createOrgList = BaseDataServiceHelper.getCreateOrgList(MasConstant.SUBCOHEADSERVICE_ENTITYID);
         MainEntityType bosOrgEntityType = EntityMetadataCache.getDataEntityType(FormConstant.BOS_ORG);
         DynamicObject org = new DynamicObject(bosOrgEntityType);
         if (!createOrgList.isEmpty()) {
             org.set(FormConstant.ID_KEY, createOrgList.get(0));
         }
-        String ctrlStrategy = BaseDataServiceHelper.getBdCtrlStrgy(SubCoHeadServiceConstant.SUBCOHEADSERVICE_ENTITYID,org.getLong(FormConstant.ID_KEY)+"");
+        String ctrlStrategy = BaseDataServiceHelper.getBdCtrlStrgy(MasConstant.SUBCOHEADSERVICE_ENTITYID,org.getLong(FormConstant.ID_KEY)+"");
         //构建子企业负责人任职情况实体
         List<DynamicObject> saveSubCoHeadServiceList = new ArrayList<>();
         for (Map.Entry<Long, DynamicObject> entHeadRecordEntry : entHeadRecordMap.entrySet()) {
@@ -207,51 +286,76 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
             DynamicObject entHead = entHeadRecordEntry.getValue();
             //党政履历
             DynamicObject partyPosh = latestPartyPoshRecordMap.get(entHeadRecordEntry.getKey());
-            DynamicObject newSubCoHeadService = EntityHelper.newEntity(SubCoHeadServiceConstant.SUBCOHEADSERVICE_ENTITYID);
+            DynamicObject newSubCoHeadService = EntityHelper.newEntity(MasConstant.SUBCOHEADSERVICE_ENTITYID);
             newSubCoHeadService.set(FormConstant.CREATEORG_KEY,org);
             newSubCoHeadService.set(FormConstant.CTRLSTRATEGY_KEY,ctrlStrategy);
-            newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_YEAR,DateUtil.toDate(beginYear));
-            newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_EMPLOYEE,entHeadRecordEntry.getKey());
+            newSubCoHeadService.set(MasConstant.NCKD_YEAR,DateUtil.toDate(beginYear));
+            newSubCoHeadService.set(MasConstant.NCKD_EMPLOYEE,entHeadRecordEntry.getKey());
+            newSubCoHeadService.set(MasConstant.STATUS, StatusEnum.B.toString());
+            newSubCoHeadService.set(MasConstant.ENABLE, EnableEnum.YES.getCode());
+            //党政履历
             if(partyPosh != null) {
-                //所属二级单位
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_PAYUNIT, partyPosh.getString(SubCoHeadServiceConstant.NCKD_PAYUNIT));
+                //所属二级单位(发薪单位)
+                long payOrgId = partyPosh.getLong(String.join(".", FormConstant.NCKD_ORG, FormConstant.ID_KEY));
+                DynamicObject payOrg = EntityHelper.newEntity(FormConstant.ADMINORGHR_ENTITYID, payOrgId);
+                newSubCoHeadService.set(MasConstant.NCKD_PAYUNIT, payOrg);
                 //职务
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_POSNAME,partyPosh.getString(SubCoHeadServiceConstant.NCKD_POSNAME));
+                newSubCoHeadService.set(MasConstant.NCKD_POSNAME,partyPosh.getString(MasConstant.NCKD_POSNAME));
                 //是否直管干部
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_ISDIRCADRE,partyPosh.getString(SubCoHeadServiceConstant.NCKD_ISDIRCADRE));
+                newSubCoHeadService.set(MasConstant.NCKD_ISDIRCADRE,partyPosh.getString(MasConstant.NCKD_ISDIRCADRE));
                 //任职开始时间(变动日期)
-                Date changeTime = entHead.getDate(SubCoHeadServiceConstant.NCKD_CHANGETIME);
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_STARTDATE,changeTime);
-                //TODO 任职结束时间(下一段的开始日期)
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_ENDDATE,null);
+                Date changeTime = partyPosh.getDate(MasConstant.NCKD_CHANGETIME);
+
                 if(changeTime != null){
+                    newSubCoHeadService.set(MasConstant.NCKD_STARTDATE,changeTime);
+                    DynamicObject nextPartyPoshRecord = nextPartyPoshRecordMap.get(entHeadRecordEntry.getKey());
+                    if(nextPartyPoshRecord != null){
+                        //任职结束时间(下一段的变动时间)
+                        Date nextChangeTime = nextPartyPoshRecord.getDate(MasConstant.NCKD_CHANGETIME);
+                        if(nextChangeTime != null) {
+                            newSubCoHeadService.set(MasConstant.NCKD_ENDDATE, nextChangeTime);
+                        }else{
+                            newSubCoHeadService.set(MasConstant.NCKD_ENDDATE, DateUtil.getMaxDateAsDate());
+                        }
+                    }else{
+                        newSubCoHeadService.set(MasConstant.NCKD_ENDDATE, DateUtil.getMaxDateAsDate());
+                    }
                     //【变动时间】的次月到当年年底的月数
                     LocalDateTime newMonths = DateUtil.addMonths(DateUtil.toLocalDateTime(changeTime), 1);
                     long between = DateUtil.between(newMonths, endYear, ChronoUnit.MONTHS);
-                    newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_SERVICEMONTHS,between);
+                    newSubCoHeadService.set(MasConstant.NCKD_SERVICEMONTHS,between);
                 }
 
             }
             DynamicObject legalPost = legalPostMap.get(entHeadRecordEntry.getKey());
             if(legalPost != null){
-                long lawEntityId = legalPost.getLong(String.join(".", SubCoHeadServiceConstant.NCKD_LAWENTITY, FormConstant.ID_KEY));
+                long lawEntityId = legalPost.getLong(String.join(".", MasConstant.NCKD_LAWENTITY, FormConstant.ID_KEY));
                 //法人单位
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_LAWENTITY,lawEntityId);
+                DynamicObject lawentity = EntityHelper.newEntity(FormConstant.HBSS_LAWENTITY, lawEntityId);
+                newSubCoHeadService.set(MasConstant.NCKD_LAWENTITY,lawentity);
             }
+            //企业负责人信息
             if(entHead != null){
 
                 //是否职业经理人
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_ISPROFMAN,entHead.getString(SubCoHeadServiceConstant.NCKD_ISPROFMAN));
+                newSubCoHeadService.set(MasConstant.NCKD_ISPROFMAN,entHead.getString(MasConstant.NCKD_ISPROFMAN));
                 //是否经理层成员
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_ISMANAGER,entHead.getString(SubCoHeadServiceConstant.NCKD_ISMANAGER));
+                newSubCoHeadService.set(MasConstant.NCKD_ISMANAGER,entHead.getString(MasConstant.NCKD_ISMANAGER));
                 //薪酬核算岗位
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_SALCALCPOST,entHead.getLong(String.join(".", SubCoHeadServiceConstant.NCKD_SALCALCPOST,FormConstant.ID_KEY)));
+                DynamicObject salCalcPost = EntityHelper.newEntity(FormConstant.HBPM_POSITIONHR, entHead.getLong(String.join(".", MasConstant.NCKD_SALCALCPOST, FormConstant.ID_KEY)));
+                newSubCoHeadService.set(MasConstant.NCKD_SALCALCPOST,salCalcPost);
                 //薪酬是否一人一议
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_SALNEGOT,entHead.getString(SubCoHeadServiceConstant.NCKD_SALNEGOT));
+                newSubCoHeadService.set(MasConstant.NCKD_SALNEGOT,entHead.getString(MasConstant.NCKD_SALNEGOT));
                 //TODO 当前取的是岗位管理层级,可能要改为岗位管理层级细项
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_POSTLEVEL,entHead.getLong(String.join(".", SubCoHeadServiceConstant.NCKD_POSTLEVEL,FormConstant.ID_KEY)));
+                DynamicObject postLevel = EntityHelper.newEntity(FormConstant.NCKD_HPFS_POSTLEVEL, entHead.getLong(String.join(".", MasConstant.NCKD_POSTLEVEL, FormConstant.ID_KEY)));
+                newSubCoHeadService.set(MasConstant.NCKD_POSTLEVEL,postLevel);
                 //法人岗位层级
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_LEGPOSTLV,entHead.getLong(String.join(".", SubCoHeadServiceConstant.NCKD_LEGPOSTLV,FormConstant.ID_KEY)));
+                DynamicObject legPostLv = EntityHelper.newEntity(FormConstant.NCKD_HBSS_LEGPOSTLV, entHead.getLong(String.join(".", MasConstant.NCKD_LEGPOSTLV,FormConstant.ID_KEY)));
+                newSubCoHeadService.set(MasConstant.NCKD_LEGPOSTLV,legPostLv);
+                //员工信息
+                DynamicObject employee = EntityHelper.newEntity(MasConstant.HSBS_EMPLOYEE, entHead.getLong(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY)));
+                employee.set(FormConstant.NAME_KEY,entHead.getString(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.NAME_KEY)));
+                newSubCoHeadService.set(FormConstant.NCKD_EMPLOYEE,employee);
 
             }
             saveSubCoHeadServiceList.add(newSubCoHeadService);
@@ -261,7 +365,7 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
             //调用save op
             OperateOption option = OperateOption.create();
             option.setVariableValue("load", Boolean.TRUE+"");
-            OperationResult operationResult = SaveServiceHelper.saveOperate(SubCoHeadServiceConstant.SUBCOHEADSERVICE_ENTITYID, saveSubCoHeadServiceList.toArray(new DynamicObject[0]), option);
+            OperationResult operationResult = SaveServiceHelper.saveOperate(MasConstant.SUBCOHEADSERVICE_ENTITYID, saveSubCoHeadServiceList.toArray(new DynamicObject[0]), option);
             if (!operationResult.isSuccess()) {
                 String parentPageId = this.getView().getFormShowParameter().getPageId();
                 IFormView parentView = SessionManager.getCurrent().getViewNoPlugin(parentPageId);
@@ -272,15 +376,13 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
                 for (Object successPkId : operationResult.getSuccessPkIds()) {
                     successMap.put(successPkId, customData.get(successPkId.toString()));
                 }
-                int billCount = operationResult.getBillCount();
-                int successCount = operationResult.getSuccessPkIds().size();
-                int validError = billCount - successCount;
-                String title = StrFormatter.format("载入人数:{},成功数量:{},失败数量:{}。", billCount, successCount, validError);
-                this.getView().showForm(ShowOperExecuteResult.getOperResultForm(title, "载入党政职务履历", successMap, pageCache, operationResult));
+                this.getView().showForm(ShowOperExecuteResult.getOperResultForm("载入党政职务履历", successMap, pageCache, operationResult));
+                this.getView().invokeOperation(FormConstant.REFRESH_OP);
             } else {
                 //刷新列表
                 Map<String, String> customData = operationResult.getCustomData();
                 Map<Object, Object> successMap = new HashMap<>();
+                //成功的记录
                 for (Object successPkId : operationResult.getSuccessPkIds()) {
                     successMap.put(successPkId, customData.get(successPkId.toString()));
                 }
@@ -289,6 +391,7 @@ public class SubCoHeadServiceListPlugin extends AbstractListPlugin implements Pl
                     IFormView parentView = SessionManager.getCurrent().getViewNoPlugin(parentPageId);
                     IPageCache pageCache = (IPageCache) parentView.getService(IPageCache.class);
                     this.getView().showForm(ShowOperExecuteResult.getOperResultForm("载入党政职务履历", successMap, pageCache, operationResult));
+                    this.getView().invokeOperation(FormConstant.REFRESH_OP);
                 } else {
                     this.getView().invokeOperation(FormConstant.REFRESH_OP);
                     this.getView().showConfirm("提示", operationResult.getMessage(), MessageBoxOptions.OK, null, null, null, null);

+ 182 - 0
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/structappr/EntLdrItemWageApprFormPlugin.java

@@ -0,0 +1,182 @@
+package nckd.jxccl.swc.mas.plugin.form.structappr;
+
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.entity.DynamicObjectCollection;
+import kd.bos.dataentity.entity.ILocaleString;
+import kd.bos.dataentity.metadata.IDataEntityProperty;
+import kd.bos.entity.BasedataEntityType;
+import kd.bos.entity.constant.StatusEnum;
+import kd.bos.entity.datamodel.events.ChangeData;
+import kd.bos.entity.datamodel.events.IDataModelChangeListener;
+import kd.bos.entity.datamodel.events.PropertyChangedArgs;
+import kd.bos.entity.property.BasedataProp;
+import kd.bos.entity.property.MulBasedataProp;
+import kd.bos.form.field.BasedataEdit;
+import kd.bos.form.field.events.AfterBindingDataEvent;
+import kd.bos.form.field.events.BasedataEditListener;
+import kd.bos.form.plugin.AbstractFormPlugin;
+import kd.bos.orm.query.QCP;
+import kd.bos.orm.query.QFilter;
+import kd.bos.servicehelper.BusinessDataServiceHelper;
+import nckd.jxccl.base.common.constant.FormConstant;
+import nckd.jxccl.base.common.utils.ConvertUtil;
+import nckd.jxccl.base.common.utils.DateUtil;
+import nckd.jxccl.base.common.utils.QueryFieldBuilder;
+import nckd.jxccl.swc.mas.common.MasConstant;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+* 企业负责人单项考核工资核定表-表单插件
+* 实体标识:nckd_entldritemwageappr
+* @author W.Y.C
+* @date 2025/11/30 16:05
+* @version 1.0
+*/
+public class EntLdrItemWageApprFormPlugin  extends AbstractFormPlugin implements BasedataEditListener, IDataModelChangeListener {
+
+    @Override
+    public void initialize() {
+        this.getModel().addDataModelChangeListener(this);
+        BasedataEdit mulEdit = this.getControl(MasConstant.NCKD_SUBCORPSALARYENTRY);
+        mulEdit.addBasedataEditListener(this);
+    }
+
+    @Override
+    public void afterBindingData(AfterBindingDataEvent evt) {
+        //修改“单项奖项目”,F7显示字段
+        BasedataEdit edit = (BasedataEdit) evt.getSource();
+        Object v = evt.getDataEntity();
+        Object editSearchProp = null;
+        Object displayProp = "";
+        if (v == null) {
+            return;
+        }
+
+        BasedataEntityType dt;
+        if (((DynamicObject) v).getDataEntityType() instanceof BasedataEntityType) {
+            dt = (BasedataEntityType) ((DynamicObject) v).getDataEntityType();
+        } else {
+            dt = (BasedataEntityType) ((BasedataProp) edit.getProperty()).getComplexType();
+        }
+
+        //获取数据包中的名称字段值
+        String nameKey = dt.getNameProperty();
+        IDataEntityProperty p2 = dt.findProperty(nameKey);
+        if (p2 != null) {
+            displayProp = p2.getValueFast(v);
+            if (displayProp instanceof ILocaleString) {
+                displayProp = displayProp.toString();
+            }
+        }
+
+        //动态修改多选基础资料的显示属性为名称(部门)
+        if (MasConstant.NCKD_SUBCORPSALARYENTRY.equals(edit.getKey())) {
+            nameKey = MasConstant.NCKD_SALARYITEM;
+        }
+        IDataEntityProperty p4 = dt.findProperty(nameKey);
+        if (p4 != null) {
+            Object valueFast = p4.getValueFast(v);
+            if(valueFast instanceof DynamicObject){
+                displayProp = ConvertUtil.toDynamicObjectOrNull(valueFast).getString(FormConstant.NAME_KEY);
+                editSearchProp = ConvertUtil.toDynamicObjectOrNull(valueFast).getString(FormConstant.NUMBER_KEY);
+
+            }
+        }
+
+        //设置显示属性
+        evt.setDisplayProp(displayProp.toString());
+        //设置编辑显示属性
+        evt.setEditSearchProp(editSearchProp == null ? "" : editSearchProp.toString());
+    }
+
+    /**
+     * 获取配置的编辑显示属性
+     *
+     * @param property
+     * @return
+     */
+    private String getEditSearchProp(IDataEntityProperty property) {
+        BasedataProp basedataProp = null;
+
+        if ((property instanceof BasedataProp)) {
+            basedataProp = (BasedataProp) property;
+        } else if (property instanceof MulBasedataProp) {
+            basedataProp = (BasedataProp) ((MulBasedataProp) property).getRefBaseProp();
+        }
+
+        return basedataProp.getEditSearchProp();
+    }
+
+
+    @Override
+    public void propertyChanged(PropertyChangedArgs e) {
+        String fieldKey = e.getProperty().getName();
+        ChangeData[] changeSet = e.getChangeSet();
+        int rowIndex = changeSet[0].getRowIndex();
+        Object oldValue = changeSet[0].getOldValue();
+        Object newValue = changeSet[0].getNewValue();
+        if(Stream.of(MasConstant.NCKD_PAYUNIT, MasConstant.NCKD_LAWENTITY, MasConstant.NCKD_YEAR)
+                .anyMatch(op -> op.equalsIgnoreCase(fieldKey))){
+            if(!Objects.equals(oldValue, newValue)){
+                DynamicObjectCollection entryEntities = getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
+                load();
+            }
+        }
+    }
+
+
+    private void load(){
+        DynamicObject payUnit = ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(MasConstant.NCKD_PAYUNIT));
+        DynamicObject lawEntity =  ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(MasConstant.NCKD_LAWENTITY));
+        Date year = ConvertUtil.toDate(this.getModel().getValue(MasConstant.NCKD_YEAR));
+        if(payUnit != null && lawEntity != null && year != null){
+            LocalDateTime localDateTime = DateUtil.toLocalDateTime(year);
+            LocalDateTime beginOfYear = DateUtil.beginOfYear(localDateTime);
+            LocalDateTime endOfYear = DateUtil.endOfYear(localDateTime);
+
+            QFilter filter = new QFilter(MasConstant.NCKD_PAYUNIT, QCP.equals, payUnit.getLong(FormConstant.ID_KEY))
+                    .and(MasConstant.NCKD_LAWENTITY, QCP.equals, lawEntity.getLong(FormConstant.ID_KEY))
+                    .and(MasConstant.NCKD_YEAR, QCP.large_equals, DateUtil.toDate(beginOfYear))
+                    .and(MasConstant.NCKD_YEAR, QCP.less_equals, DateUtil.toDate(endOfYear))
+                    .and(FormConstant.STATUS, QCP.in, new String[]{StatusEnum.C.toString(), StatusEnum.B.toString()});
+
+            //====================================== 获取子企业负责人任职情况 begin ======================================
+            QueryFieldBuilder subCoHeadServiceQueryFieldBuilder = QueryFieldBuilder.create()
+                    .add(MasConstant.NCKD_EMPLOYEE)
+                    .add(MasConstant.NCKD_POSNAME)
+                    .add(MasConstant.NCKD_SERVICEMONTHS)
+                    .add(MasConstant.NCKD_ISDIRCADRE)
+                    .add(MasConstant.NCKD_ISPROFMAN)
+                    .add(MasConstant.NCKD_ISMANAGER)
+                    .add(MasConstant.NCKD_POSTLEVEL)
+                    .add(MasConstant.NCKD_SALNEGOT)
+                    .add(MasConstant.NCKD_SALCALCPOST);
+            DynamicObject[] dbSubCoHeadServiceArray = BusinessDataServiceHelper.load(MasConstant.SUBCOHEADSERVICE_ENTITYID, subCoHeadServiceQueryFieldBuilder.buildSelect(), new QFilter[]{filter});
+            if(dbSubCoHeadServiceArray == null || dbSubCoHeadServiceArray.length == 0){
+                this.getView().showTipNotification("未加载到数据,根据【所属二级单位】、【法人组织】及【年度】未加载到对应“子企业负责人任职情况”数据!");
+            }
+            //====================================== 获取子企业负责人任职情况 end ======================================
+
+            DynamicObjectCollection entryEntities = getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
+            entryEntities.clear();
+            //====================================== 构建分录数据 begin ======================================
+            if((dbSubCoHeadServiceArray != null && dbSubCoHeadServiceArray.length > 0) ) {
+                for (DynamicObject dbSubCoHeadService : dbSubCoHeadServiceArray) {
+                    DynamicObject entry = entryEntities.addNew();
+                    entry.set(MasConstant.NCKD_EMPLOYEE, dbSubCoHeadService.get(MasConstant.NCKD_EMPLOYEE));
+                    entry.set(MasConstant.NCKD_POSNAME, dbSubCoHeadService.get(MasConstant.NCKD_POSNAME));
+                    entry.set(MasConstant.NCKD_SALCALCPOST, dbSubCoHeadService.get(MasConstant.NCKD_SALCALCPOST));
+                }
+                this.getView().showSuccessNotification("数据加载成功!");
+            }
+            //====================================== 构建分录数据 end ======================================
+            getModel().updateEntryCache(entryEntities);
+            getView().updateView(FormConstant.NCKD_ENTRYENTITY);
+
+        }
+    }
+}

+ 128 - 0
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/structappr/EntleaderAnlSalStdFormPlugin.java

@@ -0,0 +1,128 @@
+package nckd.jxccl.swc.mas.plugin.form.structappr;
+
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.entity.DynamicObjectCollection;
+import kd.bos.entity.constant.StatusEnum;
+import kd.bos.entity.datamodel.events.ChangeData;
+import kd.bos.entity.datamodel.events.PropertyChangedArgs;
+import kd.bos.form.plugin.AbstractFormPlugin;
+import kd.bos.orm.query.QCP;
+import kd.bos.orm.query.QFilter;
+import kd.bos.servicehelper.BusinessDataServiceHelper;
+import kd.sdk.plugin.Plugin;
+import nckd.jxccl.base.common.constant.FormConstant;
+import nckd.jxccl.base.common.utils.ConvertUtil;
+import nckd.jxccl.base.common.utils.DateUtil;
+import nckd.jxccl.base.common.utils.QueryFieldBuilder;
+import nckd.jxccl.swc.mas.common.MasConstant;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+* 企业负责人个人年度薪酬标准核定表-表单插件
+* 实体标识:nckd_entleaderanlsalstd
+* @author W.Y.C
+* @date 2025/11/30 14:54
+* @version 1.0
+*/
+public class EntleaderAnlSalStdFormPlugin extends AbstractFormPlugin implements Plugin {
+
+
+    @Override
+    public void propertyChanged(PropertyChangedArgs e) {
+        String fieldKey = e.getProperty().getName();
+        ChangeData[] changeSet = e.getChangeSet();
+        int rowIndex = changeSet[0].getRowIndex();
+        Object oldValue = changeSet[0].getOldValue();
+        Object newValue = changeSet[0].getNewValue();
+        if(Stream.of(MasConstant.NCKD_PAYUNIT, MasConstant.NCKD_LAWENTITY, MasConstant.NCKD_YEAR)
+                .anyMatch(op -> op.equalsIgnoreCase(fieldKey))){
+            if(!Objects.equals(oldValue, newValue)){
+                DynamicObjectCollection entryEntities = getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
+                load();
+            }
+        }
+    }
+
+    private void load(){
+        DynamicObject payUnit = ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(MasConstant.NCKD_PAYUNIT));
+        DynamicObject lawEntity =  ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(MasConstant.NCKD_LAWENTITY));
+        Date year = ConvertUtil.toDate(this.getModel().getValue(MasConstant.NCKD_YEAR));
+        if(payUnit != null && lawEntity != null && year != null){
+            LocalDateTime localDateTime = DateUtil.toLocalDateTime(year);
+            LocalDateTime beginOfYear = DateUtil.beginOfYear(localDateTime);
+            LocalDateTime endOfYear = DateUtil.endOfYear(localDateTime);
+
+            QFilter filter = new QFilter(MasConstant.NCKD_PAYUNIT, QCP.equals, payUnit.getLong(FormConstant.ID_KEY))
+                    .and(MasConstant.NCKD_LAWENTITY, QCP.equals, lawEntity.getLong(FormConstant.ID_KEY))
+                    .and(MasConstant.NCKD_YEAR, QCP.large_equals, DateUtil.toDate(beginOfYear))
+                    .and(MasConstant.NCKD_YEAR, QCP.less_equals, DateUtil.toDate(endOfYear))
+                    .and(FormConstant.STATUS, QCP.in, new String[]{StatusEnum.C.toString(), StatusEnum.B.toString()});
+
+            //====================================== 获取子企业负责人任职情况 begin ======================================
+            QueryFieldBuilder subCoHeadServiceQueryFieldBuilder = QueryFieldBuilder.create()
+                    .add(MasConstant.NCKD_EMPLOYEE)
+                    .add(MasConstant.NCKD_POSNAME)
+                    .add(MasConstant.NCKD_SERVICEMONTHS)
+                    .add(MasConstant.NCKD_ISDIRCADRE)
+                    .add(MasConstant.NCKD_ISPROFMAN)
+                    .add(MasConstant.NCKD_ISMANAGER)
+                    .add(MasConstant.NCKD_POSTLEVEL)
+                    .add(MasConstant.NCKD_SALNEGOT);
+            DynamicObject[] dbSubCoHeadServiceArray = BusinessDataServiceHelper.load(MasConstant.SUBCOHEADSERVICE_ENTITYID, subCoHeadServiceQueryFieldBuilder.buildSelect(), new QFilter[]{filter});
+            if(dbSubCoHeadServiceArray == null || dbSubCoHeadServiceArray.length == 0){
+                this.getView().showTipNotification("未加载到数据,根据【所属二级单位】、【法人组织】及【年度】未加载到对应“子企业负责人任职情况”数据!");
+            }
+            //====================================== 获取子企业负责人任职情况 end ======================================
+
+
+            //====================================== 获取子企业负责人薪酬结构 begin ======================================
+            QueryFieldBuilder queryFieldBuilder = QueryFieldBuilder.create()
+                    .addIdNumberName(MasConstant.NCKD_PAYUNIT)
+                    .addIdNumberName(MasConstant.NCKD_LAWENTITY)
+                    .add(MasConstant.NCKD_YEAR)
+                    .add(FormConstant.NCKD_ENTRYENTITY)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_PROJECTCATEGORY)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_SALARYITEM)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_DEFERREDPAYITEM)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_DEFERREDPAYDESC)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_TERMPAYDESC);
+            DynamicObject[] dbSubCorpSalaryArray = BusinessDataServiceHelper.load(MasConstant.SUBCORPSALARY_ENTITYID, queryFieldBuilder.buildSelect(), new QFilter[]{filter});
+            if(dbSubCorpSalaryArray == null || dbSubCorpSalaryArray.length == 0){
+                this.getView().showTipNotification("未加载到数据,根据【所属二级单位】、【法人组织】及【年度】未加载到对应“子企业负责人薪酬结构”数据!");
+            }
+            //====================================== 获取子企业负责人薪酬结构 end ======================================
+            DynamicObjectCollection entryEntities = getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
+            entryEntities.clear();
+            //====================================== 构建分录数据 begin ======================================
+            if((dbSubCoHeadServiceArray != null && dbSubCoHeadServiceArray.length > 0) && (dbSubCorpSalaryArray != null && dbSubCorpSalaryArray.length > 0)) {
+                for (DynamicObject dbSubCoHeadService : dbSubCoHeadServiceArray) {
+                    for (DynamicObject dbSubCorpSalary : dbSubCorpSalaryArray) {
+                        DynamicObjectCollection dbEntryColl = dbSubCorpSalary.getDynamicObjectCollection(MasConstant.NCKD_ENTRYENTITY);
+                        for (DynamicObject dbEntryEntity : dbEntryColl) {
+                            DynamicObject entry = entryEntities.addNew();
+                            entry.set(MasConstant.NCKD_EMPLOYEE, dbSubCoHeadService.get(MasConstant.NCKD_EMPLOYEE));
+                            entry.set(MasConstant.NCKD_POSNAME, dbSubCoHeadService.get(MasConstant.NCKD_POSNAME));
+                            entry.set(MasConstant.NCKD_SERVICEMONTHS, dbSubCoHeadService.get(MasConstant.NCKD_SERVICEMONTHS));
+                            entry.set(MasConstant.NCKD_ISDIRCADRE, dbSubCoHeadService.get(MasConstant.NCKD_ISDIRCADRE));
+                            entry.set(MasConstant.NCKD_ISPROFMAN, dbSubCoHeadService.get(MasConstant.NCKD_ISPROFMAN));
+                            entry.set(MasConstant.NCKD_ISMANAGER, dbSubCoHeadService.get(MasConstant.NCKD_ISMANAGER));
+                            entry.set(MasConstant.NCKD_POSTLEVEL, dbSubCoHeadService.get(MasConstant.NCKD_POSTLEVEL));
+                            entry.set(MasConstant.NCKD_SALNEGOT, dbSubCoHeadService.get(MasConstant.NCKD_SALNEGOT));
+                            entry.set(MasConstant.NCKD_SALARYITEM, dbEntryEntity.get(MasConstant.NCKD_SALARYITEM));
+                        }
+
+                    }
+                }
+                this.getView().showSuccessNotification("数据加载成功!");
+            }
+            //====================================== 构建分录数据 end ======================================
+            getModel().updateEntryCache(entryEntities);
+            getView().updateView(FormConstant.NCKD_ENTRYENTITY);
+
+        }
+    }
+}

+ 144 - 0
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/structappr/SubcorpChiefSalStdFormPlugin.java

@@ -0,0 +1,144 @@
+package nckd.jxccl.swc.mas.plugin.form.structappr;
+
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.entity.DynamicObjectCollection;
+import kd.bos.entity.constant.StatusEnum;
+import kd.bos.entity.datamodel.events.ChangeData;
+import kd.bos.entity.datamodel.events.PropertyChangedArgs;
+import kd.bos.form.plugin.AbstractFormPlugin;
+import kd.bos.orm.query.QCP;
+import kd.bos.orm.query.QFilter;
+import kd.bos.servicehelper.BusinessDataServiceHelper;
+import kd.sdk.plugin.Plugin;
+import nckd.jxccl.base.common.constant.FormConstant;
+import nckd.jxccl.base.common.enums.ProjectCategoryEnum;
+import nckd.jxccl.base.common.utils.ConvertUtil;
+import nckd.jxccl.base.common.utils.DateUtil;
+import nckd.jxccl.base.common.utils.QueryFieldBuilder;
+import nckd.jxccl.swc.mas.common.MasConstant;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.EventObject;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+* 子企业负责人正职年度薪酬核定标准-表单插件
+* 实体标识:nckd_subcorpchiefsalstd
+* @author W.Y.C
+* @date 2025/11/29 16:36
+* @version 1.0
+*/
+public class SubcorpChiefSalStdFormPlugin extends AbstractFormPlugin implements Plugin {
+
+
+    @Override
+    public void afterBindData(EventObject e) {
+        DynamicObjectCollection entryCollection = this.getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
+        for (int rowIndex = 0; rowIndex < entryCollection.size(); rowIndex++) {
+            DynamicObject entry = entryCollection.get(rowIndex);
+            int installmentYears = entry.getInt(MasConstant.NCKD_INSTALLMENTYEARS);
+            initOperateOption(installmentYears,rowIndex);
+        }
+    }
+
+    @Override
+    public void propertyChanged(PropertyChangedArgs e) {
+        String fieldKey = e.getProperty().getName();
+        ChangeData[] changeSet = e.getChangeSet();
+        int rowIndex = changeSet[0].getRowIndex();
+        Object oldValue = changeSet[0].getOldValue();
+        Object newValue = changeSet[0].getNewValue();
+        if(MasConstant.NCKD_INSTALLMENTYEARS.equalsIgnoreCase(fieldKey)){
+            if(!Objects.equals(oldValue, newValue)){
+                initOperateOption(ConvertUtil.toInt(newValue),rowIndex);
+            }
+        }else if(Stream.of(MasConstant.NCKD_PAYUNIT, MasConstant.NCKD_LAWENTITY, MasConstant.NCKD_YEAR)
+                .anyMatch(op -> op.equalsIgnoreCase(fieldKey))){
+            if(!Objects.equals(oldValue, newValue)){
+                DynamicObjectCollection entryEntities = getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
+                load();
+            }
+        }
+    }
+
+    private void load(){
+        DynamicObject payUnit = ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(MasConstant.NCKD_PAYUNIT));
+        DynamicObject lawEntity =  ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(MasConstant.NCKD_LAWENTITY));
+        Date year = ConvertUtil.toDate(this.getModel().getValue(MasConstant.NCKD_YEAR));
+        if(payUnit != null && lawEntity != null && year != null){
+            QueryFieldBuilder queryFieldBuilder = QueryFieldBuilder.create()
+                    .addIdNumberName(MasConstant.NCKD_PAYUNIT)
+                    .addIdNumberName(MasConstant.NCKD_LAWENTITY)
+                    .add(MasConstant.NCKD_YEAR)
+                    .add(FormConstant.NCKD_ENTRYENTITY)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_PROJECTCATEGORY)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_SALARYITEM)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_DEFERREDPAYITEM)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_DEFERREDPAYDESC)
+                    .add(FormConstant.NCKD_ENTRYENTITY, MasConstant.NCKD_TERMPAYDESC);
+
+            LocalDateTime localDateTime = DateUtil.toLocalDateTime(year);
+            LocalDateTime beginOfYear = DateUtil.beginOfYear(localDateTime);
+            LocalDateTime endOfYear = DateUtil.endOfYear(localDateTime);
+            QFilter qFilter = new QFilter(MasConstant.NCKD_PAYUNIT, QCP.equals, payUnit.getLong(FormConstant.ID_KEY))
+                    .and(MasConstant.NCKD_LAWENTITY, QCP.equals, lawEntity.getLong(FormConstant.ID_KEY))
+                    .and(MasConstant.NCKD_YEAR, QCP.large_equals, DateUtil.toDate(beginOfYear))
+                    .and(MasConstant.NCKD_YEAR, QCP.less_equals, DateUtil.toDate(endOfYear))
+                    .and(FormConstant.STATUS, QCP.in, new String[]{StatusEnum.C.toString(), StatusEnum.B.toString()});
+            DynamicObject[] dbSubCorpSalaryArray = BusinessDataServiceHelper.load(MasConstant.SUBCORPSALARY_ENTITYID, queryFieldBuilder.buildSelect(), new QFilter[]{qFilter});
+            DynamicObjectCollection entryEntities = getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
+            entryEntities.clear();
+            if(dbSubCorpSalaryArray != null && dbSubCorpSalaryArray.length > 0) {
+                for (DynamicObject dbSubCorpSalary : dbSubCorpSalaryArray) {
+
+                    DynamicObjectCollection dbEntryColl = dbSubCorpSalary.getDynamicObjectCollection(MasConstant.NCKD_ENTRYENTITY);
+                    for (DynamicObject dbEntryEntity : dbEntryColl) {
+                        DynamicObject projectCategory = dbEntryEntity.getDynamicObject(MasConstant.NCKD_PROJECTCATEGORY);
+                        String projectCategoryNumber = projectCategory.getString(FormConstant.NUMBER_KEY);
+                        if(!projectCategoryNumber.equalsIgnoreCase(ProjectCategoryEnum.TERM_INCENTIVE.getCode()) && !projectCategoryNumber.equalsIgnoreCase(ProjectCategoryEnum.LONGTERM_INCENTIVE.getCode())) {
+                            DynamicObject entry = entryEntities.addNew();
+                            entry.set(MasConstant.NCKD_PROJECTCATEGORY, dbEntryEntity.getDynamicObject(MasConstant.NCKD_PROJECTCATEGORY));
+                            entry.set(MasConstant.NCKD_SALARYITEM, dbEntryEntity.getDynamicObject(MasConstant.NCKD_SALARYITEM));
+                            entry.set(MasConstant.NCKD_DEFERREDPAYITEM, dbEntryEntity.getBoolean(MasConstant.NCKD_DEFERREDPAYITEM));
+                            entry.set(MasConstant.NCKD_DEFERREDPAYDESC, dbEntryEntity.getString(MasConstant.NCKD_DEFERREDPAYDESC));
+                            entry.set(MasConstant.NCKD_TERMPAYDESC, dbEntryEntity.getString(MasConstant.NCKD_TERMPAYDESC));
+                        }
+                    }
+                }
+                this.getView().showSuccessNotification("数据加载成功!");
+            }else{
+                this.getView().showTipNotification("未加载到数据,根据【所属二级单位】、【法人组织】及【年度】未加载到对应“子企业负责人薪酬结构”数据!");
+            }
+            for (int rowIndex = 0; rowIndex < entryEntities.size(); rowIndex++) {
+                DynamicObject entry = entryEntities.get(rowIndex);
+                int installmentYears = entry.getInt(MasConstant.NCKD_INSTALLMENTYEARS);
+                initOperateOption(installmentYears,rowIndex);
+            }
+            getModel().updateEntryCache(entryEntities);
+            getView().updateView(FormConstant.NCKD_ENTRYENTITY);
+
+        }
+    }
+
+    /**
+     * 设置支付N锁定或解锁
+     * @param installmentYears 分期支付年
+     * @param rowIndex 行索引
+     * @return: void
+     * @author W.Y.C
+     * @date: 2025/11/29 20:48
+     */
+    private void initOperateOption(int installmentYears, int rowIndex) {
+        for (int i=1;i<=10;i++){
+            this.getView().setEnable(false, rowIndex, MasConstant.NCKD_PAYYEAR+i);
+            this.getView().setEnable(false,rowIndex, MasConstant.NCKD_PAYAMOUNT+i);
+        }
+       for (int i = 1; i<= installmentYears; i++){
+           this.getView().setEnable(true,rowIndex, MasConstant.NCKD_PAYYEAR+i);
+           this.getView().setEnable(true,rowIndex, MasConstant.NCKD_PAYAMOUNT+i);
+
+       }
+    }
+}

+ 17 - 16
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/operate/SubCoHeadServiceOpPlugin.java

@@ -6,11 +6,10 @@ import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
 import kd.bos.entity.plugin.AddValidatorsEventArgs;
 import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
 import kd.bos.entity.validate.AbstractValidator;
+import kd.bos.entity.validate.ValidatePriority;
 import kd.sdk.plugin.Plugin;
+import nckd.jxccl.base.common.constant.FormConstant;
 import nckd.jxccl.base.common.utils.ConvertUtil;
-import nckd.jxccl.swc.mas.common.SubCoHeadServiceConstant;
-
-import java.util.Date;
 
 /**
 * 子企业负责人任职情况-保存插件
@@ -27,33 +26,35 @@ public class SubCoHeadServiceOpPlugin extends AbstractOperationServicePlugIn imp
         Boolean isLoad = ConvertUtil.toBoolean(this.getOption().getVariableValue("load", "false"));
         e.addValidator(new AbstractValidator() {
 
+            @Override
+            public void setValidatePriority(ValidatePriority validatePriority) {
+                super.setValidatePriority(ValidatePriority.Last);
+            }
+
             @Override
             public void validate() {
                 String operateKey = this.getOperateKey();
                 for (ExtendedDataEntity dataEntity : this.getDataEntities()) {
                     DynamicObject data = dataEntity.getDataEntity();
-                    Date startDate = data.getDate(SubCoHeadServiceConstant.NCKD_STARTDATE);
-                    if(startDate == null){
-                        if(isLoad){
-
-                        }else{
-                            this.addWarningMessage(dataEntity,"");
-                        }
+                    DynamicObject employee = data.getDynamicObject(FormConstant.NCKD_EMPLOYEE);
+                    if(employee != null) {
+                        //设置每行对应的员工名称,用于准确显示每个错误属于哪个员工的
+                        getOperationResult().getCustomData().put("DataEntityIndex_"+dataEntity.getDataEntityIndex(), "【" + employee.getString(FormConstant.NAME_KEY) + "】");
                     }
-
                 }
-
             }
-
         });
     }
 
-
     @Override
     public void endOperationTransaction(EndOperationTransactionArgs e) {
         String operationKey = e.getOperationKey();
-        super.endOperationTransaction(e);
+        for (DynamicObject dataEntity : e.getDataEntities()) {
+            long id = dataEntity.getLong(FormConstant.ID_KEY);
+            DynamicObject dynamicObject = dataEntity.getDynamicObject(FormConstant.NCKD_EMPLOYEE);
+            this.getOperationResult().getCustomData().put(id +"","【"+dynamicObject.getString(FormConstant.NAME_KEY)+"】");
+        }
+
 
-        this.getOperationResult().getCustomData().put("成功的id","成功的消息");
     }
 }