Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

jtd 2 өдөр өмнө
parent
commit
5330b4218c
23 өөрчлөгдсөн 1680 нэмэгдсэн , 265 устгасан
  1. 10 0
      code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/constant/FormConstant.java
  2. 31 0
      code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/enums/ProjectCategoryEnum.java
  3. 20 0
      code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/utils/DateUtil.java
  4. 33 11
      code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/utils/ShowOperExecuteResult.java
  5. 10 1
      code/base/nckd-jxccl-base-helper/src/main/java/nckd/jxccl/base/swc/helper/SWCHelper.java
  6. 1 1
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/sit/hcsi/formplugin/web/coordination/SinSurEmpChgCoordBatchEditPluginEx.java
  7. 2 2
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/sit/hcsi/formplugin/web/selfsearch/SelfSearchFormPlugin.java
  8. 41 33
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/init/plugin/form/EmpSalaryQueryWebFormPlugin.java
  9. 167 0
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/common/MasConstant.java
  10. 0 80
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/common/SubCoHeadServiceConstant.java
  11. 28 0
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/empmgt/LoadPartyPostPopupFormPlugin.java
  12. 208 97
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/empmgt/SubCoHeadServiceListPlugin.java
  13. 384 0
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/empmgt/TenurePersonListListPlugin.java
  14. 143 0
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/incentivemgmt/EntldrTermBonusApprFormPlugin.java
  15. 182 0
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/structappr/EntLdrItemWageApprFormPlugin.java
  16. 133 0
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/structappr/EntleaderAnlSalStdFormPlugin.java
  17. 152 0
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/structappr/SubcorpChiefSalStdFormPlugin.java
  18. 20 17
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/operate/empmgt/SubCoHeadServiceOpPlugin.java
  19. 62 0
      code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/operate/empmgt/TenurePersonListOpPlugin.java
  20. 32 1
      code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/task/SyncPunchCardTask.java
  21. 10 12
      code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/utils/SyncPunchCardHelper.java
  22. 10 0
      code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/wtabm/web/common/constant/WtcConstant.java
  23. 1 10
      code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/wtabm/web/common/util/WtcUtils.java

+ 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();

+ 10 - 1
code/base/nckd-jxccl-base-helper/src/main/java/nckd/jxccl/base/swc/helper/SWCHelper.java

@@ -9,6 +9,7 @@ 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.business.servicehelper.HRBaseServiceHelper;
 
 import java.util.Date;
 import java.util.List;
@@ -135,7 +136,7 @@ public class SWCHelper {
             selectFields = selectFields + ",caltask.payrolldate as bizdate";
             orderStr = "caltask.payrolldate";
         }
-        orderStr = orderStr + "hsas_caltableentry.salaryitem.number";
+        orderStr = orderStr + ",hsas_caltableentry.salaryitem.number";
         selectFields = selectFields + ",caltask.paydate,caltask.payrolldate";
 
         DynamicObjectCollection calTableDyns = QueryServiceHelper.query(entityName, selectFields, new QFilter[]{filter}, orderStr);
@@ -143,6 +144,14 @@ public class SWCHelper {
         return calTableDyns;
     }
 
