fix:载体统计

pg_adapter
wangxy 8 months ago
parent 1467ecd3bd
commit 7292e66cd1

@ -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<SysDictData> smType = dictDataService.selectDictDataList(sysDictData);
List<String> list = smType.stream().map(SysDictData::getDictLabel).collect(Collectors.toList());
List<Long> yAxisData = new ArrayList<>();
smType.forEach(xAxis -> {
AtomicReference<Long> 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<SysDictData> smType = dictDataService.selectDictDataList(sysDictData);
List<JSONObject> jsonObjects = new ArrayList<>();
smType.forEach(xAxis -> {
AtomicReference<Long> 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);
}
}

Loading…
Cancel
Save