package com.kingdee.shr.affair.web.handler.hrman;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.sql.SQLException;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;

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

import org.apache.commons.lang3.StringUtils;
import org.springframework.ui.ModelMap;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.bos.metadata.entity.SelectorItemInfo;
import com.kingdee.bos.util.BOSUuid;
import com.kingdee.eas.basedata.org.AdminOrgUnitInfo;
import com.kingdee.eas.basedata.org.HROrgUnitInfo;
import com.kingdee.eas.basedata.person.PersonCollection;
import com.kingdee.eas.basedata.person.PersonFactory;
import com.kingdee.eas.basedata.person.PersonInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryCollection;
import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryInfo;
import com.kingdee.eas.hr.affair.EmpEnrollBizBillFactory;
import com.kingdee.eas.hr.affair.EmpEnrollBizBillInfo;
import com.kingdee.eas.hr.base.EmpPosOrgRelationException;
import com.kingdee.eas.hr.base.EmpPosOrgRelationInfo;
import com.kingdee.eas.hr.base.EnrollAgainCodingEnum;
import com.kingdee.eas.hr.base.HRBillStateEnum;
import com.kingdee.eas.hr.base.HRBizDefineFactory;
import com.kingdee.eas.hr.base.HRBizDefineInfo;
import com.kingdee.eas.hr.base.VariationReasonCollection;
import com.kingdee.eas.hr.base.VariationReasonFactory;
import com.kingdee.eas.hr.base.util.HRUtilExtend;
import com.kingdee.eas.hr.emp.IPersonOtherInfo;
import com.kingdee.eas.hr.emp.IPersonPhoto;
import com.kingdee.eas.hr.emp.PersonOtherInfoCollection;
import com.kingdee.eas.hr.emp.PersonOtherInfoFactory;
import com.kingdee.eas.hr.emp.PersonPhotoCollection;
import com.kingdee.eas.hr.emp.PersonPhotoFactory;
import com.kingdee.eas.hr.emp.PersonPhotoInfo;
import com.kingdee.eas.hr.emp.app.util.SHREmpOptEmpOrgRelationTool;
import com.kingdee.eas.util.app.DbUtil;
import com.kingdee.jdbc.rowset.IRowSet;
import com.kingdee.shr.affair.web.handler.util.EmployeeUtil;
import com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException;
import com.kingdee.shr.base.syssetting.context.SHRContext;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
import com.kingdee.shr.base.syssetting.ml.SHRWebResource;
import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
import com.kingdee.shr.preentry.PreEntryCollection;
import com.kingdee.shr.preentry.PreEntryFactory;
import com.kingdee.shr.preentry.PreEntryInfo;
import com.kingdee.shr.preentry.PreEntryPersonInfo;
import com.kingdee.eas.hr.base.HRBizDefineTypeEnum;
import com.kingdee.eas.hr.base.util.HRParamUtil;


/**
 * 入职单Handler扩展
 * @author issuser
 *
 */
public class EmpEnrollBizBillHrManEditHandlerEx extends EmpEnrollBizBillHrManEditHandler{

	@Override
	protected void beforeSave(HttpServletRequest request,
			HttpServletResponse response, CoreBaseInfo model)
			throws SHRWebException {
		super.beforeSave(request, response, model);
		EmpEnrollBizBillInfo billInfo = (EmpEnrollBizBillInfo) model;
		if (billInfo.getBillState() == null) {
			billInfo.setBillState(HRBillStateEnum.SAVED);
		}
		storefields(request, billInfo);
	}
	
