From e52328e457ff2b9bc8a0489403c28199c29f2193 Mon Sep 17 00:00:00 2001 From: zef <1146339010@QQ.com> Date: Fri, 5 Jul 2024 17:32:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=B7=B2?= =?UTF-8?q?=E8=AF=BB=E6=9C=AA=E8=AF=BB=E6=95=B0=E9=87=8F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TbCompanyVerificationController.java | 44 +++++++++++++++++-- .../TbCompanyVerificationServiceImpl.java | 1 + 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/ruoyi-safecompany/src/main/java/com/ruoyi/business/anHuiEnterprise/controller/TbCompanyVerificationController.java b/ruoyi-safecompany/src/main/java/com/ruoyi/business/anHuiEnterprise/controller/TbCompanyVerificationController.java index ec36a5d..671098a 100644 --- a/ruoyi-safecompany/src/main/java/com/ruoyi/business/anHuiEnterprise/controller/TbCompanyVerificationController.java +++ b/ruoyi-safecompany/src/main/java/com/ruoyi/business/anHuiEnterprise/controller/TbCompanyVerificationController.java @@ -1,10 +1,9 @@ package com.ruoyi.business.anHuiEnterprise.controller; -import java.util.Date; -import java.util.List; -import java.util.UUID; +import java.util.*; import javax.servlet.http.HttpServletResponse; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; @@ -15,6 +14,7 @@ import com.ruoyi.business.anHuiEnterprise.service.ITbVerificationUserDetailsServ import com.ruoyi.business.companyInformationReporting.domain.TbCompanyInformationReporting; import com.ruoyi.business.companyInformationReporting.domain.TbCompanyInformationReportingDetails; import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.core.domain.R; import com.ruoyi.common.utils.DateUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -65,7 +65,8 @@ public class TbCompanyVerificationController extends BaseController { @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "Date", dataTypeClass = Date.class), @ApiImplicitParam(name = "beginTime", value = "开始时间", dataType = "Date", dataTypeClass = Date.class), @ApiImplicitParam(name = "verificationType", value = "审核类型 1人员背景审核 2重点岗位审查 3业务咨询 4法律咨询", dataType = "String", dataTypeClass = String.class), - @ApiImplicitParam(name = "readState", value = "读取状态 0已读 1未读", dataType = "String", dataTypeClass = String.class) + @ApiImplicitParam(name = "readState", value = "读取状态 0已读 1未读", dataType = "String", dataTypeClass = String.class), + @ApiImplicitParam(name = "companyId", value = "企业id", dataType = "String", dataTypeClass = String.class,required = true) }) public TableDataInfo list(TbCompanyVerification tbCompanyVerification) { startPage(); @@ -248,4 +249,39 @@ public class TbCompanyVerificationController extends BaseController { { return toAjax(tbCompanyVerificationService.deleteTbCompanyVerificationByIds(ids)); } + + @GetMapping("/readCount") + @ApiOperation("获取已读未读数量") + @ApiOperationSupport(author = "张二富", order = 25) + @ApiImplicitParam(name = "companyId", value = "企业id", required = true) + public R> readCount(TbCompanyVerification tbCompanyVerification){ + HashMap map = new HashMap<>(); + + QueryWrapper total = new QueryWrapper<>(); + total.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.isDel),"1"); + total.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.auditState),"0"); + total.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.companyId),tbCompanyVerification.getCompanyId()); + List totalList = tbCompanyVerificationService.list(total); + + + QueryWrapper readTrue = new QueryWrapper<>(); + readTrue.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.isDel),"1"); + readTrue.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.auditState),"0"); + readTrue.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.readState),"0"); + readTrue.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.companyId),tbCompanyVerification.getCompanyId()); + + List readTrueList = tbCompanyVerificationService.list(readTrue); + + + QueryWrapper readFalse = new QueryWrapper<>(); + readFalse.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.isDel),"1"); + readFalse.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.auditState),"0"); + readFalse.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.readState),"1"); + readFalse.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.companyId),tbCompanyVerification.getCompanyId()); + List readFalseList =tbCompanyVerificationService.list(readTrue); + map.put("totalCount",totalList.size()); + map.put("readTrueCount",readTrueList.size()); + map.put("readFalseCount",readFalseList.size()); + return getResultand(map); + } } diff --git a/ruoyi-safecompany/src/main/java/com/ruoyi/business/anHuiEnterprise/service/impl/TbCompanyVerificationServiceImpl.java b/ruoyi-safecompany/src/main/java/com/ruoyi/business/anHuiEnterprise/service/impl/TbCompanyVerificationServiceImpl.java index 61635ee..d393e5c 100644 --- a/ruoyi-safecompany/src/main/java/com/ruoyi/business/anHuiEnterprise/service/impl/TbCompanyVerificationServiceImpl.java +++ b/ruoyi-safecompany/src/main/java/com/ruoyi/business/anHuiEnterprise/service/impl/TbCompanyVerificationServiceImpl.java @@ -71,6 +71,7 @@ public class TbCompanyVerificationServiceImpl extends ServiceImpl tbCompanyVerificationQueryWrapper = new QueryWrapper<>(); tbCompanyVerificationQueryWrapper.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.isDel),"1"); tbCompanyVerificationQueryWrapper.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.auditState),"0"); + tbCompanyVerificationQueryWrapper.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.companyId),tbCompanyVerification.getCompanyId()); Optional.ofNullable(tbCompanyVerification.getVerificationType()) .ifPresent(verificationType->{ tbCompanyVerificationQueryWrapper.eq(StringUtils.camelToUnderline(TbCompanyVerification.Fields.verificationType),verificationType);