diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysFilenumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysFilenumController.java index ad4e1a9..4deb8a4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysFilenumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysFilenumController.java @@ -1,13 +1,19 @@ package com.ruoyi.web.controller.system.count; +import com.alibaba.fastjson.JSONObject; 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.SysDictData; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.system.domain.TdFileProvide; import com.ruoyi.system.domain.TdFileReceive; +import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.TdPropertyNetinfo; +import com.ruoyi.system.domain.count.CheckResultCountDTO; import com.ruoyi.system.service.ISysDeptService; +import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.ITdFileProvideService; import com.ruoyi.system.service.ITdFileReceiveService; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -16,7 +22,10 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; /** * 涉密文件统计 @@ -66,4 +75,65 @@ public class SysFilenumController extends BaseController { mmap.put("sysuser", getSysUser()); return prefix + "/print"; } + + @Autowired + private ISysDictDataService dictDataService; + + /** + * + * 载体类型统计 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + + @PostMapping("/countLevel") + @ResponseBody + public AjaxResult countLevel() { + SysDictData sysDictData = new SysDictData(); + sysDictData.setDictType("sys_sm_property"); + List smType = dictDataService.selectDictDataList(sysDictData); + List list = smType.stream().map(SysDictData::getDictLabel).collect(Collectors.toList()); + List yAxisData = new ArrayList<>(); + smType.forEach(xAxis -> { + AtomicReference yAxis = new AtomicReference<>(0L); + Integer count = tdFileProvideService.lambdaQuery() + .eq(TdFileProvide::getProvideLevel, xAxis.getDictValue()) + .count(); + yAxis.set(Long.valueOf(count)); + + yAxisData.add(yAxis.get()); + }); + JSONObject obj = new JSONObject(); + obj.put("xAxisData", list.toArray()); + obj.put("yAxisData", yAxisData); + return AjaxResult.success(obj); + } + + + /** + * + * 载体密级统计 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @PostMapping("/countSecret") + @ResponseBody + public AjaxResult countSecret() { + SysDictData sysDictData = new SysDictData(); + sysDictData.setDictType("sys_file_miji"); + List smType = dictDataService.selectDictDataList(sysDictData); + List jsonObjects = new ArrayList<>(); + smType.forEach(xAxis -> { + AtomicReference value = new AtomicReference<>(0L); + Integer count = tdFileProvideService.lambdaQuery() + .eq(TdFileProvide::getFileSecret, xAxis.getDictValue()) + .count(); + value.set(Long.valueOf(count)); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("value", value.get()); + jsonObject.put("name", xAxis.getDictLabel()); + jsonObjects.add(jsonObject); + }); + return AjaxResult.success(jsonObjects); + } + + }