package nc.bs.mmpac.pmo.pac0002.bp.rule;


import nc.bs.logging.Log;
import nc.bs.mmpac.pmo.pac0002.bp.rule.util.SyncEpicMesUtil;
import nc.impl.pubapp.pattern.rule.ICompareRule;
import nc.util.mmf.framework.base.MMArrayUtil;
import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;

/**
 * 流程生产订单取消审批后同步艾普MES
 *
 * @author mzr
 * @date 2025/7/15
 */
public class AfterUnApproveSyncEpicMesRule implements ICompareRule<PMOAggVO> {

    private static final String LOG_INFO_NAME = "dldzlog";

    private static final Log logDl = Log.getInstance(LOG_INFO_NAME);

    @Override
    public void process(PMOAggVO[] pmoAggVOS, PMOAggVO[] originVOs) {
        if (MMArrayUtil.isEmpty(pmoAggVOS)) {
            return;
        }
        try {
            SyncEpicMesUtil mesUtil = new SyncEpicMesUtil();
            mesUtil.processData(pmoAggVOS, "N");

        } catch (Exception e) {
            logDl.error("同步生产订单到艾普MES系统失败: " + e.getMessage(), e);
            ExceptionUtils.wrappException(e);
        }
    }

}
