|
@@ -0,0 +1,217 @@
|
|
|
|
|
+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.Recruitment;
|
|
|
|
|
+import com.jpsoft.employment.modules.job.service.RecruitmentService;
|
|
|
|
|
+import com.jpsoft.employment.modules.job.service.UserBrowseService;
|
|
|
|
|
+import com.jpsoft.employment.modules.job.service.UserCollectionService;
|
|
|
|
|
+import com.jpsoft.employment.modules.manage.entity.JobFair;
|
|
|
|
|
+import com.jpsoft.employment.modules.manage.entity.JobFairCompany;
|
|
|
|
|
+import com.jpsoft.employment.modules.manage.service.JobFairCompanyService;
|
|
|
|
|
+import com.jpsoft.employment.modules.manage.service.JobFairService;
|
|
|
|
|
+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;
|
|
|
|
|
+
|
|
|
|
|
+ @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);
|
|
|
|
|
+ for(JobFairCompany jobFairCompany : jobFairCompanyList){
|
|
|
|
|
+ String[] recruitmentIds = jobFairCompany.getRecruitmentIds().split(",");
|
|
|
|
|
+ jobFairCompany.setRecruitmentNums(recruitmentIds.length);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
|
|
+ dataMap.put("jobFair", jobFair);
|
|
|
|
|
+ dataMap.put("jobFairCompanyList", jobFairCompanyList);
|
|
|
|
|
+
|
|
|
|
|
+ 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<Company> companyList = companyService.list();
|
|
|
|
|
+ List<Recruitment> recruitmentList = recruitmentService.listByApproved();
|
|
|
|
|
+
|
|
|
|
|
+ recruitsNum = recruitmentService.findPositionNumber(null);
|
|
|
|
|
+
|
|
|
|
|
+ manNum = recruitmentService.findSexNumber("1",null);
|
|
|
|
|
+
|
|
|
|
|
+ womanNum = recruitmentService.findSexNumber("0",null);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
|
|
+ //入住企业数
|
|
|
|
|
+ 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);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|