+
+    public static Long queryEmployeeIdByUserId(Long userId) {
+        HRBaseServiceHelper SERVICE_HELPER = new HRBaseServiceHelper("hrpi_personuserrel");
+        DynamicObject personuserrel = SERVICE_HELPER.queryOne("employee,user,createtime", new QFilter[]{new QFilter("user", "=", userId), new QFilter("enable", "=", "1")}, "createtime desc");
+        return personuserrel == null ? 0L : personuserrel.getLong("employee_id");
+    }
+
+
     /**
      * 判断集合是否为空
      * @param list

+ 1 - 1
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/sit/hcsi/formplugin/web/coordination/SinSurEmpChgCoordBatchEditPluginEx.java

@@ -98,7 +98,7 @@ public class SinSurEmpChgCoordBatchEditPluginEx extends AbstractFormPlugin imple
         super.afterDoOperation(afterDoOperationEventArgs);
         AbstractOperate op = (AbstractOperate)afterDoOperationEventArgs.getSource();
         String operateKey = op.getOperateKey();
-        if (afterDoOperationEventArgs.getOperationResult().isSuccess() && (HRStringUtils.equals(operateKey, "save") || HRStringUtils.equals(operateKey, "confirmeffect"))) {
+        if ((HRStringUtils.equals(operateKey, "save") || HRStringUtils.equals(operateKey, "confirmeffect"))) {
             doSaveSubEntry();
         }
         else if(HRStringUtils.equals(operateKey, "batchsetting")){

+ 2 - 2
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/sit/hcsi/formplugin/web/selfsearch/SelfSearchFormPlugin.java

@@ -10,8 +10,8 @@ import kd.bos.form.plugin.AbstractFormPlugin;
 import kd.bos.orm.query.QCP;
 import kd.bos.orm.query.QFilter;
 import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
-import kd.hrmp.hrobs.business.domain.assignment.service.IAssignmentDomainService;
 import kd.sdk.plugin.Plugin;
+import nckd.jxccl.base.swc.helper.SWCHelper;
 
 import java.util.EventObject;
 
@@ -52,7 +52,7 @@ public class SelfSearchFormPlugin extends AbstractFormPlugin implements Plugin {
             }
             else {
                 // 获取当前登录用户对应的HR人员
-                Long employeeId = IAssignmentDomainService.getInstance().queryEmployeeIdByUserId(RequestContext.getOrCreate().getCurrUserId());
+                Long employeeId = SWCHelper.queryEmployeeIdByUserId(RequestContext.getOrCreate().getCurrUserId());
                 if (employeeId != 0L) {
                     doSearch(period.getLong("id"), employeeId);
                 }

+ 41 - 33
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/init/plugin/form/EmpSalaryQueryWebFormPlugin.java

@@ -10,12 +10,11 @@ import kd.bos.form.control.grid.DataGridRow;
 import kd.bos.form.control.grid.DataGridRowBuilder;
 import kd.bos.form.control.grid.column.AmountDataGridColumn;
 import kd.bos.form.control.grid.column.DataGridColumn;
-import kd.bos.form.control.grid.column.TextDataGridColumn;
+
 import kd.bos.form.control.grid.events.BeforeCreateDataGridColumnsEvent;
 import kd.bos.form.control.grid.events.BeforeCreateDataGridColumnsListener;
 import kd.bos.form.control.grid.events.DataGridBindDataEvent;
 import kd.bos.form.control.grid.events.DataGridBindDataListener;
-import kd.bos.form.mcontrol.mobtable.MobTable;
 import kd.bos.form.plugin.AbstractFormPlugin;
 import kd.bos.orm.query.QCP;
 import kd.bos.orm.query.QFilter;
@@ -24,14 +23,13 @@ import kd.bos.servicehelper.user.UserServiceHelper;
 import kd.sdk.plugin.Plugin;
 import nckd.jxccl.base.common.utils.DateUtil;
 import nckd.jxccl.base.swc.helper.SWCHelper;
-import nckd.jxccl.swc.constants.SwcConstant;
 
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.util.*;
 
 /**
- * 动态表单插件
+ * 员工薪酬查询 WEB  动态表单插件
  * @author turborao
  * @date 2025/11/28 16:01
  */
@@ -56,15 +54,10 @@ public class EmpSalaryQueryWebFormPlugin extends AbstractFormPlugin implements P
 
 
     @Override
