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