当前位置:网站首页>Design and Realization of Employment Management System in Colleges and Universities

Design and Realization of Employment Management System in Colleges and Universities

2022-08-10 23:49:00 qq_469603589

一,项目简介

在如今社会上,About the above information processing,No enterprise or individual will ignore,How to make the information fast transfer,File and stored query,Using the model of paper records before already do not conform to the requirements of the currently used.所以,Employment information management in colleges and universities improve,Also in order to for better maintenance of university employment information,The emergence of university employment management system becomes autopilot are indispensable.Through the development of university employment management system,Not only can put this to use,Make knowledge results in,Also to strengthen the knowledge memory,To expand the knowledge reserve,Is a good way to improve yourself.Through the development of specific,For the entire software development process of master,不论是前期的设计,Or subsequent coding test,Has a very in-depth understanding of.

The university employment management system through theMySQL数据库与Eclipse工具进行开发,University employment management system can realize the recruitment information management,简历管理,邀请面试管理,简历投递管理,用户管理,The company management, etc.

Through the university employment management system for the processing of information,Make information processing more system,更加的规范,这是一个必然的结果.Already processed good information,Whether it is used to find,还是分析,On the efficiency will be multiplied improve,Let the computer become more in line with the production needs,Become people indispensable to an information processing tool,To realize the green office,Save social resources,To make its contribution for environmental protection.

二,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

后台开发技术:Springboot+SSM框架

前台开发技术:Bootstrap+Jquery+Ajax

三,系统展示

3.1Backstage function design in detail

3.3.1 公司管理

The administrator to enter as shown in figure4-1As shown in the company management interface,Administrator click at the right column information display, the change,删除,Reset password button to complete your company information in turn modify,删除,密码重置等操作,The administrator can query in the current interface company information,Add your company information, etc.

图3-1 Company management interface

The core of company management code is as follows:

表3-1 Company management paging query

/**
*
后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
    logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
    String role = String.valueOf(request.getSession().getAttribute("role"));
    if(StringUtil.isEmpty(role))
        return R.error(511,"权限为空");
    else if("用户".equals(role))
        params.put("yonghuId",request.getSession().getAttribute("userId"));
    else if("公司".equals(role))
        params.put("gongsiId",request.getSession().getAttribute("userId"));
    params.put("gongsiDeleteStart",1);params.put("gongsiDeleteEnd",1);
    if(params.get("orderBy")==null || params.get("orderBy")==""){
        params.put("orderBy","id");
    }
    PageUtils page = gongsiService.queryPage(params);

    //A dictionary table data conversion
    List<GongsiView> list =(List<GongsiView>)page.getList();
    for(GongsiView c:list){
        //Modify the corresponding dictionary table field
        dictionaryService.dictionaryConvert(c, request);
    }
    return R.ok().put("data", page);
}

3.3.2 用户管理

The administrator to enter as shown in figure4-2As shown in the user management interface,Administrator click at the right column information display, the change,The delete button to complete the user information in turn modify,删除等操作,The administrator in the current interface can be added to the user,查询用户.

图3-2 用户管理界面

用户管理模块的核心代码如下:

表3-2 User management paging query


@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
    logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
    String role = String.valueOf(request.getSession().getAttribute("role"));
    if(StringUtil.isEmpty(role))
        return R.error(511,"权限为空");
    else if("用户".equals(role))
        params.put("yonghuId",request.getSession().getAttribute("userId"));
    else if("公司".equals(role))
        params.put("gongsiId",request.getSession().getAttribute("userId"));
    if(params.get("orderBy")==null || params.get("orderBy")==""){
        params.put("orderBy","id");
    }
    PageUtils page = yonghuService.queryPage(params);

    //A dictionary table data conversion
    List<YonghuView> list =(List<YonghuView>)page.getList();
    for(YonghuView c:list){
        //Modify the corresponding dictionary table field
        dictionaryService.dictionaryConvert(c, request);
    }
    return R.ok().put("data", page);
}

3.3.3 Departments type management

The administrator to enter as shown in figure4-3As shown in the faculty type management interface, etc.The administrator to check the faculty type information,The faculty type information query,更改,删除等.

图3-3 Departments type management interface

Departments type management and job functions implementation logic are basically similar,Here show departments type management of the core code as a representative of the foundation of business data management.

表3-3 Departments type management code

/**
*
后端列表
*/
@RequestMapping("/page")
@IgnoreAuth
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
    logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
    if(params.get("orderBy")==null || params.get("orderBy")==""){
        params.put("orderBy","id");
    }
    PageUtils page = dictionaryService.queryPage(params);

    //A dictionary table data conversion
    List<DictionaryView> list =(List<DictionaryView>)page.getList();
    for(DictionaryView c:list){
        //Modify the corresponding dictionary table field
        dictionaryService.dictionaryConvert(c, request);
    }
    return R.ok().put("data", page);
}