-    public void beforeBindData(EventObject e) {
-        super.beforeBindData(e);
-
-        this.getModel().setValue(KEY_CTL_STARTDATE, KEY_STARTDATE);
-
-        this.getModel().setValue(KEY_CTL_ENDDATE, KEY_ENDDATE);
+    public void initialize() {
+        super.initialize();
 
         Long userId = UserServiceHelper.getCurrentUserId();
-        this.getModel().setValue("nckd_user", userId);
 
         DynamicObject personUserDyn = SWCHelper.queryOne(KEY_META_PERUSER, "employee.id","user",userId);
 
@@ -78,17 +71,6 @@ public class EmpSalaryQueryWebFormPlugin extends AbstractFormPlugin implements P
         }else {
             KEY_EMPID = personUserDyn.getLong("employee.id");
         }
-    }
-
-    @Override
-    public void afterBindData(EventObject e) {
-        super.afterBindData(e);
-        showData();
-    }
-
-    @Override
-    public void afterCreateNewData(EventObject e) {
-        super.afterCreateNewData(e);
 
         // 设置最大日期为上个月
         Calendar calendar = Calendar.getInstance();
@@ -102,6 +84,42 @@ public class EmpSalaryQueryWebFormPlugin extends AbstractFormPlugin implements P
         Date lastMonthDate = calendar.getTime();
         KEY_STARTDATE = lastMonthDate;
 
+        showData();
+        /**
+         * 构建表格数据
+         */
+        DataGrid dataGrid = this.getControl("nckd_datagridap");
+        // 注册创建列监听事件
+        dataGrid.addBeforeCreateDataGridColumnsListener(this);
+        // 注册绑定数据监听事件
+        dataGrid.addBindDataListener(this);
+
+    }
+
+    @Override
+    public void beforeBindData(EventObject e) {
+        super.beforeBindData(e);
+
+        this.getModel().setValue(KEY_CTL_STARTDATE, KEY_STARTDATE);
+
+        this.getModel().setValue(KEY_CTL_ENDDATE, KEY_ENDDATE);
+
+        Long userId = UserServiceHelper.getCurrentUserId();
+        this.getModel().setValue("nckd_user", userId);
+
+    }
+
+    @Override
+    public void afterBindData(EventObject e) {
+        super.afterBindData(e);
+
+    }
+
+
+    @Override
+    public void afterCreateNewData(EventObject e) {
+        super.afterCreateNewData(e);
+
     }
 
     /**
@@ -158,7 +176,6 @@ public class EmpSalaryQueryWebFormPlugin extends AbstractFormPlugin implements P
         itemNameMap = getItemName(calTableDyns);
         calItemAmtMapByPeriod = getCalItemAmtByPeriod(calTableDyns);
 
-
         if(calItemAmtMap != null && calItemAmtMap.size() > 0 && itemNameMap != null && !itemNameMap.isEmpty()){
             DecimalFormat df = new DecimalFormat("#,##0.00");
             Label label1 = this.getView().getControl(KEY_LAB_REALAMT);
@@ -175,15 +192,6 @@ public class EmpSalaryQueryWebFormPlugin extends AbstractFormPlugin implements P
                 label2.setText(df.format(calItemAmtMap.get("JT_283")));   //应发合计
             }
 
-            /**
-             * 构建表格数据
-             */
-            DataGrid dataGrid = this.getControl("nckd_datagridap");
-            // 注册创建列监听事件
-            dataGrid.addBeforeCreateDataGridColumnsListener(this);
-            // 注册绑定数据监听事件
-            dataGrid.addBindDataListener(this);
-
         }else{
             Label label1 = this.getView().getControl(KEY_LAB_REALAMT);
             label1.setText("0.00");
@@ -320,7 +328,7 @@ public class EmpSalaryQueryWebFormPlugin extends AbstractFormPlugin implements P
     public void dataGridBindData(DataGridBindDataEvent e) {
         List<Object> list = new ArrayList<>();
         int index = 0;
-        if(calItemAmtMapByPeriod !=  null && calItemAmtMapByPeriod.isEmpty()) {
+        if(calItemAmtMapByPeriod !=  null && !calItemAmtMapByPeriod.isEmpty()) {
             DataGridRowBuilder builder = e.getDataGridRowBuilder();
             // 遍历每个周期
             for (Map.Entry<String, Map<String, BigDecimal>> periodEntry : calItemAmtMapByPeriod.entrySet()) {

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

@@ -0,0 +1,167 @@
+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 --------------------------------------*/
+
+
+    /*-------------------------------------- 载入党政职务履历弹窗 begin --------------------------------------*/
+    /** 载入党政职务履历弹窗-实体标识 */
+    public static final String LOADPARTYPOSTPOPUP_ENTITYID = "nckd_loadpartypostpopup";
+    /*-------------------------------------- 载入党政职务履历弹窗 end --------------------------------------*/
+
+
+    /*-------------------------------------- 任期人员名单 begin --------------------------------------*/
+    /** 任期人员名单-实体标识 */
+    public static final String TENUREPERSONLIST_ENTITYID = "nckd_tenurepersonlist";
+    /*-------------------------------------- 任期人员名单 end --------------------------------------*/
+
+
+}

+ 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 --------------------------------------*/
-}

+ 28 - 0
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/empmgt/LoadPartyPostPopupFormPlugin.java

@@ -0,0 +1,28 @@
+package nckd.jxccl.swc.mas.plugin.form.empmgt;
+
+import kd.bos.form.events.AfterDoOperationEventArgs;
+import kd.bos.form.plugin.AbstractFormPlugin;
+import kd.sdk.plugin.Plugin;
+import nckd.jxccl.base.common.constant.FormConstant;
+import nckd.jxccl.swc.mas.common.MasConstant;
+
+/**
+* 载入党政职务履历弹窗
+* 实体标识:nckd_loadpartypostpopup
+* @author W.Y.C
+* @date 2025/11/30 20:18
+* @version 1.0
+*/
+public class LoadPartyPostPopupFormPlugin extends AbstractFormPlugin implements Plugin {
+
+    @Override
+    public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
+        String operateKey = afterDoOperationEventArgs.getOperateKey();
+        boolean success = afterDoOperationEventArgs.getOperationResult() != null && afterDoOperationEventArgs.getOperationResult().isSuccess();
+        if (success && FormConstant.AFFIRM_OP.equalsIgnoreCase(operateKey)) {
+            Object value = this.getModel().getValue(MasConstant.NCKD_TERM);
+            this.getView().returnDataToParent(value);
+            this.getView().close();
+        }
+    }
+}

+ 208 - 97
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,53 +286,86 @@ 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());
+            DynamicObject employee = null;
+            //党政履历
             if(partyPosh != null) {
-                //所属二级单位
-                newSubCoHeadService.set(SubCoHeadServiceConstant.NCKD_PAYUNIT, partyPosh.getString(SubCoHeadServiceConstant.NCKD_PAYUNIT));
+                long employeeId = partyPosh.getLong(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY));
+                if(employeeId > 0) {
+                    employee = EntityHelper.newEntity(MasConstant.HSBS_EMPLOYEE, employeeId);
+                    employee.set(FormConstant.NAME_KEY, partyPosh.getString(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.NAME_KEY)));
+                }
+                //所属二级单位(发薪单位)
+                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){
-
+                long employeeId = entHead.getLong(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY));
+                if(employeeId > 0) {
+                    employee = EntityHelper.newEntity(MasConstant.HSBS_EMPLOYEE, employeeId);
+                    employee.set(FormConstant.NAME_KEY, entHead.getString(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.NAME_KEY)));
+                }
                 //是否职业经理人
