package com.yem.wm.im.placeexamine.op;

import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
import kd.bos.servicehelper.BusinessDataServiceHelper;

import static com.yem.wm.im.placeexamine.op.AlaceexamineUnAuditOp.back_placeexamine;

public class AlaceexamineUnSubmitOp extends AbstractOperationServicePlugIn {

    @Override
    public void endOperationTransaction(EndOperationTransactionArgs e) {
        super.endOperationTransaction(e);
        if ("unsubmit".equals(e.getOperationKey())) {
            if (null != e.getDataEntities()) {
                DynamicObject[] bills = e.getDataEntities();
                for (int i = 0; i < bills.length; ++i) {
                    DynamicObject bill = bills[i];
                    bill = BusinessDataServiceHelper.loadSingle(bill.getPkValue(), bill.getDynamicObjectType().getName());
                    back_placeexamine(bill);
                }
            }
        }
    }
}
