package com.kingdee.eas.hr.affair.app;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.util.BOSUuid;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.recuritment.task.ResignBeisenFacadeFactory;
import com.kingdee.eas.hr.affair.*;
import com.kingdee.eas.hr.base.HRBillBaseEntryInfo;
import com.kingdee.eas.hr.base.HRBillBaseInfo;
import com.kingdee.eas.hr.base.HRBillStateEnum;
import com.kingdee.eas.hr.base.IHRBillBase;
import com.kingdee.eas.hr.base.app.plan.SHRActionVerifyByPersonPlanTool;
import com.kingdee.eas.hr.base.app.util.MetaDataServerUtil;
import com.kingdee.eas.hr.base.app.util.SHRBizBillAttachmentReverseUtils;
import com.kingdee.eas.hr.base.app.util.SHRSameDatePersonChangeUtil;
import com.kingdee.eas.hr.base.util.AffairBizExtendCustomerTool;
import com.kingdee.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * 离职单拓展
 * 20241110
 * @author coyle
 *
 */
public class ResignBizBillControllerBeanExEx extends ResignBizBillControllerBean {
	private static Logger logger = LoggerFactory.getLogger(ResignBizBillControllerBeanExEx.class);

//	@Override
//	protected IObjectPK _submit(Context ctx, IObjectValue model) throws BOSException, EASBizException {
//		return super._submit(ctx, model);
//
//		IEnactmentService enactService = EnactmentServiceFactory.createEnactService(ctx);
//		enactService.createProcInst()
//
//	}
//	@Override
//	protected void _doWithOtherChangeEffect(Context ctx, HRAffairBizBillEntryInfo entry)
//			throws BOSException, EASBizException {
//		super._doWithOtherChangeEffect(ctx, entry);
//		// 生成电子证明
////		CreateCertification.createCert(ctx, entry.getId().toString(),0);
//	}

	/**
	 * 离职生效
	 * @param ctx
	 * @param billID
	 * @throws BOSException
	 * @throws EASBizException
	 */
	@Override
	protected void _auditEntryEffect(Context ctx, BOSUuid billID) throws BOSException, EASBizException {
		super._auditEntryEffect(ctx,billID);
		if (billID != null) {
			ResignBizBillInfo billInfo = this.getResignBizBillInfo(ctx,new ObjectUuidPK(billID));
			//ResignBizBillEntryCollection collection = billInfo.getEntrys();
			BOSUuid id = billInfo.getId();
			ResignBeisenFacadeFactory.getLocalInstance(ctx).syncBeisenReserveTalentPool(id.toString(), billInfo);
		}
	}
	@Override
	protected void _untiCheckBizBill(Context ctx, String billId) throws BOSException, EASBizException {
		super._untiCheckBizBill(ctx,billId);
		if (!StringUtils.isEmpty(billId)) {
			ResignBizBillInfo billInfo = this.getResignBizBillInfo(ctx,new ObjectUuidPK(billId));
			BOSUuid id =billInfo.getId();
			ResignBeisenFacadeFactory.getLocalInstance(ctx).syncUnBeisenReserveTalentPool(id.toString(),billInfo);
		}
	}
}