-                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);
 
             }
+            //员工信息
+            newSubCoHeadService.set(FormConstant.NCKD_EMPLOYEE,employee);
             saveSubCoHeadServiceList.add(newSubCoHeadService);
 
         }
@@ -261,7 +373,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 +384,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 +399,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);

+ 384 - 0
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/empmgt/TenurePersonListListPlugin.java

@@ -0,0 +1,384 @@
+package nckd.jxccl.swc.mas.plugin.form.empmgt;
+
+import kd.bos.common.enums.EnableEnum;
+import kd.bos.consts.PermItemConst;
+import kd.bos.context.RequestContext;
+import kd.bos.dataentity.OperateOption;
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.entity.DynamicObjectCollection;
+import kd.bos.entity.constant.StatusEnum;
+import kd.bos.entity.operate.result.OperationResult;
+import kd.bos.form.CloseCallBack;
+import kd.bos.form.FormShowParameter;
+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.form.events.ClosedCallBackEvent;
+import kd.bos.list.plugin.AbstractListPlugin;
+import kd.bos.mvc.SessionManager;
+import kd.bos.orm.query.QCP;
+import kd.bos.orm.query.QFilter;
+import kd.bos.servicehelper.QueryServiceHelper;
+import kd.bos.servicehelper.operation.SaveServiceHelper;
+import kd.hr.hbp.common.model.AuthorizedOrgResultWithSub;
+import kd.sdk.hr.hbp.business.helper.permission.HRPermissionServiceHelper;
+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.base.common.utils.ShowOperExecuteResult;
+import nckd.jxccl.base.entity.helper.EntityHelper;
+import nckd.jxccl.base.hrpi.helper.EmpPosOrgRelHelper;
+import nckd.jxccl.swc.mas.common.MasConstant;
+
+import java.time.LocalDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+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;
+
+/**
+* 任期人员名单-列表插件
+* 实体标识:nckd_tenurepersonlist
+* @author W.Y.C
+* @date 2025/11/30 20:04
+* @version 1.0
+*/
+public class TenurePersonListListPlugin extends AbstractListPlugin implements Plugin {
+
+    @Override
+    public void afterDoOperation(AfterDoOperationEventArgs e) {
+        String operateKey = e.getOperateKey();
+        if(e.getOperationResult() != null && e.getOperationResult().isSuccess()){
+            if(MasConstant.LOADPARTYPOSITION_OP.equals(operateKey)){
+                //载入党政职务履历
+                FormShowParameter showParameter = new FormShowParameter();
+                showParameter.setFormId(MasConstant.LOADPARTYPOSTPOPUP_ENTITYID);
+                showParameter.getOpenStyle().setShowType(ShowType.Modal);
+                showParameter.setCaption("请选择要载入的【任期】");
+                showParameter.setSendToClient(true);
+                showParameter.setCloseCallBack(new CloseCallBack(this, MasConstant.LOADPARTYPOSTPOPUP_ENTITYID));
+                this.getView().showForm(showParameter);
+            }
+        }
+    }
+
+    @Override
+    public void closedCallBack(ClosedCallBackEvent closedCallBackEvent) {
+        String actionId = closedCallBackEvent.getActionId();
+        if(MasConstant.LOADPARTYPOSTPOPUP_ENTITYID.equalsIgnoreCase(actionId)){
+            Object returnData = closedCallBackEvent.getReturnData();
+            if(returnData != null) {
+                DynamicObject term = ConvertUtil.toDynamicObjectOrNull(returnData);
+                loadParTyPosition(term);
+            }
+        }
+    }
+
+    /**
+     * 载入党政职务履历
+     * @return: void
+     * @author W.Y.C
+     * @date: 2025/11/27 18:40
+     */
+    private void loadParTyPosition(DynamicObject term){
+        LocalDateTime now = DateUtil.now();
+
+        LocalDateTime beginYear = DateUtil.beginOfYear(now);
+        LocalDateTime endYear = DateUtil.endOfYear(now);
+
+        Date startOfYear = DateUtil.toDate(DateUtil.beginOfYear(now));
+        Date endOfYear = DateUtil.toDate(DateUtil.endOfYear(now));
+
+        // 只处理权限范围内的人员
+        Long currUserId = RequestContext.get().getCurrUserId();
+        AuthorizedOrgResultWithSub userAdminOrgWithSub = HRPermissionServiceHelper.getUserAdminOrgsWithSub(
+                currUserId, "nckd_pm", MasConstant.SUBCOHEADSERVICE_ENTITYID,
+                PermItemConst.ITEM_VIEW, "nckd_employee.hsbs_empposorgrel.adminorg", new HashMap<>());
+        QueryFieldBuilder subCoHeadServiceFieldBuilder = QueryFieldBuilder.create()
+                .addIdNumberName(MasConstant.NCKD_EMPLOYEE);
+        //查询任期区间已生成的人员
+        QFilter tenurePersonListFilterFilter = new QFilter(MasConstant.NCKD_TERM, QCP.equals, term.getLong(FormConstant.ID_KEY));
+        DynamicObjectCollection tenurePersonListFilterQuery = QueryServiceHelper.query(MasConstant.TENUREPERSONLIST_ENTITYID, subCoHeadServiceFieldBuilder.buildSelect(), new QFilter[]{tenurePersonListFilterFilter});
+        List<Long> employeeIds = tenurePersonListFilterQuery.stream()
+                .map(dynamicObject -> dynamicObject.getLong(String.join(".", MasConstant.NCKD_EMPLOYEE, FormConstant.ID_KEY)))
+                .collect(Collectors.toList());
+
+        //查询党政履历
+//        nckd_hrpi_partyposh
+        QueryFieldBuilder partyPoshFieldBuilder = QueryFieldBuilder.create()
+                .add(MasConstant.STARTDATE)
+                .add(MasConstant.ENDDATE)
+                .add(MasConstant.NCKD_PAYUNIT)
+                //变动时间
+                .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)
+                .add(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, 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(MasConstant.ID_KEY)
+                .add(MasConstant.STARTDATE)
+                .add(MasConstant.ENDDATE)
+                .add(MasConstant.NCKD_TERM)
+                .add(MasConstant.EMPLOYEE_KEY)
+                .orderDesc(MasConstant.STARTDATE, MasConstant.ENDDATE);
+
+        //查询下一段的企业负责人信息;用于后续逻辑查找下一段的负责人信息
+        QFilter allEntHeadFilter = new QFilter(FormConstant.EMPLOYEE_KEY, QCP.not_in, employeeIds)
+                //法人岗位层级为高管
+                .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(MasConstant.STARTDATE)
+                .add(MasConstant.ENDDATE)
+                .addIdNumberName(FormConstant.NCKD_EMPPOSORGREL,FormConstant.EMPLOYEE_KEY)
+                .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(MasConstant.STARTDATE)
+                ))));
+        //构建子企业负责人任职情况实体
+        List<DynamicObject> saveSubCoHeadServiceList = new ArrayList<>();
+        for (Map.Entry<Long, DynamicObject> entHeadRecordEntry : entHeadRecordMap.entrySet()) {
+            //企业负责人信息
+            DynamicObject entHead = entHeadRecordEntry.getValue();
+            //党政履历
+            DynamicObject partyPosh = latestPartyPoshRecordMap.get(entHeadRecordEntry.getKey());
+            DynamicObject newSubCoHeadService = EntityHelper.newEntity(MasConstant.TENUREPERSONLIST_ENTITYID);
+            newSubCoHeadService.set(MasConstant.NCKD_EMPLOYEE,entHeadRecordEntry.getKey());
+            newSubCoHeadService.set(MasConstant.STATUS, StatusEnum.B.toString());
+            newSubCoHeadService.set(MasConstant.ENABLE, EnableEnum.YES.getCode());
+
+
+            DynamicObject employee = null;
+            //党政履历
+            if(partyPosh != null) {
+                long employeeId = partyPosh.getLong(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY));
+                if(employeeId > 0) {
+                    employee = EntityHelper.newEntity(MasConstant.HSBS_EMPLOYEE, employeeId);
+                    employee.set(FormConstant.NAME_KEY, partyPosh.getString(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.NAME_KEY)));
+                }
+                //所属二级单位(发薪单位)
+                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(MasConstant.NCKD_POSNAME,partyPosh.getString(MasConstant.NCKD_POSNAME));
+                //任职开始时间(变动日期)
+                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(MasConstant.NCKD_SERVICEMONTHS,between);
+                }
+
+            }
+            DynamicObject legalPost = legalPostMap.get(entHeadRecordEntry.getKey());
+            if(legalPost != null){
+                long lawEntityId = legalPost.getLong(String.join(".", MasConstant.NCKD_LAWENTITY, FormConstant.ID_KEY));
+                //法人单位
+                DynamicObject lawentity = EntityHelper.newEntity(FormConstant.HBSS_LAWENTITY, lawEntityId);
+                newSubCoHeadService.set(MasConstant.NCKD_LAWENTITY,lawentity);
+            }
+            //企业负责人信息
+            if(entHead != null){
+                long employeeId = entHead.getLong(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY));
+                if(employeeId > 0) {
+                    employee = EntityHelper.newEntity(MasConstant.HSBS_EMPLOYEE, employeeId);
+                    employee.set(FormConstant.NAME_KEY, entHead.getString(String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.NAME_KEY)));
+                }
+                //任期区间
+                newSubCoHeadService.set(MasConstant.NCKD_TERM,entHead.get(MasConstant.NCKD_TERM));
+
+            }
+            //员工信息
+            newSubCoHeadService.set(FormConstant.NCKD_EMPLOYEE,employee);
+            saveSubCoHeadServiceList.add(newSubCoHeadService);
+
+        }
+        if(!saveSubCoHeadServiceList.isEmpty()) {
+            //调用save op
+            OperateOption option = OperateOption.create();
+            option.setVariableValue("load", Boolean.TRUE+"");
+            OperationResult operationResult = SaveServiceHelper.saveOperate(MasConstant.TENUREPERSONLIST_ENTITYID, saveSubCoHeadServiceList.toArray(new DynamicObject[0]), option);
+            if (!operationResult.isSuccess()) {
+                String parentPageId = this.getView().getFormShowParameter().getPageId();
+                IFormView parentView = SessionManager.getCurrent().getViewNoPlugin(parentPageId);
+                IPageCache pageCache = (IPageCache) parentView.getService(IPageCache.class);
+                Map<String, String> customData = operationResult.getCustomData();
+                //成功的记录
+                Map<Object, Object> successMap = new HashMap<>();
+                for (Object successPkId : operationResult.getSuccessPkIds()) {
+                    successMap.put(successPkId, customData.get(successPkId.toString()));
+                }
+                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()));
+                }
+                if (!successMap.isEmpty()) {
+                    String parentPageId = this.getView().getFormShowParameter().getPageId();
+                    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);
+                }
+            }
+        }else {
+            this.getView().showTipNotification("没有需要载入的数据!");
+        }
+
+    }
+}

