diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysTrainnumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysTrainnumController.java index a39d201..b567239 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysTrainnumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysTrainnumController.java @@ -11,6 +11,7 @@ import com.ruoyi.system.domain.TdTrain; import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ITdTrainService; import com.ruoyi.web.controller.manager.SysAreaManager; +import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -94,4 +95,11 @@ public class SysTrainnumController extends BaseController { return prefix + "/detail"; } + @ApiOperation("培训统计数据") + @PostMapping("/countList") + @ResponseBody + public AjaxResult countList() { + return AjaxResult.success(tdTrainService.selectCountList()); + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/TrainCountDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/TrainCountDTO.java new file mode 100644 index 0000000..b68d3e3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/TrainCountDTO.java @@ -0,0 +1,24 @@ +package com.ruoyi.system.domain.count; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +@ApiModel(value="培训统计", description="培训统计") +public class TrainCountDTO implements Serializable { + + @ApiModelProperty(value = "总数") + private Integer total; + + @ApiModelProperty(value = "待审核") + private Integer dsh; + + @ApiModelProperty(value = "审核通过") + private Integer shtg; + + @ApiModelProperty(value = "审核未通过") + private Integer shwtg; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdTrainMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdTrainMapper.java index 2552284..18fff2a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdTrainMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdTrainMapper.java @@ -4,6 +4,8 @@ import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.domain.TdTrain; +import com.ruoyi.system.domain.count.TrainCountDTO; +import com.ruoyi.system.domain.userexam.dto.response.UserExamCountDTO; /** * 涉密人员培训Mapper接口 @@ -60,4 +62,6 @@ public interface TdTrainMapper extends BaseMapper * @return 结果 */ public int deleteTdTrainByIDs(String[] IDs); + + public TrainCountDTO selectCountList(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdTrainService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdTrainService.java index fd9a950..5e256af 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdTrainService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdTrainService.java @@ -4,6 +4,8 @@ import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.domain.TdTrain; +import com.ruoyi.system.domain.count.TrainCountDTO; +import com.ruoyi.system.domain.userexam.dto.response.UserExamCountDTO; /** * 涉密人员培训Service接口 @@ -61,4 +63,10 @@ public interface ITdTrainService extends IService */ public int deleteTdTrainByID(Long ID); + /** + * 获取培训人数统计 + * @return + */ + public TrainCountDTO selectCountList(); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdTrainServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdTrainServiceImpl.java index 7488fd7..8595ce6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdTrainServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdTrainServiceImpl.java @@ -8,6 +8,7 @@ import java.util.function.Function; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.count.TrainCountDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TdTrainMapper; @@ -98,7 +99,10 @@ public class TdTrainServiceImpl extends ServiceImpl imple { return tdTrainMapper.deleteTdTrainByID(ID); } - + @Override + public TrainCountDTO selectCountList() { + return tdTrainMapper.selectCountList(); + } @Override public boolean saveBatch(Collection entityList, int batchSize) { diff --git a/ruoyi-system/src/main/resources/mapper/system/TdTrainMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdTrainMapper.xml index 87b64fa..91c8772 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdTrainMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdTrainMapper.xml @@ -145,4 +145,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + \ No newline at end of file