package com.kingdee.shr.batchContract.web.handler;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ui.ModelMap;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryCollection;
import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryFactory;
import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryInfo;
import com.kingdee.eas.hr.affair.IEmpEnrollBizBillEntry;
import com.kingdee.shr.base.syssetting.context.SHRContext;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.common.ContractUtils;
import com.kingdee.util.StringUtils;


/**
 * 劳动合同_拓展
 * @author  coyle
 * 202410 
 */
public class ContractSignEditHandlerEx extends ContractSignEditHandler {
	private static final Logger logger = LoggerFactory.getLogger(ContractSignEditHandlerEx.class);
	
	/**
	 * 查询劳动合同主体
	 * @param request
	 * @param response
	 * @param modelMap
	 * @throws SHRWebException
	 * @throws BOSException
	 */
	public void queryContractSubAction (HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
			throws SHRWebException, BOSException {
		String personId = StringUtils.cnulls(request.getParameter("personId"));
		Context ctx = SHRContext.getInstance().getContext();
		Map<String, String> party = ContractUtils.getParty(ctx, personId);
		writeSuccessData(party);
	}
	
	
	
	 /**
	  * 根据劳动合同主体查询出不为此主体的人员;
	  * @param request
	  * @param response
	  * @param modelMap
	  * @throws SHRWebException
	  * @throws BOSException
	  */
	public void checkContractSubAction (HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
			throws SHRWebException, BOSException {
		String personIds = StringUtils.cnulls(request.getParameter("personIds"));
		String partyId = StringUtils.cnulls(request.getParameter("partyId"));
		Context ctx = SHRContext.getInstance().getContext();
		ArrayList personsParty = ContractUtils.getPersonsParty(ctx,personIds,partyId);
		writeSuccessData(personsParty);
	}
}
