⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createjobresumehtml.java

📁 java阿里巴巴代码
💻 JAVA
字号:
package com.buildhtml;

import java.util.ArrayList;
import java.util.HashMap;

import tools.util.FileIO;
import tools.util.StrReplace;

import com.saas.biz.AreaInfoMgr.AreaInfo;
import com.saas.biz.JobMgr.JobInfo;
import com.saas.biz.commen.ParamethodMgr;
import com.saas.biz.newsMgr.NewsInfo;
import com.saas.biz.ordercastMgr.OrderCast;
import com.saas.biz.resumeMgr.ResumeInfo;
import com.saas.biz.sortMgr.ClassInfoBuild;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;

/**
 * @author:LiuYang
 * @desc:生成人才库首页
 * @2008-7-8
 */
public class CreateJobResumeHtml {
	
	
	FileAndString FileString = new FileAndString();
	
	
	ClassInfoBuild classBuild = new ClassInfoBuild();
	
	
	Logger log = new Logger(this);
	
	
	
	
	/**
	 * 生成人才库首页
	 * 
	 * @param rootpath
	 * @throws SaasApplicationException
	 */
	
	public void buildIndex(String rootpath) throws SaasApplicationException {

		String str = "";
		String filepath = rootpath + "/" + "/talents/index.html";
		String templatePath = rootpath + "/" + "templates/hr.html";
		String templateStr = FileIO.LoadFile(templatePath);
		log.LOG_INFO("filepath" + filepath);
		log.LOG_INFO("templatePath" + templatePath);
		String[] tab = { "{#include-top#}", "{#include-bottom#}", "{#list-12-tr-td#}", "{#job-news:7#}", "{#resume-user-16#}", "{#new-resume-a:22#}", "{#new-resume-b:22#}", "{#new-resume-a:25#}", "{#new-resume-b:25#}" };
		str = StrReplace.replace(templateStr, tab[0], FileString.f2s(rootpath + "/top.html"));
		str = StrReplace.replace(str, tab[1], FileString.f2s(rootpath + "/footer.html"));
		// 推荐招聘
		String recJob = getRecommendJobString(12);
		str = StrReplace.replace(str, tab[2], recJob);
		log.LOG_INFO("推荐招聘");
		// 就业指导
		String jobGuide = getJobGuide(0, 7);
		str = StrReplace.replace(str, tab[3], jobGuide);
		log.LOG_INFO("就业指导");
		// 推荐人才
		String recResume = getRecommendResume(0, 16);
		str = StrReplace.replace(str, tab[4], recResume);
		log.LOG_INFO("推荐人才");
		// 最新招聘a
		String newJob_a = getNewJobInfo(1, 16);
		str = StrReplace.replace(str, tab[5], newJob_a);
		log.LOG_INFO("最新招聘a");
		// 最新招聘b
		String newJob_b = getNewJobInfo(2, 16);
		str = StrReplace.replace(str, tab[6], newJob_b);
		log.LOG_INFO("最新招聘b");
		// 最新人才a
		String newResume_a = getNesResumeInfo(1, 25);
		str = StrReplace.replace(str, tab[7], newResume_a);
		log.LOG_INFO(" 最新人才a");
		// 最新人才b
		String newResume_b = getNesResumeInfo(2, 25);
		str = StrReplace.replace(str, tab[8], newResume_b);
		log.LOG_INFO(" 最新人才b");
		//省分信息
		String province=getProvinceInfo();
		str = StrReplace.replace(str, "{#provice-1#}", province);
		//工作类型
		String jobInof=getJobTypeInfo();
		str = StrReplace.replace(str, "{#job-type#}", jobInof);
		
		FileIO.SaveToFile(str, filepath);
	}
	

	//替换省份信息
	
	public String getProvinceInfo()throws SaasApplicationException{
		String province="";
		AreaInfo area=new AreaInfo();
		province=area.getCountrySelect("5J2mc0X0G85BH");
		return province;
	}
	
	//替换职业
	
	public String getJobTypeInfo()throws SaasApplicationException{
		String job_info="";
		ParamethodMgr param=new ParamethodMgr();
		job_info=param.getSelectItems("17");
		return job_info;
	}
	