+ 143 - 0
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/form/incentivemgmt/EntldrTermBonusApprFormPlugin.java

@@ -0,0 +1,143 @@
+package nckd.jxccl.swc.mas.plugin.form.incentivemgmt;
+
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.entity.DynamicObjectCollection;
+import kd.bos.entity.constant.StatusEnum;
+import kd.bos.entity.datamodel.RowDataEntity;
+import kd.bos.entity.datamodel.events.AfterAddRowEventArgs;
+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_entldrtermbonusappr
+* @author W.Y.C
+* @date 2025/11/30 21:18
+* @version 1.0
+*/
+public class EntldrTermBonusApprFormPlugin 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 afterAddRow(AfterAddRowEventArgs e) {
+        for (RowDataEntity rowDataEntity : e.getRowDataEntities()) {
+            int rowIndex = rowDataEntity.getRowIndex();
+            initOperateOption(0, 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_TERM)
+                .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));
+        DynamicObject term =  ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(MasConstant.NCKD_TERM));
+        if(payUnit != null && lawEntity != null && term != null){
+            QueryFieldBuilder queryFieldBuilder = QueryFieldBuilder.create()
+                    .addIdNumberName(MasConstant.NCKD_PAYUNIT)
+                    .addIdNumberName(MasConstant.NCKD_LAWENTITY)
+                    .addIdNumberName(MasConstant.NCKD_TERM)
+                    .addIdNumberName(MasConstant.NCKD_EMPLOYEE)
+                    .add(FormConstant.NCKD_STARTDATE)
+                    .add(FormConstant.NCKD_ENDDATE)
+                    .add(MasConstant.NCKD_POSNAME)
+                    .add(MasConstant.NCKD_SERVICEMONTHS);
+
+            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_TERM, QCP.equals, term.getLong(FormConstant.ID_KEY))
+                    .and(FormConstant.STATUS, QCP.in, new String[]{StatusEnum.C.toString(), StatusEnum.B.toString()});
+            DynamicObject[] dbSubCorpSalaryArray = BusinessDataServiceHelper.load(MasConstant.TENUREPERSONLIST_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) {
+                    DynamicObject entry = entryEntities.addNew();
+                    entry.set(MasConstant.NCKD_EMPLOYEE, dbSubCorpSalary.get(MasConstant.NCKD_EMPLOYEE));
+                    entry.set(MasConstant.NCKD_POSNAME, dbSubCorpSalary.get(MasConstant.NCKD_POSNAME));
+                    entry.set(MasConstant.NCKD_STARTDATE, dbSubCorpSalary.get(MasConstant.NCKD_STARTDATE));
+                    entry.set(MasConstant.NCKD_ENDDATE, dbSubCorpSalary.get(MasConstant.NCKD_ENDDATE));
+                    entry.set(MasConstant.NCKD_SERVICEMONTHS, dbSubCorpSalary.get(MasConstant.NCKD_SERVICEMONTHS));
+                }
+                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) {
+        if(rowIndex > -1) {
+            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);
+            }
+//            getView().updateView(FormConstant.NCKD_ENTRYENTITY);
+        }
+    }
+}

