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 a9abd61..9238dc4 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,15 @@ package com.ruoyi.web.controller.system.count; +import com.alibaba.fastjson.JSONObject; 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.domain.count.CheckResultCountDTO; +import com.ruoyi.system.domain.count.CheckTypeCountDTO; +import com.ruoyi.system.domain.count.PropertyDesCountDTO; +import com.ruoyi.system.domain.count.PropertyStateCountDTO; import com.ruoyi.system.service.ITdCheckService; import com.ruoyi.system.service.ITdNotifyService; import io.swagger.annotations.ApiOperation; @@ -17,7 +22,10 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; /** * 涉密检查统计 @@ -39,8 +47,6 @@ public class TdChecknumController extends BaseController{ return prefix + "/checknum"; } - - @ApiOperation("检查通知统计") @PostMapping("/countNotifyList") @ResponseBody @@ -48,7 +54,62 @@ public class TdChecknumController extends BaseController{ return AjaxResult.success(tdNotifyService.selectCountNotifyList()); } + private List checkResult = Arrays.asList("通过", "未通过","待检查"); + private List checkType = Arrays.asList("自行检查", "保密局检查"); + + /** + * + * 检查结果统计 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @PostMapping("/countResult") + @ResponseBody + public AjaxResult countbf() { + CheckResultCountDTO checkResultCountDTO = tdCheckService.selectResultCount(); + List datas = checkResult.stream() + .map(name -> { + AtomicReference value = new AtomicReference<>(0L); + if("通过".equals(name)){ + value.set(checkResultCountDTO.getTg()); + }else if("未通过".equals(name)){ + value.set(checkResultCountDTO.getWtg()); + }else{ + value.set(checkResultCountDTO.getDjc()); + } + JSONObject jsonObject = new JSONObject(); + jsonObject.put("value", value.get()); + jsonObject.put("name", name); + return jsonObject; + }) + .collect(Collectors.toList()); + return AjaxResult.success(datas); + } + /** + * + * 检查类型统计 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @PostMapping("/countType") + @ResponseBody + public AjaxResult countXH() { + CheckTypeCountDTO checkTypeCountDTO = tdCheckService.selectTypeCount(); + List datas = checkType.stream() + .map(name -> { + AtomicReference value = new AtomicReference<>(0L); + if("自行检查".equals(name)){ + value.set(checkTypeCountDTO.getZxjc()); + }else{ + value.set(checkTypeCountDTO.getBmjjc()); + } + JSONObject jsonObject = new JSONObject(); + jsonObject.put("value", value.get()); + jsonObject.put("name", name); + return jsonObject; + }) + .collect(Collectors.toList()); + return AjaxResult.success(datas); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/CheckResultCountDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/CheckResultCountDTO.java new file mode 100644 index 0000000..34a6be1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/CheckResultCountDTO.java @@ -0,0 +1,21 @@ +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 CheckResultCountDTO implements Serializable { + + @ApiModelProperty(value = "通过") + private Integer tg; + + @ApiModelProperty(value = "未通过") + private Integer wtg; + + @ApiModelProperty(value = "待检查") + private Integer djc; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/CheckTypeCountDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/CheckTypeCountDTO.java new file mode 100644 index 0000000..2988509 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/CheckTypeCountDTO.java @@ -0,0 +1,17 @@ +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 CheckTypeCountDTO implements Serializable { + + @ApiModelProperty(value = "自从检查") + private Integer zxjc; + + @ApiModelProperty(value = "保密局检查") + private Integer bmjjc; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdCheckMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdCheckMapper.java index 36928f9..f3a2ddb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdCheckMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdCheckMapper.java @@ -2,6 +2,9 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.TdCheck; +import com.ruoyi.system.domain.count.CheckResultCountDTO; +import com.ruoyi.system.domain.count.CheckTypeCountDTO; +import com.ruoyi.system.domain.count.TrainCountDTO; /** * 检查报告管理Mapper接口 @@ -58,4 +61,6 @@ public interface TdCheckMapper * @return 结果 */ public int deleteTdCheckByCheckIds(String[] checkIds); + public CheckResultCountDTO selectResultCount(); + public CheckTypeCountDTO selectTypeCount(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdCheckService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdCheckService.java index d7e98d0..03ff24a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdCheckService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdCheckService.java @@ -2,6 +2,9 @@ package com.ruoyi.system.service; import java.util.List; import com.ruoyi.system.domain.TdCheck; +import com.ruoyi.system.domain.count.CheckResultCountDTO; +import com.ruoyi.system.domain.count.CheckTypeCountDTO; +import com.ruoyi.system.domain.count.PropertyStateCountDTO; /** * 检查报告管理Service接口 @@ -58,4 +61,7 @@ public interface ITdCheckService * @return 结果 */ public int deleteTdCheckByCheckId(Long checkId); + + public CheckResultCountDTO selectResultCount(); + public CheckTypeCountDTO selectTypeCount(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdCheckServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdCheckServiceImpl.java index 30d5215..8499cba 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdCheckServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdCheckServiceImpl.java @@ -1,6 +1,9 @@ package com.ruoyi.system.service.impl; import java.util.List; + +import com.ruoyi.system.domain.count.CheckResultCountDTO; +import com.ruoyi.system.domain.count.CheckTypeCountDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TdCheckMapper; @@ -91,4 +94,14 @@ public class TdCheckServiceImpl implements ITdCheckService { return tdCheckMapper.deleteTdCheckByCheckId(checkId); } + + @Override + public CheckResultCountDTO selectResultCount() { + return tdCheckMapper.selectResultCount(); + } + + @Override + public CheckTypeCountDTO selectTypeCount() { + return tdCheckMapper.selectTypeCount(); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TdCheckMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdCheckMapper.xml index f5a2f9e..2d054eb 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdCheckMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdCheckMapper.xml @@ -274,4 +274,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + \ No newline at end of file