	/**
	 * 取出推荐招聘
	 */
	public String getRecommendJobString(int limit) throws SaasApplicationException {

		String source = "";
		String resource = "<tr><td valign=\"top\">" + "<a href=/zone_b2b/enterprise/customer/{#cust-id#}/ class=lanse target=_blank>{#cust-name#}</a>" + "<br> 招聘 : <a href=/zone_b2b/job/jobinfo.jsp?talents=1&cust_id={#job-id#} target=_blank>{#job-title#}</a>" + "</td>" + "</tr>";
		OrderCast order = new OrderCast();
		ArrayList list = order.getRecommendJob(0, limit);
		if (list != null && list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				HashMap map = (HashMap) list.get(i);
				String job_id = "", title = "", cust_name = "", cust_id = "";
				if (map.get("job_id") != null) {
					job_id = map.get("job_id").toString();
				}
				if (map.get("title") != null) {
					title = map.get("title").toString();
				}
				if (map.get("cust_name") != null) {
					cust_name = map.get("cust_name").toString();
				}
				if (map.get("job_unit") != null) {
					cust_id = map.get("job_unit").toString();
				}
				source = source + StrReplace.replace(resource, "{#cust-id#}", cust_id);
				source = StrReplace.replace(source, "{#cust-name#}", cust_name);
				source = StrReplace.replace(source, "{#job-title#}", title);
				source = StrReplace.replace(source, "{#job-id#}", cust_id);
			}
		}
		return source;
	}
	
	
	
	/**
	 * 取出就业指导信息
	 */
	public String getJobGuide(int iStart, int limit) throws SaasApplicationException {

		String source = "";
		String resource = "<tr>" + "<td>" + "<a href=/zone_b2b/news/zixun_list_content.jsp?news_id={#news-id#} target=_blank>{#news-title#}</a>" + "</td>" + "</tr>";
		String news_type = "42wE3JLp88FsjBT";
		NewsInfo info = new NewsInfo();
		ArrayList list = info.getNewsByType(iStart, limit, news_type);
		if (list != null && list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				HashMap map = (HashMap) list.get(i);
				String news_id = "", title = "";
				if (map.get("news_id") != null) {
					news_id = map.get("news_id").toString();
				}
				if (map.get("title") != null) {
					title = map.get("title").toString();
					if(title.length()>20){
						title=title.substring(0,18)+"...";
					}
				}
				source = source + StrReplace.replace(resource, "{#news-id#}", news_id);
				source = StrReplace.replace(source, "{#news-title#}", title);
			}
		}
		return source;
	}
	
	
	
	/**
	 * 取出推荐人才
	 */
	public String getRecommendResume(int iStart, int limit) throws SaasApplicationException {

		String source = "";
		String resource = "<tr>" + "<td width=64 height=25 class=rencei_table_xian>" + "<a href=/zone_b2b/resume/resume_content.jsp?resume_id={#user-id#}><img src=/zone_b2b/images/d_tb.gif width=5 height=9>{#user-name#}</a>" + "</td>" + "<td width=47 class=rencei_table_xian>" + "{#sex#}" + "</td>" + "<td width=42 class=rencei_table_xian>" + "{#age#}" + "</td>" + "<td width=42 class=rencei_table_xian>" + "<span class=lanse_renceitop>{#degree#}</span>" + "</td>" + "<td width=53 class=rencei_table_xian>" + "<span class=zi>{#posit#}</span>" + "</td>" + "</tr>";
		OrderCast order = new OrderCast();
		ArrayList list = order.getRecommendResume(iStart, limit);
		ParamethodMgr param = new ParamethodMgr();
		if (list != null && list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				HashMap map = (HashMap) list.get(i);
				String resume_id = "", name = "", remark = "", age = "", degree = "", profession = "";
				if (map.get("resume_id") != null) {
					resume_id = map.get("resume_id").toString();
				}
				if (map.get("name") != null) {
					name = map.get("name").toString();
				}
				if (map.get("remark") != null) {
					remark = map.get("remark").toString();
					if (remark == "0" || remark.equals("0")) {
						remark = "男";
					}
					else {
						remark = "女";
					}
				}
				if (map.get("age") != null) {
					age = map.get("age").toString();
				}
				if (map.get("profession") != null) {
					profession = map.get("profession").toString();
				}
				if (map.get("degree") != null) {
					degree = map.get("degree").toString();
					degree = param.getParamNameByValue("39", degree);
				}
				source = source + StrReplace.replace(resource, "{#user-id#}", resume_id);
				source = StrReplace.replace(source, "{#user-name#}", name);
				source = StrReplace.replace(source, "{#sex#}", remark);
				source = StrReplace.replace(source, "{#age#}", age);
				source = StrReplace.replace(source, "{#degree#}", degree);
				source = StrReplace.replace(source, "{#posit#}", profession);
			}
		}
		return source;
	}
	
	
	
	/**
	 * 最新招聘
	 */
	public String getNewJobInfo(int iStart, int limit) throws SaasApplicationException {

		String source = "";
		String resource = "<tr>" + "<td height=25 class=rencei_table_xian>" + "<a href=/zone_b2b/enterprise/customer/{#cust-id#}/>{#cust-name#}</a>" + "</td>" + "<td class=rencei_table_xian>" + "	<span class=zi>招聘:</spen>" + "</td>" + "<td class=rencei_table_xian>" + "<span class=lanse_renceitop><a href=/zone_b2b/job/jobinfo.jsp?cust_id={#job-id#} target=_blank>{#job-title#}</a></span>" + "</td>" + "</tr>";
		JobInfo job = new JobInfo();
		ArrayList list = job.genLatestJobList(iStart, limit);
		if (list != null && list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				HashMap map = (HashMap) list.get(i);
				String job_id = "", title = "", cust_name = "", cust_id = "";
				if (map.get("job_id") != null) {
					job_id = map.get("job_id").toString();
				}
				if (map.get("title") != null) {
					title = map.get("title").toString();
				}
				if (map.get("cust_name") != null) {
					cust_name = map.get("cust_name").toString();
				}
				if (map.get("job_unit") != null) {
					cust_id = map.get("job_unit").toString();
				}
				source = source + StrReplace.replace(resource, "{#cust-id#}", cust_id);
				source = StrReplace.replace(source, "{#cust-name#}", cust_name);
				source = StrReplace.replace(source, "{#job-title#}", title);
				source = StrReplace.replace(source, "{#job-id#}", cust_id);
			}
		}
		return source;
	}
	
	
	
	/**
	 * 最新人才
	 */
	public String getNesResumeInfo(int iStart, int limit) throws SaasApplicationException {

		String source = "";
		String resource = "<tr>" +"<td width=20% class=rencei_table_xian style=font-weight: bold;>" + "<a href=/zone_b2b/resume/resume_content.jsp?resume_id={#user-id#}>{#user-name#}</a>" + "</td>"  + "<td width=50%  height=25 class=rencei_table_xian>" + "{#grade-form#}" + "</td>" + "<td width=30% class=rencei_table_xian>" + "	<span class=lanse_renceitop>{#posit#}</span>" + "</td>" + "</tr>";
		ResumeInfo resume = new ResumeInfo();
		ArrayList list = resume.getNewResumeByList(iStart, limit);
		if (list != null && list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				HashMap map = (HashMap) list.get(i);
				String resume_id = "", name = "", profession = "", grade_from = "";
				if (map.get("resume_id") != null) {
					resume_id = map.get("resume_id").toString();
				}
				if (map.get("name") != null) {
					name = map.get("name").toString();
				}
				if (map.get("profession") != null) {
					profession = map.get("profession").toString();
				}
				if (map.get("grad_from") != null) {
					grade_from = map.get("grad_from").toString();
				}
				source = source + StrReplace.replace(resource, "{#grade-form#}", grade_from);
				source = StrReplace.replace(source, "{#user-id#}", resume_id);
				source = StrReplace.replace(source, "{#user-name#}", name);
				source = StrReplace.replace(source, "{#posit#}", profession);
			}
		}
		return source;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -