微信抓取功能调用的岗位新增
This commit is contained in:
@@ -29,14 +29,11 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位Controller
|
* 岗位Controller
|
||||||
*
|
*
|
||||||
* @author lishundong
|
* @author lishundong
|
||||||
* @date 2024-09-03
|
* @date 2024-09-03
|
||||||
*/
|
*/
|
||||||
@@ -44,8 +41,7 @@ import java.util.Objects;
|
|||||||
@RequestMapping("/cms/job")
|
@RequestMapping("/cms/job")
|
||||||
@Api(tags = "后台:岗位管理")
|
@Api(tags = "后台:岗位管理")
|
||||||
@Anonymous
|
@Anonymous
|
||||||
public class CmsJobController extends BaseController
|
public class CmsJobController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IJobService jobService;
|
private IJobService jobService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -60,14 +56,14 @@ public class CmsJobController extends BaseController
|
|||||||
private IJobApplyService iJobApplyService;
|
private IJobApplyService iJobApplyService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAppReviewJobService iAppReviewJobService;
|
private IAppReviewJobService iAppReviewJobService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询岗位列表
|
* 查询岗位列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询岗位列表")
|
@ApiOperation("查询岗位列表")
|
||||||
// @PreAuthorize("@ss.hasPermi('cms:job:list')")
|
// @PreAuthorize("@ss.hasPermi('cms:job:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(Job job)
|
public TableDataInfo list(Job job) {
|
||||||
{
|
|
||||||
if (RoleUtils.isCompanyAdmin()) {
|
if (RoleUtils.isCompanyAdmin()) {
|
||||||
Company company = companyService.queryCodeCompany(RoleUtils.getCurrentUseridCard());
|
Company company = companyService.queryCodeCompany(RoleUtils.getCurrentUseridCard());
|
||||||
job.setCompanyId(Objects.nonNull(company) ? company.getCompanyId() : null);
|
job.setCompanyId(Objects.nonNull(company) ? company.getCompanyId() : null);
|
||||||
@@ -83,8 +79,7 @@ public class CmsJobController extends BaseController
|
|||||||
@ApiOperation("获取岗位详细信息")
|
@ApiOperation("获取岗位详细信息")
|
||||||
// @PreAuthorize("@ss.hasPermi('bussiness:job:query')")
|
// @PreAuthorize("@ss.hasPermi('bussiness:job:query')")
|
||||||
@GetMapping(value = "/{jobId}")
|
@GetMapping(value = "/{jobId}")
|
||||||
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
|
public AjaxResult getInfo(@PathVariable("jobId") Long jobId) {
|
||||||
{
|
|
||||||
return success(jobService.selectJobByJobId(jobId));
|
return success(jobService.selectJobByJobId(jobId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,12 +90,12 @@ public class CmsJobController extends BaseController
|
|||||||
// @PreAuthorize("@ss.hasPermi('bussiness:job:export')")
|
// @PreAuthorize("@ss.hasPermi('bussiness:job:export')")
|
||||||
@Log(title = "岗位", businessType = BusinessType.EXPORT)
|
@Log(title = "岗位", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, Job job)
|
public void export(HttpServletResponse response, Job job) {
|
||||||
{
|
|
||||||
List<Job> list = jobService.selectJobList(job);
|
List<Job> list = jobService.selectJobList(job);
|
||||||
ExcelUtil<Job> util = new ExcelUtil<Job>(Job.class);
|
ExcelUtil<Job> util = new ExcelUtil<Job>(Job.class);
|
||||||
util.exportExcel(response, list, "岗位数据");
|
util.exportExcel(response, list, "岗位数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增岗位
|
* 新增岗位
|
||||||
*/
|
*/
|
||||||
@@ -108,8 +103,7 @@ public class CmsJobController extends BaseController
|
|||||||
// @PreAuthorize("@ss.hasPermi('bussiness:job:add')")
|
// @PreAuthorize("@ss.hasPermi('bussiness:job:add')")
|
||||||
@Log(title = "岗位", businessType = BusinessType.INSERT)
|
@Log(title = "岗位", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody Job job)
|
public AjaxResult add(@RequestBody Job job) {
|
||||||
{
|
|
||||||
// 校验描述中的敏感词
|
// 校验描述中的敏感词
|
||||||
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
|
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
|
||||||
if (!sensitiveWords.isEmpty()) {
|
if (!sensitiveWords.isEmpty()) {
|
||||||
@@ -127,8 +121,7 @@ public class CmsJobController extends BaseController
|
|||||||
// @PreAuthorize("@ss.hasPermi('bussiness:job:edit')")
|
// @PreAuthorize("@ss.hasPermi('bussiness:job:edit')")
|
||||||
@Log(title = "岗位", businessType = BusinessType.UPDATE)
|
@Log(title = "岗位", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody Job job)
|
public AjaxResult edit(@RequestBody Job job) {
|
||||||
{
|
|
||||||
// 校验描述中的敏感词
|
// 校验描述中的敏感词
|
||||||
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
|
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
|
||||||
if (!sensitiveWords.isEmpty()) {
|
if (!sensitiveWords.isEmpty()) {
|
||||||
@@ -145,8 +138,7 @@ public class CmsJobController extends BaseController
|
|||||||
// @PreAuthorize("@ss.hasPermi('bussiness:job:remove')")
|
// @PreAuthorize("@ss.hasPermi('bussiness:job:remove')")
|
||||||
@Log(title = "岗位", businessType = BusinessType.DELETE)
|
@Log(title = "岗位", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{jobIds}")
|
@DeleteMapping("/{jobIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] jobIds)
|
public AjaxResult remove(@PathVariable Long[] jobIds) {
|
||||||
{
|
|
||||||
return toAjax(jobService.deleteJobByJobIds(jobIds));
|
return toAjax(jobService.deleteJobByJobIds(jobIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,8 +146,7 @@ public class CmsJobController extends BaseController
|
|||||||
@Log(title = "岗位", businessType = BusinessType.DELETE)
|
@Log(title = "岗位", businessType = BusinessType.DELETE)
|
||||||
@GetMapping("/candidates")
|
@GetMapping("/candidates")
|
||||||
@PreAuthorize("@ss.hasPermi('bussiness:job:candidates')")
|
@PreAuthorize("@ss.hasPermi('bussiness:job:candidates')")
|
||||||
public TableDataInfo candidates(Long jobId)
|
public TableDataInfo candidates(Long jobId) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<CandidateVO> list = jobService.candidates(jobId);
|
List<CandidateVO> list = jobService.candidates(jobId);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@@ -163,17 +154,16 @@ public class CmsJobController extends BaseController
|
|||||||
|
|
||||||
@ApiOperation("获取推荐岗位")
|
@ApiOperation("获取推荐岗位")
|
||||||
@GetMapping("/recommend")
|
@GetMapping("/recommend")
|
||||||
public AjaxResult recommend(ESJobSearch esJobSearch)
|
public AjaxResult recommend(ESJobSearch esJobSearch) {
|
||||||
{
|
|
||||||
if (RoleUtils.isCompanyAdmin()) {
|
if (RoleUtils.isCompanyAdmin()) {
|
||||||
esJobSearch.setCode(RoleUtils.getCurrentUseridCard());
|
esJobSearch.setCode(RoleUtils.getCurrentUseridCard());
|
||||||
esJobSearch.setUserType(StringUtil.IS_COMPANY_USER);
|
esJobSearch.setUserType(StringUtil.IS_COMPANY_USER);
|
||||||
}
|
}
|
||||||
esJobSearch.setPageSize(20);
|
esJobSearch.setPageSize(20);
|
||||||
List<ESJobDocument> jobList = jobService.sysRecommend(esJobSearch);
|
List<ESJobDocument> jobList = jobService.sysRecommend(esJobSearch);
|
||||||
List<Job> jobs=new ArrayList<>();
|
List<Job> jobs = new ArrayList<>();
|
||||||
jobList.stream().forEach(it->{
|
jobList.stream().forEach(it -> {
|
||||||
Job job=new Job();
|
Job job = new Job();
|
||||||
BeanUtils.copyBeanProp(job, it);
|
BeanUtils.copyBeanProp(job, it);
|
||||||
job.setCompanyVo(JSON.parseObject(it.getCompanyVoJson(), CompanyVo.class));
|
job.setCompanyVo(JSON.parseObject(it.getCompanyVoJson(), CompanyVo.class));
|
||||||
jobs.add(job);
|
jobs.add(job);
|
||||||
@@ -183,28 +173,26 @@ public class CmsJobController extends BaseController
|
|||||||
|
|
||||||
@ApiOperation("获取所有岗位")
|
@ApiOperation("获取所有岗位")
|
||||||
@GetMapping("/selectAllJob")
|
@GetMapping("/selectAllJob")
|
||||||
public AjaxResult selectAllJob()
|
public AjaxResult selectAllJob() {
|
||||||
{
|
|
||||||
List<Job> jobList = jobService.selectAllJob();
|
List<Job> jobList = jobService.selectAllJob();
|
||||||
return success(jobList);
|
return success(jobList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/collection")
|
@PostMapping("/collection")
|
||||||
@ApiOperation("用户收藏")
|
@ApiOperation("用户收藏")
|
||||||
public AjaxResult jobCollection(@RequestBody JobCollection jobCollection)
|
public AjaxResult jobCollection(@RequestBody JobCollection jobCollection) {
|
||||||
{
|
if (jobCollection.getJobId() == null) {
|
||||||
if(jobCollection.getJobId()==null){
|
|
||||||
return AjaxResult.error("岗位id为空");
|
return AjaxResult.error("岗位id为空");
|
||||||
}
|
}
|
||||||
if(!SecurityUtils.isLogin()){
|
if (!SecurityUtils.isLogin()) {
|
||||||
return AjaxResult.error("用户未登录!");
|
return AjaxResult.error("用户未登录!");
|
||||||
}
|
}
|
||||||
if(jobCollection.getUserId()==null){
|
if (jobCollection.getUserId() == null) {
|
||||||
String idCard=RoleUtils.getCurrentUseridCard();
|
String idCard = RoleUtils.getCurrentUseridCard();
|
||||||
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
AppUser appUser = appUserService.selectAppuserByIdcard(idCard);
|
||||||
if(appUser==null){
|
if (appUser == null) {
|
||||||
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
||||||
}else{
|
} else {
|
||||||
jobCollection.setUserId(appUser.getUserId());
|
jobCollection.setUserId(appUser.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,17 +201,16 @@ public class CmsJobController extends BaseController
|
|||||||
|
|
||||||
@ApiOperation("获取用户岗位收藏列表")
|
@ApiOperation("获取用户岗位收藏列表")
|
||||||
@GetMapping("/getAppUserYhsc")
|
@GetMapping("/getAppUserYhsc")
|
||||||
public AjaxResult getAppUserYhsc(JobCollection jobCollection)
|
public AjaxResult getAppUserYhsc(JobCollection jobCollection) {
|
||||||
{
|
if (!SecurityUtils.isLogin()) {
|
||||||
if(!SecurityUtils.isLogin()){
|
|
||||||
return AjaxResult.error("用户未登录!");
|
return AjaxResult.error("用户未登录!");
|
||||||
}
|
}
|
||||||
if(jobCollection.getUserId()==null){
|
if (jobCollection.getUserId() == null) {
|
||||||
String idCard=RoleUtils.getCurrentUseridCard();
|
String idCard = RoleUtils.getCurrentUseridCard();
|
||||||
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
AppUser appUser = appUserService.selectAppuserByIdcard(idCard);
|
||||||
if(appUser==null){
|
if (appUser == null) {
|
||||||
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
||||||
}else{
|
} else {
|
||||||
jobCollection.setUserId(appUser.getUserId());
|
jobCollection.setUserId(appUser.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -232,17 +219,16 @@ public class CmsJobController extends BaseController
|
|||||||
|
|
||||||
@ApiOperation("获取用户岗位申请列表")
|
@ApiOperation("获取用户岗位申请列表")
|
||||||
@GetMapping("/getAppUserYhsq")
|
@GetMapping("/getAppUserYhsq")
|
||||||
public AjaxResult getAppUserYhsq(JobApply jobApply)
|
public AjaxResult getAppUserYhsq(JobApply jobApply) {
|
||||||
{
|
if (!SecurityUtils.isLogin()) {
|
||||||
if(!SecurityUtils.isLogin()){
|
|
||||||
return AjaxResult.error("用户未登录!");
|
return AjaxResult.error("用户未登录!");
|
||||||
}
|
}
|
||||||
if(jobApply.getUserId()==null){
|
if (jobApply.getUserId() == null) {
|
||||||
String idCard=RoleUtils.getCurrentUseridCard();
|
String idCard = RoleUtils.getCurrentUseridCard();
|
||||||
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
AppUser appUser = appUserService.selectAppuserByIdcard(idCard);
|
||||||
if(appUser==null){
|
if (appUser == null) {
|
||||||
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
||||||
}else{
|
} else {
|
||||||
jobApply.setUserId(appUser.getUserId());
|
jobApply.setUserId(appUser.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,17 +237,16 @@ public class CmsJobController extends BaseController
|
|||||||
|
|
||||||
@ApiOperation("获取用户岗位访问足迹列表")
|
@ApiOperation("获取用户岗位访问足迹列表")
|
||||||
@GetMapping("/getAppUserYhfwzj")
|
@GetMapping("/getAppUserYhfwzj")
|
||||||
public AjaxResult getAppUserYhfwzj(AppReviewJob appReviewJob)
|
public AjaxResult getAppUserYhfwzj(AppReviewJob appReviewJob) {
|
||||||
{
|
if (!SecurityUtils.isLogin()) {
|
||||||
if(!SecurityUtils.isLogin()){
|
|
||||||
return AjaxResult.error("用户未登录!");
|
return AjaxResult.error("用户未登录!");
|
||||||
}
|
}
|
||||||
if(appReviewJob.getUserId()==null){
|
if (appReviewJob.getUserId() == null) {
|
||||||
String idCard=RoleUtils.getCurrentUseridCard();
|
String idCard = RoleUtils.getCurrentUseridCard();
|
||||||
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
AppUser appUser = appUserService.selectAppuserByIdcard(idCard);
|
||||||
if(appUser==null){
|
if (appUser == null) {
|
||||||
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
||||||
}else{
|
} else {
|
||||||
appReviewJob.setUserId(appUser.getUserId());
|
appReviewJob.setUserId(appUser.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -270,20 +255,19 @@ public class CmsJobController extends BaseController
|
|||||||
|
|
||||||
@PostMapping("/collectionCancel")
|
@PostMapping("/collectionCancel")
|
||||||
@ApiOperation("取消收藏")
|
@ApiOperation("取消收藏")
|
||||||
public AjaxResult pcCancel(@RequestBody JobCollection jobCollection)
|
public AjaxResult pcCancel(@RequestBody JobCollection jobCollection) {
|
||||||
{
|
if (jobCollection.getJobId() == null) {
|
||||||
if(jobCollection.getJobId()==null){
|
|
||||||
return AjaxResult.error("岗位id为空");
|
return AjaxResult.error("岗位id为空");
|
||||||
}
|
}
|
||||||
if(!SecurityUtils.isLogin()){
|
if (!SecurityUtils.isLogin()) {
|
||||||
return AjaxResult.error("用户未登录!");
|
return AjaxResult.error("用户未登录!");
|
||||||
}
|
}
|
||||||
if(jobCollection.getUserId()==null){
|
if (jobCollection.getUserId() == null) {
|
||||||
String idCard=RoleUtils.getCurrentUseridCard();
|
String idCard = RoleUtils.getCurrentUseridCard();
|
||||||
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
AppUser appUser = appUserService.selectAppuserByIdcard(idCard);
|
||||||
if(appUser==null){
|
if (appUser == null) {
|
||||||
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
||||||
}else{
|
} else {
|
||||||
jobCollection.setUserId(appUser.getUserId());
|
jobCollection.setUserId(appUser.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -292,26 +276,38 @@ public class CmsJobController extends BaseController
|
|||||||
|
|
||||||
@PostMapping("/browse")
|
@PostMapping("/browse")
|
||||||
@ApiOperation("岗位浏览")
|
@ApiOperation("岗位浏览")
|
||||||
public AjaxResult browse(@RequestBody AppReviewJob appReviewJob)
|
public AjaxResult browse(@RequestBody AppReviewJob appReviewJob) {
|
||||||
{
|
if (appReviewJob.getJobId() == null) {
|
||||||
if(appReviewJob.getJobId()==null){
|
|
||||||
return AjaxResult.error("岗位id为空");
|
return AjaxResult.error("岗位id为空");
|
||||||
}
|
}
|
||||||
if(!SecurityUtils.isLogin()){
|
if (!SecurityUtils.isLogin()) {
|
||||||
return AjaxResult.error("用户未登录!");
|
return AjaxResult.error("用户未登录!");
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(appReviewJob.getReviewDate())){
|
if (StringUtils.isEmpty(appReviewJob.getReviewDate())) {
|
||||||
appReviewJob.setReviewDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,new Date()));
|
appReviewJob.setReviewDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date()));
|
||||||
}
|
}
|
||||||
if(appReviewJob.getUserId()==null){
|
if (appReviewJob.getUserId() == null) {
|
||||||
String idCard=RoleUtils.getCurrentUseridCard();
|
String idCard = RoleUtils.getCurrentUseridCard();
|
||||||
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
AppUser appUser = appUserService.selectAppuserByIdcard(idCard);
|
||||||
if(appUser==null){
|
if (appUser == null) {
|
||||||
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
||||||
}else{
|
} else {
|
||||||
appReviewJob.setUserId(appUser.getUserId());
|
appReviewJob.setUserId(appUser.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return toAjax(iAppReviewJobService.insertAppReviewJob(appReviewJob));
|
return toAjax(iAppReviewJobService.insertAppReviewJob(appReviewJob));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/wechat")
|
||||||
|
@Anonymous
|
||||||
|
@ApiOperation("微信抓取功能调用的新增")
|
||||||
|
public AjaxResult wechatInsert(@RequestBody Job job) {
|
||||||
|
// 不发布
|
||||||
|
job.setIsPublish(0);
|
||||||
|
if (job.getJobContactList() == null) {
|
||||||
|
job.setJobContactList(new ArrayList<>());
|
||||||
|
}
|
||||||
|
return toAjax(jobService.insertJob(job));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user