修改附件展示
This commit is contained in:
@@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -66,14 +67,15 @@ public class CmsJobController extends BaseController
|
|||||||
@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,HttpServletRequest request)
|
||||||
{
|
{
|
||||||
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);
|
||||||
}
|
}
|
||||||
startPage();
|
startPage();
|
||||||
List<Job> list = jobService.selectJobList(job);
|
//List<Job> list = jobService.selectJobList(job);
|
||||||
|
List<Job> list = jobService.selectHttpJobList(job,request);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,9 +85,10 @@ 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, HttpServletRequest request)
|
||||||
{
|
{
|
||||||
return success(jobService.selectJobByJobId(jobId));
|
//return success(jobService.selectJobByJobId(jobId));
|
||||||
|
return success(jobService.selectHttpJobByJobId(jobId,request));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,4 +24,6 @@ public interface FileMapper extends BaseMapper<File>
|
|||||||
public int updateBussinessids(@Param("longs") List<Long> longs,@Param("newBussinessid") Long bussinessid);
|
public int updateBussinessids(@Param("longs") List<Long> longs,@Param("newBussinessid") Long bussinessid);
|
||||||
|
|
||||||
public List<File> selectFileListByBussinessIds(@Param("longs") List<Long> longs);
|
public List<File> selectFileListByBussinessIds(@Param("longs") List<Long> longs);
|
||||||
|
|
||||||
|
public int updateIds(@Param("longs") List<Long> longs,@Param("newBussinessid") Long bussinessid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ import com.ruoyi.cms.domain.ESJobDocument;
|
|||||||
import com.ruoyi.cms.domain.Job;
|
import com.ruoyi.cms.domain.Job;
|
||||||
import com.ruoyi.cms.domain.query.ESJobSearch;
|
import com.ruoyi.cms.domain.query.ESJobSearch;
|
||||||
import com.ruoyi.cms.domain.vo.CandidateVO;
|
import com.ruoyi.cms.domain.vo.CandidateVO;
|
||||||
import com.ruoyi.cms.util.AppWechatEntity;
|
|
||||||
import com.ruoyi.common.core.domain.entity.AppUser;
|
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||||
import org.dromara.easyes.core.biz.EsPageInfo;
|
import org.dromara.easyes.core.biz.EsPageInfo;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位Service接口
|
* 岗位Service接口
|
||||||
*
|
*
|
||||||
@@ -96,4 +97,8 @@ public interface IJobService
|
|||||||
List<ESJobDocument> sysRecommend(ESJobSearch esJobSearch);
|
List<ESJobDocument> sysRecommend(ESJobSearch esJobSearch);
|
||||||
|
|
||||||
List<Job> selectAllJob();
|
List<Job> selectAllJob();
|
||||||
|
|
||||||
|
public Job selectHttpJobByJobId(Long jobId, HttpServletRequest request);
|
||||||
|
|
||||||
|
public List<Job> selectHttpJobList(Job job,HttpServletRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
@@ -211,6 +212,25 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Job selectJobByJobId(Long jobId)
|
public Job selectJobByJobId(Long jobId)
|
||||||
|
{
|
||||||
|
Job job = jobMapper.selectById(jobId);
|
||||||
|
//查询公司信息
|
||||||
|
if(Objects.nonNull(job.getCompanyId())){
|
||||||
|
Company company = companyMapper.selectById(job.getCompanyId());
|
||||||
|
job.setCompany(company);
|
||||||
|
}
|
||||||
|
//查询联系人
|
||||||
|
JobContact contact=new JobContact();
|
||||||
|
contact.setJobId(job.getJobId());
|
||||||
|
List<JobContact> contacts=jobContactMapper.getSelectList(contact);
|
||||||
|
if(contacts!=null){
|
||||||
|
job.setJobContactList(contacts);
|
||||||
|
}
|
||||||
|
return job;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Job selectHttpJobByJobId(Long jobId, HttpServletRequest request)
|
||||||
{
|
{
|
||||||
Job job = jobMapper.selectById(jobId);
|
Job job = jobMapper.selectById(jobId);
|
||||||
//查询公司信息
|
//查询公司信息
|
||||||
@@ -226,7 +246,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
|||||||
job.setJobContactList(contacts);
|
job.setJobContactList(contacts);
|
||||||
}
|
}
|
||||||
//查询附件
|
//查询附件
|
||||||
String baseFilePath = StringUtil.getFilePath();
|
String baseFilePath = StringUtil.getFilePath(request);
|
||||||
//查询附件
|
//查询附件
|
||||||
File queryFile = new File();
|
File queryFile = new File();
|
||||||
queryFile.setBussinessid(jobId);
|
queryFile.setBussinessid(jobId);
|
||||||
@@ -252,10 +272,17 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Job> selectJobList(Job job)
|
public List<Job> selectJobList(Job job)
|
||||||
|
{
|
||||||
|
List<Job> jobs = jobMapper.selectJobList(job);
|
||||||
|
return jobs;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Job> selectHttpJobList(Job job,HttpServletRequest request)
|
||||||
{
|
{
|
||||||
List<Job> jobs = jobMapper.selectJobList(job);
|
List<Job> jobs = jobMapper.selectJobList(job);
|
||||||
if (CollectionUtils.isNotEmpty(jobs)) {
|
if (CollectionUtils.isNotEmpty(jobs)) {
|
||||||
String baseFilePath = StringUtil.getFilePath();
|
String baseFilePath = StringUtil.getFilePath(request);
|
||||||
|
|
||||||
List<Long> jobIds = jobs.stream().filter(Objects::nonNull)
|
List<Long> jobIds = jobs.stream().filter(Objects::nonNull)
|
||||||
.map(Job::getJobId).filter(Objects::nonNull)
|
.map(Job::getJobId).filter(Objects::nonNull)
|
||||||
@@ -395,7 +422,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
|||||||
}
|
}
|
||||||
//添加附件
|
//添加附件
|
||||||
List<File> filesList = job.getFilesList() != null ? job.getFilesList() : Collections.emptyList();
|
List<File> filesList = job.getFilesList() != null ? job.getFilesList() : Collections.emptyList();
|
||||||
List<Long> longs = filesList.stream().filter(Objects::nonNull).filter(file -> Objects.isNull(file.getId())).map(File::getBussinessid).collect(Collectors.toList());
|
List<Long> longs = filesList.stream().filter(Objects::nonNull).map(File::getBussinessid).collect(Collectors.toList());
|
||||||
if(!longs.isEmpty()){
|
if(!longs.isEmpty()){
|
||||||
fileMapper.updateBussinessids(longs,job.getJobId());
|
fileMapper.updateBussinessids(longs,job.getJobId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,4 +62,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateIds">
|
||||||
|
update file
|
||||||
|
<if test="newBussinessid != null">
|
||||||
|
set bussinessid = #{newBussinessid}
|
||||||
|
</if>
|
||||||
|
<if test="newBussinessid == null">
|
||||||
|
set bussinessid = bussinessid
|
||||||
|
where 1 = 2
|
||||||
|
</if>
|
||||||
|
where
|
||||||
|
<if test="longs != null and longs.size() > 0">
|
||||||
|
id in (
|
||||||
|
<foreach collection="longs" item="oldId" separator=",">
|
||||||
|
#{oldId}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="longs == null or longs.size() == 0">
|
||||||
|
1 = 2
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user