package com.kingdee.eas.custom.ats.app;

import org.apache.log4j.Logger;

import com.kingdee.bos.*;
import com.kingdee.eas.hr.ats.AtsLeaveBillCollection;
import com.kingdee.eas.hr.ats.AtsLeaveBillFactory;
import com.kingdee.eas.custom.ats.util.AtsLeaveBillEasOperationUtil;

/**
 * 修复请假单中审批中 未审批的数据拆分明细
 * @author issuser
 *
 */
public class AtsLeaveDetailSameFacadeControllerBean extends AbstractAtsLeaveDetailSameFacadeControllerBean
{
    private static Logger logger =
        Logger.getLogger("com.kingdee.eas.custom.ats.app.AtsLeaveDetailSameFacadeControllerBean");
    
    @Override
    public void repairData(Context ctx) throws BOSException {
    	// TODO 自动生成的方法存根
    	repairLeaveBill(ctx);
    	super.repairData(ctx);
    }
    
    /**
     * 修复请假单拆分数据
     * @param ctx
     * @return
     * @throws BOSException 
     */
    private void repairLeaveBill(Context ctx) throws BOSException {
    	 
    	AtsLeaveBillCollection atsLeaveBillCollection = AtsLeaveBillFactory.getLocalInstance(ctx).getAtsLeaveBillCollection(" where  billState in ('1','2')");
    	
    	if(atsLeaveBillCollection !=null && atsLeaveBillCollection.size()>0) {
		}
    	for (int i = 0; i < atsLeaveBillCollection.size(); i++) {
    		AtsLeaveBillEasOperationUtil.saveInfo(ctx, atsLeaveBillCollection.get(i));
    	}
    	
    }
}