|
|
@@ -0,0 +1,391 @@
|
|
|
+package com.jpsoft.employment.modules.mobile.controller;
|
|
|
+
|
|
|
+import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.modules.base.entity.Company;
|
|
|
+import com.jpsoft.employment.modules.base.service.CompanyService;
|
|
|
+import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
+import com.jpsoft.employment.modules.common.dto.MessageResultBuilder;
|
|
|
+import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
+import com.jpsoft.employment.modules.common.utils.MapUtils;
|
|
|
+import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
+import com.jpsoft.employment.modules.common.utils.StringUtils;
|
|
|
+import com.jpsoft.employment.modules.job.entity.*;
|
|
|
+import com.jpsoft.employment.modules.job.service.*;
|
|
|
+import com.jpsoft.employment.modules.manage.entity.JobFair;
|
|
|
+import com.jpsoft.employment.modules.manage.entity.JobFairCompany;
|
|
|
+import com.jpsoft.employment.modules.manage.entity.SeatManage;
|
|
|
+import com.jpsoft.employment.modules.manage.service.JobFairCompanyService;
|
|
|
+import com.jpsoft.employment.modules.manage.service.JobFairService;
|
|
|
+import com.jpsoft.employment.modules.manage.service.SeatManageService;
|
|
|
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/mobile/dataScreenApi")
|
|
|
+@Api(tags = "大屏接口")
|
|
|
+@Slf4j
|
|
|
+public class DataScreenApiController {
|
|
|
+ private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private JobFairService jobFairService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private JobFairCompanyService jobFairCompanyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CompanyService companyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RecruitmentService recruitmentService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SeatManageService seatManageService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WorkCategoryService workCategoryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResumeDeliverService resumeDeliverService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResumeService resumeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private JobUserService jobUserService;
|
|
|
+
|
|
|
+ @PostMapping("jobFairScreenData")
|
|
|
+ @ApiOperation(value = "招聘会大屏")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "jobFairId", value = "招聘会ID", required = true, paramType = "form")
|
|
|
+ })
|
|
|
+ public MessageResult<Map> jobFairScreenData( String jobFairId){
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
+ try{
|
|
|
+ if(StringUtils.isEmpty(jobFairId)){
|
|
|
+ throw new Exception("招聘会查询错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ JobFair jobFair = jobFairService.get(jobFairId);
|
|
|
+ if(jobFair == null){
|
|
|
+ throw new Exception("未找到该招聘会");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<JobFairCompany> jobFairCompanyList = jobFairCompanyService.findByFairId(jobFairId);
|
|
|
+
|
|
|
+ int recruitmentNum = 0;
|
|
|
+ int recruitsNum = 0;//招聘人数
|
|
|
+ int totalNum = 0;//总入场人数
|
|
|
+ int todayNum = 0;//今日入场数
|
|
|
+ int resumeNum = 0;//简历投递数
|
|
|
+
|
|
|
+ int manNum = 0;
|
|
|
+ int womanNum = 0;
|
|
|
+ //简历投递数
|
|
|
+ for(JobFairCompany jobFairCompany : jobFairCompanyList){
|
|
|
+ String[] recruitmentIds = jobFairCompany.getRecruitmentIds().split(",");
|
|
|
+ jobFairCompany.setRecruitmentNums(recruitmentIds.length);
|
|
|
+ recruitmentNum = recruitmentNum + recruitmentIds.length;
|
|
|
+ recruitsNum = recruitsNum + recruitmentService.findPositionNumber(jobFairCompany.getCompanyId());
|
|
|
+ manNum = manNum + recruitmentService.findSexNumber("1",jobFairCompany.getCompanyId());
|
|
|
+ womanNum = womanNum + recruitmentService.findSexNumber("0",jobFairCompany.getCompanyId());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
+ dataMap.put("jobFair", jobFair);//招聘会信息
|
|
|
+ dataMap.put("jobFairCompanyList", jobFairCompanyList);//招聘企业信息
|
|
|
+ dataMap.put("jobFairCompanyNum", jobFairCompanyList.size());//入场企业数
|
|
|
+ dataMap.put("recruitmentNum", recruitmentNum);//招聘岗位数
|
|
|
+ dataMap.put("recruitsNum", recruitsNum);//招聘人数
|
|
|
+ dataMap.put("totalNum", totalNum);//总入场人数
|
|
|
+ dataMap.put("todayNum", todayNum);//今日入场数
|
|
|
+ dataMap.put("resumeNum", resumeNum);//简历投递数
|
|
|
+
|
|
|
+ jobFairService.get(jobFairId);
|
|
|
+
|
|
|
+ messageResult.setData(dataMap);
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setCode(200);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("employmentOnlineData")
|
|
|
+ @ApiOperation(value = "就业在线数据大屏")
|
|
|
+ public MessageResult<Map> employmentOnlineData(){
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
+ try{
|
|
|
+ int manNum = 0;
|
|
|
+ int womanNum = 0;
|
|
|
+ int recruitsNum = 0;
|
|
|
+ int shortageCompanyNum = 0;
|
|
|
+ int shortageRecruitNum = 0;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<Recruitment> recruitmentList = recruitmentService.listByApproved();
|
|
|
+
|
|
|
+ recruitsNum = recruitmentService.findPositionNumber(null);
|
|
|
+
|
|
|
+ manNum = recruitmentService.findSexNumber("1",null);
|
|
|
+
|
|
|
+ womanNum = recruitmentService.findSexNumber("0",null);
|
|
|
+
|
|
|
+ //List<Company> companyList = companyService.list();
|
|
|
+ List<Company> companyList = companyService.findByAll();
|
|
|
+ //List<Company> companyList = new ArrayList<>();
|
|
|
+ for(Company company : companyList){
|
|
|
+ int postNum = recruitmentService.findNumber(company.getId());
|
|
|
+ int peopleNum = recruitmentService.findPositionNumber(company.getId());
|
|
|
+
|
|
|
+ company.setPostNum(postNum);
|
|
|
+ company.setPeopleNum(peopleNum);
|
|
|
+ //companyList.add(company);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
+ //入住企业
|
|
|
+ dataMap.put("companyList", companyList);
|
|
|
+ //入住企业数
|
|
|
+ dataMap.put("companyNum", companyList.size());
|
|
|
+ //招聘岗位数
|
|
|
+ dataMap.put("postNum", recruitmentList.size());
|
|
|
+ //招聘人数
|
|
|
+ dataMap.put("postPeopleNum", recruitsNum);
|
|
|
+ //男人数
|
|
|
+ dataMap.put("manNum", manNum);
|
|
|
+ //女人数
|
|
|
+ dataMap.put("womanNUm", womanNum);
|
|
|
+
|
|
|
+ //紧缺企业数
|
|
|
+ dataMap.put("shortageCompanyNum", shortageCompanyNum);
|
|
|
+ //紧缺岗位数
|
|
|
+ dataMap.put("shortageRecruitNum", shortageRecruitNum);
|
|
|
+
|
|
|
+ messageResult.setData(dataMap);
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setCode(200);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("companyData")
|
|
|
+ @ApiOperation(value = "查询入住企业")
|
|
|
+ public MessageResult<Map> companyData(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="10") int pageSize){
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
+ try{
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("sort_no","asc"));
|
|
|
+ sortList.add(new Sort("create_time","asc"));
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+
|
|
|
+ Page<Company> page = companyService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+ for(Company company : page.getResult()){
|
|
|
+ int postNum = recruitmentService.findNumber(company.getId());
|
|
|
+ int peopleNum = recruitmentService.findPositionNumber(null);
|
|
|
+
|
|
|
+ company.setPostNum(postNum);
|
|
|
+ company.setPeopleNum(peopleNum);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ messageResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setCode(200);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("recruitmentData")
|
|
|
+ @ApiOperation(value = "查询招聘职位")
|
|
|
+ public MessageResult<Map> recruitmentData(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="10") int pageSize){
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
+ try{
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+
|
|
|
+ searchParams.put("status","1");
|
|
|
+ searchParams.put("approveStatus","3");
|
|
|
+
|
|
|
+ Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+ for(Recruitment recruitment : page.getResult()){
|
|
|
+ WorkCategory workCategory = workCategoryService.get(recruitment.getPosition());
|
|
|
+ if(workCategory != null) {
|
|
|
+ recruitment.setPositionName(workCategory.getName());
|
|
|
+ }
|
|
|
+ recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
|
|
|
+ recruitment.setPositionSexN(dataDictionaryService.findNameByCatalogNameAndValue("性别",recruitment.getPositionSex()));
|
|
|
+ recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
|
|
|
+ recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
|
|
|
+
|
|
|
+ //recruitmentList.add(recruitment);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ messageResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setCode(200);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("seatData")
|
|
|
+ @ApiOperation(value = "席位")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "seatNumber", value = "席位编号", required = true, paramType = "form")
|
|
|
+ })
|
|
|
+ public MessageResult<Map> seatData( String seatNumber){
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
+ try{
|
|
|
+ if(StringUtils.isEmpty(seatNumber)){
|
|
|
+ throw new Exception("查询错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ SeatManage seatManage = seatManageService.findByNum(seatNumber);
|
|
|
+
|
|
|
+ if(seatManage == null || StringUtils.isEmpty(seatManage.getCompanyId())){
|
|
|
+ throw new Exception("该席位目前未绑定企业");
|
|
|
+ }
|
|
|
+
|
|
|
+ Company company = companyService.get(seatManage.getCompanyId());
|
|
|
+ if(company == null){
|
|
|
+ throw new Exception("企业有误");
|
|
|
+ }
|
|
|
+
|
|
|
+ //List<WorkCategory> workCategoryList = workCategoryService.findByCompany(company.getId());
|
|
|
+ List<Recruitment> recruitmentList = recruitmentService.findByCompanyId(company.getId());
|
|
|
+ //List<Recruitment> recruitmentList = new ArrayList<>();
|
|
|
+ for(Recruitment recruitment : recruitmentList){
|
|
|
+ WorkCategory workCategory = workCategoryService.get(recruitment.getPosition());
|
|
|
+ if(workCategory != null) {
|
|
|
+ recruitment.setPositionName(workCategory.getName());
|
|
|
+ }
|
|
|
+ recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
|
|
|
+ recruitment.setPositionSexN(dataDictionaryService.findNameByCatalogNameAndValue("性别",recruitment.getPositionSex()));
|
|
|
+ recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
|
|
|
+ //recruitmentList.add(recruitment);
|
|
|
+ }
|
|
|
+
|
|
|
+ String scale = dataDictionaryService.getName(company.getScale());
|
|
|
+ String industry = dataDictionaryService.getName(company.getIndustry());
|
|
|
+
|
|
|
+ Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
+ dataMap.put("company", company);
|
|
|
+ dataMap.put("companyId", company.getId());
|
|
|
+ dataMap.put("scale", scale);//规模
|
|
|
+ dataMap.put("industry", industry);//行业
|
|
|
+ dataMap.put("introduction", company.getIntroduction());//介绍
|
|
|
+ dataMap.put("videoUrl", "http://xpgj.oss-cn-shanghai.aliyuncs.com/xpgj/test/VID_20220105_144821.mp4");//视频
|
|
|
+ dataMap.put("recruitmentList", recruitmentList);
|
|
|
+
|
|
|
+ messageResult.setData(dataMap);
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setCode(200);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("resumeDeliverData")
|
|
|
+ @ApiOperation(value = "简历投递记录")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "companyId", value = "企业编号", required = true, paramType = "form")
|
|
|
+ })
|
|
|
+ public MessageResult<Map> resumeDeliverData( String companyId,
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="10") int pageSize){
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
+ try{
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("companyId",companyId);
|
|
|
+
|
|
|
+ Page<ResumeDeliver> page = resumeDeliverService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+ String userSex = "先生";
|
|
|
+ for(ResumeDeliver rd : page.getResult()){
|
|
|
+ Recruitment recruitment = recruitmentService.get(rd.getJobRecruitmentId());
|
|
|
+ WorkCategory workCategory = workCategoryService.get(recruitment.getPosition());
|
|
|
+ if(workCategory != null) {
|
|
|
+ recruitment.setPositionName(workCategory.getName());
|
|
|
+ }
|
|
|
+ rd.setJobRecruitment(recruitment);
|
|
|
+ JobUser jobUser = jobUserService.get(rd.getJobUserId());
|
|
|
+ Resume resume = resumeService.get(rd.getJobResumeId());
|
|
|
+
|
|
|
+ rd.setJobUserSex(resume.getSex());
|
|
|
+ rd.setJobUserName(jobUser.getRealName());
|
|
|
+ }
|
|
|
+
|
|
|
+ messageResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setCode(200);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|