3.3.4 招聘岗位管理

The administrator to enter as shown in figure4-4After hiring management interface shown in,Administrator click at the right column information display, the change,Delete button it can be finished in hiring information modify,删除操作,The administrator in this interface can also query for the hiring information,Add hiring information, etc.

图3-4 Hiring management interface

3.3.5 招聘信息管理

Companies enter as shown in figure4-5The recruitment information management interface shown in,Click on the company information display column in the modification on the right side of the,删除,下架,Shelf button to complete the recruitment information in turn modify,删除,下架,上架等操作.Recruitment information including contact,招聘岗位,招聘人数,The information such as salary.

图3-5 Recruitment information management interface

3.3.6 CV to see

Companies enter as shown in figure4-6The CV to view the interface shown in,Company information and click the show details button on the right side of the bar on a resume information online to view.

图3-6 CV to view the interface

A resume to check the function of the core code is as follows:

表3-4 CV to see management code


@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
    logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
    String role = String.valueOf(request.getSession().getAttribute("role"));
    if(StringUtil.isEmpty(role))
        return R.error(511,"权限为空");
    else if("用户".equals(role))
        params.put("yonghuId",request.getSession().getAttribute("userId"));
    else if("公司".equals(role))
        params.put("gongsiId",request.getSession().getAttribute("userId"));
    if(params.get("orderBy")==null || params.get("orderBy")==""){
        params.put("orderBy","id");
    }
    PageUtils page = jianliService.queryPage(params);

    //A dictionary table data conversion
    List<JianliView> list =(List<JianliView>)page.getList();
    for(JianliView c:list){
        //Modify the corresponding dictionary table field
        dictionaryService.dictionaryConvert(c, request);
    }
    return R.ok().put("data", page);
}

四,核心代码展示

package com.controller;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;

import javax.servlet.http.HttpServletRequest;

import com.alibaba.fastjson.JSON;
import com.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;

/**
 * 通用接口
 */
@RestController
public class CommonController{
	private static final Logger logger = LoggerFactory.getLogger(CommonController.class);
	@Autowired
	private CommonService commonService;
	
	@Autowired
	private ConfigService configService;
	
	private static AipFace client = null;
	
	private static String BAIDU_DITU_AK = null;
	
	@RequestMapping("/location")
	public R location(String lng,String lat) {
		if(BAIDU_DITU_AK==null) {
			BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();
			if(BAIDU_DITU_AK==null) {
				return R.error("请在配置管理中正确配置baidu_ditu_ak");
			}
		}
		Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
		return R.ok().put("data", map);
	}
	
	/**
	 * 人脸比对
	 * 
	 * @param face1 人脸1
	 * @param face2 人脸2
	 * @return
	 */
	@RequestMapping("/matchFace")
	public R matchFace(String face1, String face2, HttpServletRequest request) {
		if(client==null) {
			/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
			String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
			String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
			String token = BaiduUtil.getAuth(APIKey, SecretKey);
			if(token==null) {
				return R.error("请在配置管理中正确配置APIKey和SecretKey");
			}
			client = new AipFace(null, APIKey, SecretKey);
			client.setConnectionTimeoutInMillis(2000);
			client.setSocketTimeoutInMillis(60000);
		}
		JSONObject res = null;
		try {
			File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);
			File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);
			String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
			String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
			MatchRequest req1 = new MatchRequest(img1, "BASE64");
			MatchRequest req2 = new MatchRequest(img2, "BASE64");
			ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
			requests.add(req1);
			requests.add(req2);
			res = client.match(requests);
			System.out.println(res.get("result"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return R.error("文件不存在");
		} catch (IOException e) {
			e.printStackTrace();
		} 
		return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
	}
    