+ 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);
+
+        }
+    }
+}

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

@@ -0,0 +1,133 @@
+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.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 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_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);
+
+        }
+    }
+}

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

@@ -0,0 +1,152 @@
+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.AfterAddRowEventArgs;
+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 afterAddRow(AfterAddRowEventArgs e) {
+        initOperateOption(0,e.getInsertRow());
+    }
+
+    @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) {
+        if(rowIndex > -1) {
+            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);
+
+            }
+        }
+    }
+}

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

@@ -1,4 +1,4 @@
-package nckd.jxccl.swc.mas.plugin.operate;
+package nckd.jxccl.swc.mas.plugin.operate.empmgt;
 
 import kd.bos.dataentity.entity.DynamicObject;
 import kd.bos.entity.ExtendedDataEntity;
@@ -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,37 @@ 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);
+            if(dynamicObject != null) {
+                this.getOperationResult().getCustomData().put(id + "", "【" + dynamicObject.getString(FormConstant.NAME_KEY) + "】");
+            }
+        }
+
 
-        this.getOperationResult().getCustomData().put("成功的id","成功的消息");
     }
 }

+ 62 - 0
code/swc/nckd-jxccl-swc/src/main/java/nckd/jxccl/swc/mas/plugin/operate/empmgt/TenurePersonListOpPlugin.java

