修改查询预约条数,及更新显示条数

This commit is contained in:
chenshaohua
2026-07-20 19:09:12 +08:00
parent 23743ff261
commit bc2427cfe3
5 changed files with 36 additions and 1 deletions

View File

@@ -2,10 +2,12 @@ package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.InterviewInvitation;
import com.ruoyi.cms.domain.vo.InterviewInvitationVO;
import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.cms.service.InterviewInvitationService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.Company;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
@@ -16,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@@ -32,6 +35,8 @@ import java.util.List;
public class CmsInterviewController extends BaseController {
@Autowired
private InterviewInvitationService interviewInvitationService;
@Autowired
private ICompanyService iCompanyService;
/**
* 列表
@@ -40,6 +45,21 @@ public class CmsInterviewController extends BaseController {
@PreAuthorize("@ss.hasPermi('cms:interview:list')")
@GetMapping("/list")
public TableDataInfo list(InterviewInvitation interviewInvitation){
if (SecurityUtils.isLogin()) {
Long userId = SecurityUtils.getUserId();
if(userId != null && !SecurityUtils.isAdmin(userId)){
String idCard = SecurityUtils.getIdcard();
if (StringUtils.isNotBlank(idCard)) {
Company company = iCompanyService.queryCodeCompany(idCard);
if(company == null){
return getDataTable(new ArrayList<>());
}
interviewInvitation.setCompanyId(company.getCompanyId());
//修改数字已展示状态
int i=interviewInvitationService.updateShowTotal(company.getCompanyId());
}
}
}
startPage();
List<InterviewInvitationVO> list = interviewInvitationService.getInterviewInvitationVOList(interviewInvitation);
return getDataTable(list);

View File

@@ -111,4 +111,7 @@ public class InterviewInvitation extends BaseEntity {
@ApiModelProperty("是否已读0未读1已读")
private String isRead;
@ApiModelProperty("是否已读0未展示1已展示")
private String isShow;
}

View File

@@ -36,4 +36,6 @@ public interface InterviewInvitationService {
int updateReadAll(Long userId);
InviteCountDTO selectMsyyhbs(String idCard);
int updateShowTotal(Long companyId);
}

View File

@@ -343,4 +343,14 @@ public class InterviewInvitationServiceImpl implements InterviewInvitationServic
public InviteCountDTO selectMsyyhbs(String idCard){
return interviewInvitationMapper.selectMsyyhbs(idCard);
}
@Override
public int updateShowTotal(Long companyId) {
LambdaUpdateWrapper<InterviewInvitation> updateWrapper = Wrappers.lambdaUpdate();
updateWrapper.eq(InterviewInvitation::getDelFlag,"0")
.eq(InterviewInvitation::getCompanyId, companyId)
.eq(InterviewInvitation::getIsShow, "0")
.set(InterviewInvitation::getIsShow, "1");
return interviewInvitationMapper.update(null, updateWrapper);
}
}

View File

@@ -88,7 +88,7 @@
</select>
<select id="selectMsyyhbs" resultType="com.ruoyi.cms.domain.vo.InviteCountDTO">
select count(1) total,sum(case when t.status='accepted' then 1 else 0 END) jss,
select count(1) total,sum(case when t.status='accepted' and is_show='0' then 1 else 0 END) jss,
sum(case when t.status='rejected' then 1 else 0 END) jjs from interview_invitation t
INNER join company cp on t.company_id=cp.company_id
where cp.code=#{idCard}