	/**
	 * 获取table表中的column列表(联动接口)
	 * @return
	 */
	@RequestMapping("/option/{tableName}/{columnName}")
	@IgnoreAuth
	public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		if(StringUtils.isNotBlank(level)) {
			params.put("level", level);
		}
		if(StringUtils.isNotBlank(parent)) {
			params.put("parent", parent);
		}
		List<String> data = commonService.getOption(params);
		return R.ok().put("data", data);
	}
	
	/**
	 * 根据table中的column获取单条记录
	 * @return
	 */
	@RequestMapping("/follow/{tableName}/{columnName}")
	@IgnoreAuth
	public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		params.put("columnValue", columnValue);
		Map<String, Object> result = commonService.getFollowByOption(params);
		return R.ok().put("data", result);
	}
	
	/**
	 * 修改table表的sfsh状态
	 * @param map
	 * @return
	 */
	@RequestMapping("/sh/{tableName}")
	public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
		map.put("table", tableName);
		commonService.sh(map);
		return R.ok();
	}
	
	/**
	 * 获取需要提醒的记录数
	 * @param tableName
	 * @param columnName
	 * @param type 1:数字 2:日期
	 * @param map
	 * @return
	 */
	@RequestMapping("/remind/{tableName}/{columnName}/{type}")
	@IgnoreAuth
	public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("table", tableName);
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		int count = commonService.remindCount(map);
		return R.ok().put("count", count);
	}

	/**
	 * The chart statistics
	 */
	@IgnoreAuth
	@RequestMapping("/group/{tableName}")
	public R group1(@PathVariable("tableName") String tableName, @RequestParam Map<String,Object> params) {
		params.put("table1", tableName);
		List<Map<String, Object>> result = commonService.chartBoth(params);
		return R.ok().put("data", result);
	}

	
	/**
	 * 单列求和
	 */
	@RequestMapping("/cal/{tableName}/{columnName}")
	@IgnoreAuth
	public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		Map<String, Object> result = commonService.selectCal(params);
		return R.ok().put("data", result);
	}
	
	/**
	 * 分组统计
	 */
	@RequestMapping("/group/{tableName}/{columnName}")
	@IgnoreAuth
	public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		List<Map<String, Object>> result = commonService.selectGroup(params);
		return R.ok().put("data", result);
	}
	
	/**
	 * (按值统计)
	 */
	@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
	@IgnoreAuth
	public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("xColumn", xColumnName);
		params.put("yColumn", yColumnName);
		List<Map<String, Object>> result = commonService.selectValue(params);
		return R.ok().put("data", result);
	}


	/**
	 * The following is new
	 *
	 *
	 *
	 */

	/**
	 * Query the dictionary table group sum
	 * tableName  		表名
	 * groupColumn  		分组字段
	 * sumCloum			统计字段
	 * @return
	 */
	@RequestMapping("/newSelectGroupSum")
	public R newSelectGroupSum(@RequestParam Map<String,Object> params) {
		logger.debug("newSelectGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
		List<Map<String, Object>> result = commonService.newSelectGroupSum(params);
		return R.ok().put("data", result);
	}

	/**
	 * Query the dictionary table grouping statistics to the total number of article
	 *  tableName  		表名
	 *	groupColumn  	分组字段
	 * @return
	 */
	@RequestMapping("/newSelectGroupCount")
	public R newSelectGroupCount(@RequestParam Map<String,Object> params) {
		logger.debug("newSelectGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);
		List<Map<String, Object>> result = commonService.newSelectGroupCount(params);
		return R.ok().put("data", result);
	}


	/**
	 * The date of the current table grouping sum
	 * tableName  		表名
	 * groupColumn  		分组字段
	 * sumCloum			统计字段
	 * dateFormatType	Date format type   1:年 2:月 3:日
	 * @return
	 */
	@RequestMapping("/newSelectDateGroupSum")
	public R newSelectDateGroupSum(@RequestParam Map<String,Object> params) {
		logger.debug("newSelectDateGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
		String dateFormatType = String.valueOf(params.get("dateFormatType"));
		if("1".equals(dateFormatType)){
			params.put("dateFormat", "%Y");
		}else if("2".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m");
		}else if("3".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m-%d");
		}else{
			R.error("Date format is not correct");
		}
		List<Map<String, Object>> result = commonService.newSelectDateGroupSum(params);
		return R.ok().put("data", result);
	}

	/**
	 *
	 * Query the dictionary table grouping statistics to the total number of article
	 * tableName  		表名
	 * groupColumn  		分组字段
	 * dateFormatType	Date format type   1:年 2:月 3:日
	 * @return
	 */
	@RequestMapping("/newSelectDateGroupCount")
	public R newSelectDateGroupCount(@RequestParam Map<String,Object> params) {
		logger.debug("newSelectDateGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);
		String dateFormatType = String.valueOf(params.get("dateFormatType"));
		if("1".equals(dateFormatType)){
			params.put("dateFormat", "%Y");
		}else if("2".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m");
		}else if("3".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m-%d");
		}else{
			R.error("Date format type is not correct");
		}
		List<Map<String, Object>> result = commonService.newSelectDateGroupCount(params);
		return R.ok().put("data", result);
	}
/**
 * 饼状图
 * -- 饼状图  查询当前表
 -- 				查询字典表【月】
 -- 				 统计   -- Query the number of each type of order sales a month
 -- 				 求和   -- Query a month for each of the types of sales order
 -- 				查询某个字符串【月】
 -- 				 统计   -- Query each employee a month order sales quantity
 -- 				 求和   -- Query each employee a month sales orders
 -- 				查询时间【年】
 -- 				 统计 	-- Query order sales quantity every month
 -- 				 求和 	-- Query order sales each month
 -- 饼状图  Query cascade table
 -- 				查询字典表
 -- 				 统计  	-- Query the number of each type of order sales a month
 -- 				 求和   -- Query a month for each of the types of sales order
 -- 				查询某个字符串
 -- 				 统计   -- Query each employee a month order sales quantity
 -- 				 求和   -- Query each employee a month sales orders
 -- 				查询时间
 -- 				 统计 	-- Statistical order sales quantity every month
 -- 				 求和 	-- Query order sales each month
 */


/**
 * 柱状图
 -- 柱状图  查询当前表
 --             某个【年,月】
 -- 			 当前表 2 级联表 1
 -- 						统计
 --   						【日期,字符串,下拉框】
 -- 						求和
 --   						【日期,字符串,下拉框】
 -- 柱状图  Query cascade table
 -- 					某个【年,月】
 -- 						统计
 --   						【日期,字符串,下拉框】
 -- 						求和
 --   						【日期,字符串,下拉框】
 */

    /**
     * Histogram summing
     */
    @RequestMapping("/barSum")
    public R barSum(@RequestParam Map<String,Object> params) {
        logger.debug("barSum方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));
        Boolean isJoinTableFlag =  false;//Is there a cascade table related
        String one =  "";//第一优先
        String two =  "";//第二优先

		//处理thisTable和joinTable Processing content is putjson字符串转为Map并把带有,For the cutting of the array
			//当前表
			Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);
			params.put("thisTable",thisTable);

			//级联表
			String joinTableString = String.valueOf(params.get("joinTable"));
			if(StringUtil.isNotEmpty(joinTableString)) {
				Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);
				params.put("joinTable", joinTable);
				isJoinTableFlag = true;
			}

		if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//The current table date
			thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));
			one = "thisDate0";
		}
		if(isJoinTableFlag){//Cascade table date
			Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
			if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){
				joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));
				if(StringUtil.isEmpty(one)){
					one ="joinDate0";
				}else{
					if(StringUtil.isEmpty(two)){
						two ="joinDate0";
					}
				}
			}
		}
		if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//The current table string
			thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));
			if(StringUtil.isEmpty(one)){
				one ="thisString0";
			}else{
				if(StringUtil.isEmpty(two)){
					two ="thisString0";
				}
			}
		}
		if(isJoinTableFlag){//Cascade table string
			Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
			if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){
				joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));
				if(StringUtil.isEmpty(one)){
					one ="joinString0";
				}else{
					if(StringUtil.isEmpty(two)){
						two ="joinString0";
					}
				}
			}
		}
		if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//The current table type
			thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));
			if(StringUtil.isEmpty(one)){
				one ="thisTypes0";
			}else{
				if(StringUtil.isEmpty(two)){
					two ="thisTypes0";
				}
			}
		}
		if(isJoinTableFlag){//Cascade table type
			Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
			if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){
				joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));
				if(StringUtil.isEmpty(one)){
					one ="joinTypes0";
				}else{
					if(StringUtil.isEmpty(two)){
						two ="joinTypes0";
					}
				}

			}
		}

		List<Map<String, Object>> result = commonService.barSum(params);

		List<String> xAxis = new ArrayList<>();//报表x轴
		List<List<String>> yAxis = new ArrayList<>();//y轴
		List<String> legend = new ArrayList<>();//标题

		if(StringUtil.isEmpty(two)){//Does not contain the second column
			List<String> yAxis0 = new ArrayList<>();
			yAxis.add(yAxis0);
			legend.add("数值");
			for(Map<String, Object> map :result){
				String oneValue = String.valueOf(map.get(one));
				String value = String.valueOf(map.get("value"));
				xAxis.add(oneValue);
				yAxis0.add(value);
			}
		}else{//Contains the second column
			Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();
			if(StringUtil.isNotEmpty(two)){
				for(Map<String, Object> map :result){
					String oneValue = String.valueOf(map.get(one));
					String twoValue = String.valueOf(map.get(two));
					String value = String.valueOf(map.get("value"));
					if(!legend.contains(twoValue)){
						legend.add(twoValue);//添加完成后 Type of the second column is the most comprehensive
					}
					if(dataMap.containsKey(oneValue)){
						dataMap.get(oneValue).put(twoValue,value);
					}else{
						HashMap<String, String> oneData = new HashMap<>();
						oneData.put(twoValue,value);
						dataMap.put(oneValue,oneData);
					}

				}
			}

			for(int i =0; i<legend.size(); i++){
				yAxis.add(new ArrayList<String>());
			}

			Set<String> keys = dataMap.keySet();
			for(String key:keys){
				xAxis.add(key);
				HashMap<String, String> map = dataMap.get(key);
				for(int i =0; i<legend.size(); i++){
					List<String> data = yAxis.get(i);
					if(StringUtil.isNotEmpty(map.get(legend.get(i)))){
						data.add(map.get(legend.get(i)));
					}else{
						data.add("0");
					}
				}
			}
			System.out.println();
		}

		Map<String, Object> resultMap = new HashMap<>();
		resultMap.put("xAxis",xAxis);
		resultMap.put("yAxis",yAxis);
		resultMap.put("legend",legend);
		return R.ok().put("data", resultMap);
    }
	
	/**
     * 柱状图统计
     */
    @RequestMapping("/barCount")
    public R barCount(@RequestParam Map<String,Object> params) {
        logger.debug("barCount方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));
        Boolean isJoinTableFlag =  false;//Is there a cascade table related
        String one =  "";//第一优先
        String two =  "";//第二优先

		//处理thisTable和joinTable Processing content is putjson字符串转为Map并把带有,For the cutting of the array
			//当前表
			Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);
			params.put("thisTable",thisTable);

			//级联表
			String joinTableString = String.valueOf(params.get("joinTable"));
			if(StringUtil.isNotEmpty(joinTableString)) {
				Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);
				params.put("joinTable", joinTable);
				isJoinTableFlag = true;
			}

		if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//The current table date
			thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));
			one = "thisDate0";
		}
		if(isJoinTableFlag){//Cascade table date
			Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
			if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){
				joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));
				if(StringUtil.isEmpty(one)){
					one ="joinDate0";
				}else{
					if(StringUtil.isEmpty(two)){
						two ="joinDate0";
					}
				}
			}
		}
		if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//The current table string
			thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));
			if(StringUtil.isEmpty(one)){
				one ="thisString0";
			}else{
				if(StringUtil.isEmpty(two)){
					two ="thisString0";
				}
			}
		}
		if(isJoinTableFlag){//Cascade table string
			Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
			if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){
				joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));
				if(StringUtil.isEmpty(one)){
					one ="joinString0";
				}else{
					if(StringUtil.isEmpty(two)){
						two ="joinString0";
					}
				}
			}
		}
		if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//The current table type
			thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));
			if(StringUtil.isEmpty(one)){
				one ="thisTypes0";
			}else{
				if(StringUtil.isEmpty(two)){
					two ="thisTypes0";
				}
			}
		}
		if(isJoinTableFlag){//Cascade table type
			Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
			if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){
				joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));
				if(StringUtil.isEmpty(one)){
					one ="joinTypes0";
				}else{
					if(StringUtil.isEmpty(two)){
						two ="joinTypes0";
					}
				}

			}
		}

		List<Map<String, Object>> result = commonService.barCount(params);

		List<String> xAxis = new ArrayList<>();//报表x轴
		List<List<String>> yAxis = new ArrayList<>();//y轴
		List<String> legend = new ArrayList<>();//标题

		if(StringUtil.isEmpty(two)){//Does not contain the second column
			List<String> yAxis0 = new ArrayList<>();
			yAxis.add(yAxis0);
			legend.add("数值");
			for(Map<String, Object> map :result){
				String oneValue = String.valueOf(map.get(one));
				String value = String.valueOf(map.get("value"));
				xAxis.add(oneValue);
				yAxis0.add(value);
			}
		}else{//Contains the second column
			Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();
			if(StringUtil.isNotEmpty(two)){
				for(Map<String, Object> map :result){
					String oneValue = String.valueOf(map.get(one));
					String twoValue = String.valueOf(map.get(two));
					String value = String.valueOf(map.get("value"));
					if(!legend.contains(twoValue)){
						legend.add(twoValue);//添加完成后 Type of the second column is the most comprehensive
					}
					if(dataMap.containsKey(oneValue)){
						dataMap.get(oneValue).put(twoValue,value);
					}else{
						HashMap<String, String> oneData = new HashMap<>();
						oneData.put(twoValue,value);
						dataMap.put(oneValue,oneData);
					}

				}
			}

			for(int i =0; i<legend.size(); i++){
				yAxis.add(new ArrayList<String>());
			}

			Set<String> keys = dataMap.keySet();
			for(String key:keys){
				xAxis.add(key);
				HashMap<String, String> map = dataMap.get(key);
				for(int i =0; i<legend.size(); i++){
					List<String> data = yAxis.get(i);
					if(StringUtil.isNotEmpty(map.get(legend.get(i)))){
						data.add(map.get(legend.get(i)));
					}else{
						data.add("0");
					}
				}
			}
			System.out.println();
		}

		Map<String, Object> resultMap = new HashMap<>();
		resultMap.put("xAxis",xAxis);
		resultMap.put("yAxis",yAxis);
		resultMap.put("legend",legend);
		return R.ok().put("data", resultMap);
    }
}

五,项目总结

The implementation of the whole university employment management system all around the business process to the employment of the college students to carry on the design,For college students employment,By the colleges and universities to build a platform,Docking campus students and outside the enterprise,The enterprise recruitment needs and each major students' demand for organic unifies in together,That solved the problem of the enterprise recruitment difficult,And solved the difficult problem of campus fresh graduates' employment.Enterprise can log on to the system for recruiting information release,Students resume view,Undertake to the student and try to invite, etc;Can students in the campus system resume,Refer to the enterprise information and recruitment information,And online resume, etc;As the school,Is a platform of managers,Can be found in the related enterprise information system platform in,招聘信息,学生信息,Resume information management.The whole system function structure is complete,Page is concise and easy operation,Business process is complete,The user experience with good school.

原网站

版权声明
本文为[qq_469603589]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208102322074039.html