@@ -0,0 +1,62 @@
+package nckd.jxccl.swc.mas.plugin.operate.empmgt;
+
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.entity.ExtendedDataEntity;
+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;
+
+/**
+* 任期人员名单-保存插件
+* 实体标识:nckd_tenurepersonlist
+* @author W.Y.C
+* @date 2025/11/27 22:25
+* @version 1.0
+*/
+public class TenurePersonListOpPlugin extends AbstractOperationServicePlugIn implements Plugin {
+
+    @Override
+    public void onAddValidators(AddValidatorsEventArgs e) {
+        //通过“载入党政职务履历”
+        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();
+                    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();
+        for (DynamicObject dataEntity : e.getDataEntities()) {
+            long id = dataEntity.getLong(FormConstant.ID_KEY);
+            DynamicObject dynamicObject = dataEntity.getDynamicObject(FormConstant.NCKD_EMPLOYEE);
+            if(dynamicObject != null) {
+                this.getOperationResult().getCustomData().put(id + "", "【" + dynamicObject.getString(FormConstant.NAME_KEY) + "】");
+            }
+        }
+
+
+    }
+}

+ 32 - 1
code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/task/SyncPunchCardTask.java

@@ -4,14 +4,23 @@ import com.alibaba.fastjson.JSON;
 import com.hikvision.artemis.sdk.ArtemisHttpUtil;
 import com.hikvision.artemis.sdk.config.ArtemisConfig;
 import kd.bos.context.RequestContext;
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.resource.ResManager;
 import kd.bos.entity.param.CustomParam;
 import kd.bos.exception.KDException;
+import kd.bos.logging.Log;
+import kd.bos.logging.LogFactory;
+import kd.bos.orm.query.QFilter;
+import kd.bos.schedule.api.JobInfo;
 import kd.bos.schedule.executor.AbstractTask;
+import kd.bos.schedule.executor.JobClient;
+import kd.bos.schedule.server.ScheduleService;
 import kd.bos.servicehelper.parameter.SystemParamServiceHelper;
 import kd.sdk.plugin.Plugin;
 import nckd.jxccl.wtc.utils.SyncPunchCardHelper;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import nckd.jxccl.wtc.wtabm.web.common.constant.WtcConstant;
 
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
@@ -29,7 +38,7 @@ public class SyncPunchCardTask extends AbstractTask implements Plugin {
             put("https://", getCamsApi);
         }
     };
-
+    private static final Log LOGGER = LogFactory.getLog(SyncPunchCardTask.class);
     public void initConfig() {
         CustomParam customParam = new CustomParam();
         customParam.getSearchKeySet().add("PUNCH_CARD_HOST");
@@ -56,6 +65,28 @@ public class SyncPunchCardTask extends AbstractTask implements Plugin {
             getAllCards(startTime, endTime);
         } catch (Exception e) {
             throw new RuntimeException(e);
+        } finally {
+            doSyncJob();
+        }
+    }
+
+    public void doSyncJob() {
+        DynamicObject dynamicJob = WtcConstant.JOB_HELPER.loadOne("id", new QFilter("number", "=", "wtis_syncPunchCardData_SKDJ_S"));
+        if (dynamicJob != null) {
+            JobInfo jobInfo = ScheduleService.getInstance().getObjectFactory().getJobDao().get(String.valueOf(dynamicJob.getPkValue()));
+            if (jobInfo.isEnable()) {
+                DynamicObject task = WtcConstant.TASK_HELPER.queryOriginalOne("id", new QFilter[]{new QFilter("job.id", "=", dynamicJob.getPkValue()), new QFilter("status", "=", "SCHEDULED")});
+                if (task == null) {
+                    try {
+                        JobClient.dispatch(jobInfo);
+                        if (LOGGER.isDebugEnabled()) {
+                            LOGGER.debug("原始卡同步任务启动成功!");
+                        }
+                    } catch (Exception var6) {
+                        LOGGER.warn("原始卡同步任务启动失败!", var6);
+                    }
+                }
+            }
         }
     }
 

