diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdChecknumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdChecknumController.java index c929a60..a9abd61 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdChecknumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdChecknumController.java @@ -1,10 +1,13 @@ package com.ruoyi.web.controller.system.count; import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.system.service.ITdCheckService; +import com.ruoyi.system.service.ITdNotifyService; +import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -27,6 +30,9 @@ public class TdChecknumController extends BaseController{ @Autowired private ITdCheckService tdCheckService; + @Autowired + private ITdNotifyService tdNotifyService; + @RequiresPermissions("system:checknum:view") @GetMapping() public String checknum() { @@ -35,6 +41,21 @@ public class TdChecknumController extends BaseController{ + @ApiOperation("检查通知统计") + @PostMapping("/countNotifyList") + @ResponseBody + public AjaxResult countNotifyList() { + return AjaxResult.success(tdNotifyService.selectCountNotifyList()); + } + + + + + + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/NotifyCountDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/NotifyCountDTO.java new file mode 100644 index 0000000..f005efc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/NotifyCountDTO.java @@ -0,0 +1,31 @@ +package com.ruoyi.system.domain.userexam.dto.response; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * packageName com.ruoyi.system.domain.userexam.dto.response + * + * @author wangxy + * @version JDK 8 + * @className NotifyCountDTO + * @date 2024/8/9 + * @description 通知统计 + */ +@Data +@ApiModel(value="通知统计", description="通知统计") +public class NotifyCountDTO implements Serializable { + + + @ApiModelProperty(value = "总数") + private Integer total; + + @ApiModelProperty(value = "已发出") + private Integer yfc; + + @ApiModelProperty(value = "未发出") + private Integer wfc; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdNotifyMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdNotifyMapper.java index aa88e7c..8aadc42 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdNotifyMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdNotifyMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.TdNotify; +import com.ruoyi.system.domain.userexam.dto.response.NotifyCountDTO; /** * 检查通知Mapper接口 @@ -58,4 +59,7 @@ public interface TdNotifyMapper * @return 结果 */ public int deleteTdNotifyByNotifyIds(String[] notifyIds); + + + public NotifyCountDTO selectCountNotifyList(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdNotifyService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdNotifyService.java index 716c2c4..4d06887 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdNotifyService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdNotifyService.java @@ -2,6 +2,7 @@ package com.ruoyi.system.service; import java.util.List; import com.ruoyi.system.domain.TdNotify; +import com.ruoyi.system.domain.userexam.dto.response.NotifyCountDTO; /** * 检查通知Service接口 @@ -58,4 +59,7 @@ public interface ITdNotifyService * @return 结果 */ public int deleteTdNotifyByNotifyId(Long notifyId); + + + public NotifyCountDTO selectCountNotifyList(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdNotifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdNotifyServiceImpl.java index 1d92056..788e63c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdNotifyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdNotifyServiceImpl.java @@ -1,6 +1,8 @@ package com.ruoyi.system.service.impl; import java.util.List; + +import com.ruoyi.system.domain.userexam.dto.response.NotifyCountDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TdNotifyMapper; @@ -91,4 +93,9 @@ public class TdNotifyServiceImpl implements ITdNotifyService { return tdNotifyMapper.deleteTdNotifyByNotifyId(notifyId); } + + @Override + public NotifyCountDTO selectCountNotifyList() { + return tdNotifyMapper.selectCountNotifyList(); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TdNotifyMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdNotifyMapper.xml index c1fe20a..56696fd 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdNotifyMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdNotifyMapper.xml @@ -89,4 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + \ No newline at end of file