	private CoreBaseInfo storefields(HttpServletRequest request,
			CoreBaseInfo model) throws SHRWebException {
		EmpEnrollBizBillInfo billInfo = (EmpEnrollBizBillInfo) model;

		if (billInfo.getId() == null) {
			billInfo.setIsMultiEntry(Boolean.TRUE.booleanValue());
		}
		EmpEnrollBizBillEntryInfo entryInfo = billInfo.getEntrys().get(0);

		if ((entryInfo.getPerson() != null)
				&& (entryInfo.getPerson().getId() == null)) {
			entryInfo.setPerson(null);
		}
		entryInfo.setBill(billInfo);
		EmpEnrollBizBillEntryCollection entryColl = null;
		if (!(StringUtils.isEmpty(request.getParameter("multiEntryBillId")))) {
			try {
				String multiEntryBillId = URLDecoder.decode(request
						.getParameter("multiEntryBillId"), "utf-8");

				EmpEnrollBizBillInfo multiEntryBillInfo = EmpEnrollBizBillFactory
						.getRemoteInstance().getEmpEnrollBizBillInfo(
								new ObjectUuidPK(multiEntryBillId));
			
				billInfo.setId(multiEntryBillInfo.getId());
				billInfo.setAdminOrg(multiEntryBillInfo.getAdminOrg());
				billInfo.setApplier(multiEntryBillInfo.getApplier());
				billInfo.setIsMulti(Boolean.TRUE.booleanValue());
				entryInfo.setBill(multiEntryBillInfo);
				//判断是否再入职
				//变动操作
				String hrBizDefineId =  multiEntryBillInfo.getString("hrBizDefine");
				Context ctx = SHRContext.getInstance().getContext();
				HRBizDefineInfo hrBizDefineInfo = HRBizDefineFactory.getLocalInstance(ctx).getHRBizDefineInfo(new ObjectUuidPK(hrBizDefineId));
				//不是再入职，重新获取员工编码
				if( !"SHR02".equals(hrBizDefineInfo.getNumber())) {
					//员工编码
					EmployeeUtil employeeUtil = new EmployeeUtil();
					int fnumber = employeeUtil.getFnumber();
					entryInfo.setEmpNumber(String.valueOf(fnumber));
				}
				entryColl = multiEntryBillInfo.getEntrys();
				entryColl.add(entryInfo);
			} catch (EASBizException e) {
				e.printStackTrace();
				throw new SHRWebException(e);
			} catch (BOSException e) {
				e.printStackTrace();
				throw new SHRWebException(e);
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
				throw new SHRWebException(e);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else {
			billInfo.setAdminOrg(entryInfo.getAdminOrg());
			billInfo.setIsMulti(Boolean.FALSE.booleanValue());
			entryColl = new EmpEnrollBizBillEntryCollection();
			entryColl.add(entryInfo);
		}
		try {
			HRUtilExtend.assableCell(entryInfo, "telNum");
		} catch (EASBizException e) {
			e.printStackTrace();
			throw new SHRWebException(e.getMessage());
		}

		billInfo.getEntrys().clear();
		billInfo.getEntrys().addCollection(entryColl);

		return billInfo;
	}
	
	@Override
	protected void verifyModel(HttpServletRequest request,
			HttpServletResponse response, CoreBaseInfo model)
			throws SHRWebException {
		EmpEnrollBizBillInfo billInfo = (EmpEnrollBizBillInfo) model;
		EmpEnrollBizBillEntryCollection coll = billInfo.getEntrys();
		try {
		
			//不是再入职，校验用户名、邮箱
			EmployeeUtil employeeUtil = new EmployeeUtil();
			if ((null != coll) && (coll.size() > 0)) {
				int i = 0;
				for (int size = coll.size(); i < size; ++i) {
					EmpEnrollBizBillEntryInfo info = coll.get(i);
					HRBizDefineInfo hrBizDefineInfo = info.getHrBizDefine();
					System.out.print("入职hrBizDefineInfo："+hrBizDefineInfo.getNumber());
					if(!"SHR02".equals(hrBizDefineInfo.getNumber())) {
						String fid = billInfo.getString("id");
						//用户名唯一校验
						Boolean isUniqueCheck = employeeUtil.checkUserName(
								info.get("userName").toString(),fid,info.getEmpNumber());
						if( !isUniqueCheck){
							throw new ImportException("This user name ："+ info.get("userName") + ",already exists"); 
						}
						//邮箱唯一校验
						Boolean emailCheck = employeeUtil.checkEmail(info.get("email").toString(),fid,info.getEmpNumber());
						if( !emailCheck){
							throw new ImportException("The user mailbox already exists. Procedure !"); 
						}
					}
					
				}
			}
			
			
		} catch (BOSException e1) {
			e1.printStackTrace();
		} catch (SQLException e1) {
			e1.printStackTrace();
		} 
		super.verifyModel(request, response, model);
	}
	
	
	/**
	 * 获取预入职单的信息
	 * @param request
	 * @param response
	 * @param modelMap
	 * @throws SHRWebException 
	 */
	public void getEmpPreEntryDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException{
		Map<String, Object> map = new HashMap<String, Object>();
		String preEntryId = request.getParameter("billId"); 
		String sql = " select b.fid as personTypeId , b.fname_l1 as personTypeName, " + 
				" c.fid as wcategoryId , c.fname_l1 as wcategoryName, " + 
				" d.fid as ftorptId , d.fname_l1 as ftorptName, " + 
				" e.fid as lmanagerId , e.fname_l1 as lmanagerName, " + 
				" f.fid as rmethodId , f.fname_l1 as rmethodName, " + 
				" g.fid as jobsId , g.fname_l1 as jobsName, " + 
				" h.fid as academictitleId , h.fname_l1 as academictitleName, " + 
				" j.fname_l1 jobName, k.fname_l1 credentTypeName, l.fname_l1 countryName, " + 
				" j.fid jobId, k.fid credentTypeId, l.fid countryId " + 
				" from t_hr_preentry a " + 
				" left join T_HR_EmployeeClassify b on a.CFPersontypeID = b.fid " + 
				" left join CT_MP_WorkerCategory c on a.CFWcategoryID = c.fid " + 
				" left join CT_MP_Fullorpart d on a.CFFtorptID = d.fid " + 
				" left join t_bd_person e on a.CFLmanagerID = e.fid " + 
				" left join CT_MP_Ratepayingmethod f on a.CFRmethodId = f.fid " + 
				" left join CT_HR_Job2 g on a.cfjobsId = g.fid " + 
				" left join CT_MP_AcademicTitle h on a.cfacademictitleId = h.fid " +
				" left join T_HR_JobGrade j on a.CFJOBGRADEID = j.fid " +
				" left join T_HR_CredentialsType k on a.CFDOCUMENTTYPEID = k.fid " +
				" left join T_HR_CountryRegion l on a.cfcountryregionid = l.fid " +
				" where a.fid = '" + preEntryId + "'";
	    Context ctx = SHRContext.getInstance().getContext();
	    try {
			IRowSet rs = DbUtil.executeQuery(ctx, sql);        
	        while (rs.next()) {
	             map.put("personTypeId",rs.getString("personTypeId"));
	             map.put("personTypeName",rs.getString("personTypeName"));
	             map.put("wcategoryId",rs.getString("wcategoryId"));
	             map.put("wcategoryName",rs.getString("wcategoryName"));
	             map.put("ftorptId",rs.getString("ftorptId"));
	             map.put("ftorptName",rs.getString("ftorptName"));
	             map.put("lmanagerId",rs.getString("lmanagerId"));
	             map.put("lmanagerName",rs.getString("lmanagerName"));
	             map.put("rmethodId",rs.getString("rmethodId"));
	             map.put("rmethodName",rs.getString("rmethodName"));
	             map.put("jobsId",rs.getString("jobsId"));
	             map.put("jobsName",rs.getString("jobsName"));
	             map.put("academictitleId",rs.getString("academictitleId"));
	             map.put("academictitleName",rs.getString("academictitleName"));
	             map.put("jobName",rs.getString("jobName"));
	             map.put("credentTypeName",rs.getString("credentTypeName"));
	             map.put("countryName",rs.getString("countryName"));
	             map.put("jobId",rs.getString("jobId"));
	             map.put("credentTypeId",rs.getString("credentTypeId"));
	             map.put("countryId",rs.getString("countryId"));
	         }
	    } catch (SQLException e) {
			e.printStackTrace();
		} catch (BOSException e) {
			e.printStackTrace();
		}
	    JSONUtils.writeJson(response, map);
		
	}
	
	/**
	 * 新增单据获取编码
	 * @param request
	 * @param response
	 * @param modelMap
	 * @throws SHRWebException 
	 * @throws SQLException 
	 * @throws BOSException 
	 */
	public void getEmpNumberAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException, BOSException, SQLException{
		Map<String, Object> map = new HashMap<String, Object>();
		EmployeeUtil employeeUtil = new EmployeeUtil();
		int fnumber = employeeUtil.getFnumber();
		map.put("empNumber", fnumber);
	    JSONUtils.writeJson(response, map);
		
	}
	
	/**
	 * 根据身份证号获取人员名称相关信息
	 * @param request
	 * @param response
	 * @param modelMap
	 * @return
	 * @throws SHRWebException
	 */
	public String getPersonNameAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException{
		Context ctx = SHRContext.getInstance().getContext();
		String idEnitiy = request.getParameter("idEntity");
		String sql = "select cfsurname,cfmiddlenames,cfgivenname,cflocalname,cfusername from T_BD_Person where fpassportno = '"+idEnitiy+"' or fidcardno = '"+idEnitiy+"' order by flastupdatetime desc";
		try {
			IRowSet rs = DbUtil.executeQuery(ctx, sql);
			while (rs.next()) {
				//姓
				modelMap.put("surName", rs.getString("cfsurname"));
				//中间名
				modelMap.put("middleName", rs.getString("cfmiddlenames"));
				//名
				modelMap.put("givenName", rs.getString("cfgivenname"));
				//本地名称
				modelMap.put("localName", rs.getString("cflocalname"));
				//用户名
				modelMap.put("userName", rs.getString("cfusername"));
				JSONUtils.writeJson(response, modelMap);
				return null;
	        }
		} catch (BOSException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}      
		modelMap.put("surName", "");
		modelMap.put("middleName", "");
		modelMap.put("givenName", "");
		modelMap.put("localName", "");
		modelMap.put("userName", "");
		return null;
	}
	
	
	//******************************************重新getPreEntryInitDataAction方法****************************20250504
	public void getPreEntryInitDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
			throws BOSException, SHRWebException {
		String billId = "";
		if (request.getParameter("billId") != null && !request.getParameter("billId").equals("")) {
			billId = request.getParameter("billId");
		}

		PreEntryInfo preEntryInfo = new PreEntryInfo();
		StringBuffer sql = new StringBuffer();
		sql.append("select *,talent.*").append(",position.id,position.name").append(",hrOrgUnit.id,hrOrgUnit.name").append(",empType.id,empType.name")
				.append(",adminOrg.id,adminOrg.name").append(",enrollSource.id,enrollSource.name,enrollSource.number")
				.append(",talent.folk.id,talent.folk.name,talent.zodiac.id,talent.zodiac.name,talent.constellation.id,talent.constellation.name")
				.append(",sourceBillType").append(" where id = '").append(billId).append("'");
		PreEntryCollection coll = PreEntryFactory.getRemoteInstance().getPreEntryCollection(sql.toString());
		String tempid;
		if (coll.size() > 0) {
			preEntryInfo = coll.get(0);
			if (preEntryInfo.getEnrollSource() != null && preEntryInfo.getEnrollSource().getNumber() != null) {
				VariationReasonCollection vrColl = VariationReasonFactory.getRemoteInstance()
						.getVariationReasonCollection("select id,name,number where number='"
								+ preEntryInfo.getEnrollSource().getNumber() + "'");
				if (vrColl.size() > 0) {
					preEntryInfo.put("enrollSource", vrColl.get(0));
				}
			}

			try {
				this.assemblePreEntryEnrollAgainInfo(preEntryInfo.getTalent(), preEntryInfo.getHrOrgUnit(), modelMap);
			} catch (EASBizException var16) {
				var16.printStackTrace();
				throw new ShrWebBizException(var16.getMessage(), var16);
			}

			if (preEntryInfo.getTalent() != null && preEntryInfo.getTalent().getPerson() != null
					&& preEntryInfo.getTalent().getPerson().getId() != null) {
				IPersonPhoto iPersonPhoto = PersonPhotoFactory.getRemoteInstance();
				PersonPhotoCollection phcoll = iPersonPhoto.getPersonPhotoCollection(
						"where person = '" + preEntryInfo.getTalent().getPerson().getId().toString() + "'");
				if (phcoll.size() > 0) {
					tempid = request.getParameter("tempId");
					PersonPhotoInfo personPhotoInfo = phcoll.get(0);
					PersonPhotoInfo addPhoto = new PersonPhotoInfo();
					PersonInfo pInfo = new PersonInfo();
					pInfo.setId(BOSUuid.read(tempid));
					addPhoto.setPerson(pInfo);
					addPhoto.setImageDataSource(personPhotoInfo.getImageDataSource());
					addPhoto.setImageData(personPhotoInfo.getImageData());
					addPhoto.setSourceImageHeight(personPhotoInfo.getSourceImageHeight());
					addPhoto.setSourceImageWidth(personPhotoInfo.getSourceImageWidth());
					addPhoto.setImageContentType(personPhotoInfo.getImageContentType());

					try {
						iPersonPhoto.addnew(addPhoto);
					} catch (EASBizException var15) {
						var15.printStackTrace();
						throw new ShrWebBizException(var15.getMessage(), var15);
					}
				}
			}
		}

		AdminOrgUnitInfo adminOrg = preEntryInfo.getAdminOrg();
		HROrgUnitInfo hrOrgUnit = preEntryInfo.getHrOrgUnit();
		tempid = request.getParameter("uipk");
		if (!"com.kingdee.eas.hr.affair.app.team.EmpEnrollBizBill.form".equals(tempid)) {
			this.checkAdminOrgUnitDataPermission(request, adminOrg.getId().toString());
		}

		this.checkHROrgUnitDataPermission(request, hrOrgUnit.getId().toString());
		modelMap.put("preEntryInfo", preEntryInfo);
		JSONUtils.writeJson(response, modelMap);
	}
	
	
	private void assemblePreEntryEnrollAgainInfo(PreEntryPersonInfo preEntryPerson, HROrgUnitInfo hrOrg,
			ModelMap modelMap) throws BOSException, EASBizException {
		if (preEntryPerson != null) {
			EntityViewInfo viewInfo = new EntityViewInfo();
			FilterInfo filter = new FilterInfo();
			if (!StringUtils.isEmpty(preEntryPerson.getPassportNO())) {
				filter.getFilterItems().add(new FilterItemInfo("passportNo", preEntryPerson.getPassportNO()));
			}

			if (!StringUtils.isEmpty(preEntryPerson.getIdCardNO())) {
				String maskStr = "#0 or #1";
				if (filter.getFilterItems().size() > 0) {
					maskStr = "#0 or #1 or #2";
				}

				filter.getFilterItems().add(new FilterItemInfo("idCardNO", preEntryPerson.getIdCardNO().toUpperCase()));
				filter.getFilterItems().add(new FilterItemInfo("idCardNO", preEntryPerson.getIdCardNO()));
				filter.setMaskString(maskStr);
			}

			if (filter.getFilterItems().size() > 0) {
				viewInfo.setFilter(filter);
				SelectorItemCollection selector = new SelectorItemCollection();
				selector.add(new SelectorItemInfo("id"));
				selector.add(new SelectorItemInfo("number"));
				selector.add(new SelectorItemInfo("employeeType.id"));
				selector.add(new SelectorItemInfo("employeeType.isInCount"));
				viewInfo.setSelector(selector);
				PersonCollection pColl = PersonFactory.getRemoteInstance().getPersonCollection(viewInfo);
				if (pColl.size() > 0) {
					PersonInfo pInfo = pColl.get(0);
					if (!pInfo.getEmployeeType().isIsInCount()) {
						String personId = pInfo.getId().toString();
						Context ctx = SHRContext.getInstance().getContext();
						EmpPosOrgRelationInfo empPosOrgInfo = SHREmpOptEmpOrgRelationTool
								.getCurrntMainEmpOrgRelationInfo(ctx, personId);
						if (empPosOrgInfo == null) {
							modelMap.put("errorMsg", (new EmpPosOrgRelationException(
									EmpPosOrgRelationException.PERSON_NO_EMPPOSRELATION_ENROLL)).getMessage());
						} else {
							HRBizDefineInfo actionInfo = empPosOrgInfo.getAction();
							if (this.judgeActionCanEnrollAgain(actionInfo)) {
								Map<String, Object> personOldInfo = this.fillPersonBaseInfoData(ctx, preEntryPerson,
										pInfo, empPosOrgInfo, hrOrg);
								modelMap.put("personOldInfo", personOldInfo);
								modelMap.put("personExist", "true");
							}
						}
					}
				}
			}

		}
	}
	
	
	
	private boolean judgeActionCanEnrollAgain(HRBizDefineInfo actionInfo) {
		return !HRBizDefineTypeEnum.ENROLL.equals(actionInfo.getBizDefineType())
				&& !HRBizDefineTypeEnum.ENROLLAGAIN.equals(actionInfo.getBizDefineType())
				&& !HRBizDefineTypeEnum.EMPHIRE.equals(actionInfo.getBizDefineType())
				&& !HRBizDefineTypeEnum.FLUCTUACTION.equals(actionInfo.getBizDefineType())
				&& !HRBizDefineTypeEnum.REINVITE.equals(actionInfo.getBizDefineType());
	}
	
	
	private Map<String, Object> fillPersonBaseInfoData(Context ctx, PreEntryPersonInfo preEntryPerson,
			PersonInfo personInfo, EmpPosOrgRelationInfo empPosOrgInfo, HROrgUnitInfo hrOrg)
			throws BOSException, EASBizException {
		Map<String, Object> personOldInfo = new HashMap();
		personOldInfo.put("empId", personInfo.getId().toString());
		personOldInfo.put("empNumber", personInfo.getNumber());
		personOldInfo.put("oldEmpType", personInfo.getEmployeeType().getId().toString());
		EnrollAgainCodingEnum codingEnum = EnrollAgainCodingEnum.getEnum(Integer.parseInt((String) HRParamUtil
				.getParamByKey(ctx, hrOrg == null ? null : hrOrg.getId().toString(), "ENROLL_AGAIN_CODING_RULE")));
		personOldInfo.put("useOldNumber", codingEnum.getValue());
		if (empPosOrgInfo != null) {
			personOldInfo.put("oldPersonDepId", empPosOrgInfo.getAdminOrg().getId().toString());
			personOldInfo.put("oldPersonPosId", empPosOrgInfo.getPosition().getId().toString());
		}

		IPersonOtherInfo iPersonOtherInfo = PersonOtherInfoFactory.getLocalInstance(ctx);
		PersonOtherInfoCollection personOtherInfoCollection = iPersonOtherInfo
				.getPersonOtherInfoCollection("where person = '" + personInfo.getId().toString() + "'");
		if (personOtherInfoCollection.size() > 0) {
			personOldInfo.put("jobStartDate", personOtherInfoCollection.get(0).getJobStartDate());
		}

		String msg = SHRWebResource.getString("com.kingdee.eas.hr.affair.EnrollResource", "personEnrollAgainNumber");
		if (hrOrg != null) {
			Object[] params;
			if (hrOrg != null && EnrollAgainCodingEnum.USE_NEW_NUMBER.equals(codingEnum)) {
				params = new Object[]{personInfo.getNumber(), preEntryPerson.getName(), hrOrg.getName(),
						EnrollAgainCodingEnum.USE_NEW_NUMBER.getAlias()};
				msg = MessageFormat.format(msg, params);
			} else {
				params = new Object[]{personInfo.getNumber(), preEntryPerson.getName(), hrOrg.getName(),
						EnrollAgainCodingEnum.USE_OLD_NUMBER.getAlias()};
				msg = MessageFormat.format(msg, params);
			}

			personOldInfo.put("personNumberMsg", msg);
		}

		return personOldInfo;
	}
	//******************************************重新getPreEntryInitDataAction方法****************************20250504********完毕
	
	
}