+ 10 - 12
code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/utils/SyncPunchCardHelper.java

@@ -3,6 +3,7 @@ package nckd.jxccl.wtc.utils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.kingdee.util.StringUtils;
+import kd.bos.dataentity.OperateOption;
 import kd.bos.dataentity.entity.DynamicObject;
 import kd.bos.dataentity.utils.ObjectUtils;
 import kd.bos.exception.ErrorCode;
@@ -10,10 +11,9 @@ import kd.bos.exception.KDBizException;
 import kd.bos.orm.query.QCP;
 import kd.bos.orm.query.QFilter;
 import kd.bos.servicehelper.QueryServiceHelper;
+import kd.bos.servicehelper.operation.OperationServiceHelper;
 import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
-import kd.wtc.wtis.business.punchcarddata.PunchCardDataHelper;
-import kd.wtc.wtis.business.punchcarddata.PunchCardDataService;
-import kd.wtc.wtis.webapi.punchcard.PunchCardSyncSupport;
+import nckd.jxccl.wtc.wtabm.web.common.constant.WtcConstant;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -46,13 +46,7 @@ public class SyncPunchCardHelper {
             return;
         }
         PUNCH_CARD_HELPER.save((DynamicObject[])actualSaveList.toArray(new DynamicObject[0]));
-        try {
-            PunchCardSyncSupport.execute(() -> {
-                syncCardRecord(actualArr,batchNumber);
-            });
-        } catch (Exception e) {
-        }
-
+        //syncCardRecord(actualArr,batchNumber);
     }
 
     /**
@@ -114,8 +108,8 @@ public class SyncPunchCardHelper {
     private static void syncCardRecord(JSONArray resultArr, String batchNumber) {
         try {
             long l1 = System.currentTimeMillis();
-            DynamicObject[] date = PunchCardDataHelper.getDataByBatchNumber(batchNumber);
-            PunchCardDataService.dealWithData(date);
+            DynamicObject[] date = getDataByBatchNumber(batchNumber);
+            OperationServiceHelper.executeOperate("autosysn", "wtis_punchcarddata", date, OperateOption.create());
             long l2 = System.currentTimeMillis();
         } catch (Exception e) {
             throw new KDBizException(e, new ErrorCode("", e.getMessage()), new Object[0]);
@@ -124,6 +118,10 @@ public class SyncPunchCardHelper {
         }
     }
 
+    public static DynamicObject[] getDataByBatchNumber(String batchNumber) {
+        return WtcConstant.PUNCHCARDDATA_HELPER.loadDynamicObjectArray(new QFilter[]{new QFilter("batchnumber", "=", batchNumber)});
+    }
+
 
     /**
      * 根据考勤卡号和海康威视返回ID判断是否存在记录

+ 10 - 0
code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/wtabm/web/common/constant/WtcConstant.java

@@ -44,4 +44,14 @@ public class WtcConstant {
 
     /* 考勤项目-旷工天数编码*/
     public static final String ABSENT_NUMBER = "EX_1140_S";
+
+    /* 打卡记录 */
+    public static final HRBaseServiceHelper PUNCHCARDDATA_HELPER = new HRBaseServiceHelper("wtis_punchcarddata");
+    /* 调度作业 */
+    public static final HRBaseServiceHelper JOB_HELPER = new HRBaseServiceHelper("sch_job");
+    /* 运行日志 */
+    public static final HRBaseServiceHelper TASK_HELPER = new HRBaseServiceHelper("sch_task");
+
+    /* 考勤档案 */
+    public static final HRBaseServiceHelper ATTFILEBASE_HELPER = new HRBaseServiceHelper("wtp_attfilebase");
 }

+ 1 - 10
code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/wtabm/web/common/util/WtcUtils.java

@@ -14,7 +14,6 @@ import kd.bos.servicehelper.QueryServiceHelper;
 import kd.hr.haos.business.domain.adminorg.service.impl.AdminOrgQueryServiceHelper;
 import kd.hr.hbp.common.util.HRDateTimeUtils;
 import kd.hr.hbp.common.util.HRStringUtils;
-import kd.wtc.wtbs.common.helper.WTCAppContextHelper;
 import org.apache.commons.lang3.ObjectUtils;
 
 import java.time.LocalDate;
@@ -115,15 +114,7 @@ public class WtcUtils {
             Date beginDate = model.getDataEntity().getDate(beginDateKer);
             Date endDate = model.getDataEntity().getDate(endDateKer);
             if (beginDate != null && endDate != null) {
-                int addMonth;
-                try {
-                    addMonth = WTCAppContextHelper.getWTCParamWithSystemCompat().getIntValue("kd.wtc.wtte.attreport.queryRangeMonth", 1);
-                    if (addMonth <= 0) {
-                        addMonth = 1;
-                    }
-                } catch (Exception var9) {
-                    addMonth = 1;
-                }
+                int addMonth = 1;
 
                 Date date = HRDateTimeUtils.addMonth(beginDate, addMonth);
                 if (!endDate.before(date)) {