package nckd.jxccl.swc.mas.plugin.operate.structappr.change;

import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.PreparePropertysEventArgs;
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
import kd.sdk.plugin.Plugin;
import nckd.jxccl.base.common.constant.FormConstant;
import nckd.jxccl.swc.constants.MasConstant;

import java.util.Date;

/**
 * 企业负责人个人年度薪酬标准核定表_变更单-反写操作
 * 实体标识：nckd_entldranlsalstdchg
 * @author W.Y.C
 * @date 2025/12/3 19:15
 * @version 1.0
 */
public class EntldrAnlSalStdChgOpPlugin extends AbstractSalaryStdChgOpPlugin implements Plugin {

    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        e.getFieldKeys().addAll(this.billEntityType.getAllFields().keySet());
    }

    @Override
    public void beginOperationTransaction(BeginOperationTransactionArgs e) {
        super.beginOperationTransaction(e);
    }

    @Override
    protected String getEntityId() {
        return MasConstant.ENTLEADERANLSALSTD_ENTITYID;
    }

    @Override
    protected String getEntityName() {
        return "企业负责人个人年度薪酬标准核定表";
    }

    @Override
    protected void processBeforeUpdate(DynamicObject dataEntity, DynamicObject updateEntity) {
        updateEntity.set(FormConstant.MODIFY_TIME_KEY, new Date());
        dataEntity.set(FormConstant.MODIFIER_KEY, dataEntity.get(FormConstant.CREATOR_KEY));
    }
}