修改移动端,展示附件信息
This commit is contained in:
@@ -21,6 +21,7 @@ import org.dromara.easyes.core.biz.EsPageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -148,9 +149,10 @@ public class AppJobController extends BaseController
|
||||
*/
|
||||
@ApiOperation("获取岗位详细信息")
|
||||
@GetMapping(value = "/{jobId}")
|
||||
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
|
||||
public AjaxResult getInfo(@PathVariable("jobId") Long jobId, HttpServletRequest request)
|
||||
{
|
||||
Job job = jobService.selectJobByJobIdApp(jobId);
|
||||
//Job job = jobService.selectJobByJobIdApp(jobId);
|
||||
Job job = jobService.selectHttpJobByJobIdApp(jobId,request);
|
||||
return success(job);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,8 @@ public interface IJobService
|
||||
|
||||
Job selectJobByJobIdApp(Long jobId);
|
||||
|
||||
Job selectHttpJobByJobIdApp(Long jobId,HttpServletRequest request);
|
||||
|
||||
void importRow(String path);
|
||||
|
||||
List<CandidateVO> candidates(Long jobId);
|
||||
|
||||
@@ -535,6 +535,56 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Job selectHttpJobByJobIdApp(Long jobId,HttpServletRequest request) {
|
||||
Job job = jobMapper.selectById(jobId);
|
||||
//查询公司信息
|
||||
if(Objects.nonNull(job.getCompanyId())){
|
||||
Company company = companyMapper.selectById(job.getCompanyId());
|
||||
job.setCompany(company);
|
||||
}
|
||||
if(SiteSecurityUtils.isLogin()){
|
||||
//查询申请信息
|
||||
Long applyCount = jobApplyMapper.selectCount(Wrappers.<JobApply>lambdaQuery().eq(JobApply::getJobId, jobId).eq(JobApply::getUserId, SiteSecurityUtils.getUserId()));
|
||||
job.setIsApply(applyCount>0?1:0);
|
||||
//查询收藏信息
|
||||
Long collectionCount = jobCollectionMapper.selectCount(Wrappers.<JobCollection>lambdaQuery().eq(JobCollection::getJobId, jobId).eq(JobCollection::getUserId, SiteSecurityUtils.getUserId()));
|
||||
job.setIsCollection(collectionCount>0?1:0);
|
||||
//todo asyn
|
||||
//保存浏览记录
|
||||
List<AppReviewJob> appReviewJobs = appReviewJobMapper.selectList(Wrappers.<AppReviewJob>lambdaQuery().eq(AppReviewJob::getUserId, SiteSecurityUtils.getUserId()).eq(AppReviewJob::getJobId, jobId));
|
||||
//之前相同岗位的记录删除 保存最新的浏览记录
|
||||
if(!appReviewJobs.isEmpty()){
|
||||
appReviewJobMapper.deleteBatchIds(appReviewJobs.stream().map(AppReviewJob::getId).collect(Collectors.toList()));
|
||||
}
|
||||
AppReviewJob appReviewJob = new AppReviewJob();
|
||||
appReviewJob.setUserId(SiteSecurityUtils.getUserId());
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
appReviewJob.setReviewDate(formattedDate);
|
||||
appReviewJob.setJobId(jobId);
|
||||
appReviewJobMapper.insert(appReviewJob);
|
||||
}
|
||||
this.view(jobId);
|
||||
//查询附件
|
||||
String baseFilePath = StringUtil.getFilePath(request);
|
||||
//查询附件
|
||||
File queryFile = new File();
|
||||
queryFile.setBussinessid(jobId);
|
||||
List<File> filesList = Optional.ofNullable(fileMapper.selectFileList(queryFile))
|
||||
.orElseGet(Collections::emptyList);
|
||||
//添加路径
|
||||
List<File> processedFiles = filesList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(file -> file.getFileUrl() != null && !file.getFileUrl().trim().isEmpty())
|
||||
.peek(file -> file.setFileUrl(String.join("", baseFilePath, file.getFileUrl())))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
job.setFilesList(processedFiles);
|
||||
return job;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CandidateVO> candidates(Long jobId) {
|
||||
List<CandidateVO> jobList = jobApplyMapper.candidates(jobId);
|
||||
|
||||
Reference in New Issue
Block a user