|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.ruoyi.web.controller.system.count;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.text.StrPool;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
@ -7,9 +8,11 @@ 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.common.utils.ObtainLastSixMonthsUtil;
|
|
|
|
|
import com.ruoyi.system.domain.TdPropertyInfo;
|
|
|
|
|
import com.ruoyi.system.domain.TdPropertyNet;
|
|
|
|
|
import com.ruoyi.system.domain.TdPropertyNetinfo;
|
|
|
|
|
import com.ruoyi.system.domain.count.PropertyManagerDTO;
|
|
|
|
|
import com.ruoyi.system.service.ISysDictDataService;
|
|
|
|
|
import com.ruoyi.system.service.ITdPropertyNetService;
|
|
|
|
|
import com.ruoyi.system.service.ITdPropertyNetinfoService;
|
|
|
|
@ -19,7 +22,10 @@ import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.ZoneId;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
@ -132,4 +138,41 @@ public class SysNetworknumController extends BaseController {
|
|
|
|
|
return AjaxResult.success(obj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*近6个月统计涉密网络统计
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/countNetMonth")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult countNetMonth() {
|
|
|
|
|
List<String> recentlySixMonth = ObtainLastSixMonthsUtil.getRecentlySixMonth();
|
|
|
|
|
List<Long> yAxisData = new ArrayList<>();
|
|
|
|
|
recentlySixMonth.forEach(month -> {
|
|
|
|
|
// 获取指定月份的最大日期
|
|
|
|
|
String lastDayOfMonth = ObtainLastSixMonthsUtil.getLastDayOfMonth(month);
|
|
|
|
|
// 获取指定天的最大时间
|
|
|
|
|
Date date = Date.from(LocalDate.parse(lastDayOfMonth).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
|
|
Date maxDayTime = ObtainLastSixMonthsUtil.getEndOfDay(date);
|
|
|
|
|
// 获取最小时间
|
|
|
|
|
date = Date.from(LocalDate.parse(month.concat(StrPool.DASHED).concat("01")).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
|
|
Date minDayTime = ObtainLastSixMonthsUtil.getStartOfDay(date);
|
|
|
|
|
AtomicReference<Long> yAxis = new AtomicReference<>(0L);
|
|
|
|
|
PropertyManagerDTO tdPropertyManager = new PropertyManagerDTO();
|
|
|
|
|
tdPropertyManager.setMinDayTime(minDayTime);
|
|
|
|
|
tdPropertyManager.setMaxDayTime(maxDayTime);
|
|
|
|
|
Integer count = tdPropertyNetService.countMessageMonth(tdPropertyManager);
|
|
|
|
|
if(Objects.isNull(count)){
|
|
|
|
|
count = 0;
|
|
|
|
|
}
|
|
|
|
|
yAxis.set(Long.valueOf(count));
|
|
|
|
|
yAxisData.add(yAxis.get());
|
|
|
|
|
});
|
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
|
|
obj.put("xAxisData", recentlySixMonth.toArray());
|
|
|
|
|
obj.put("yAxisData", yAxisData);
|
|
|
|
|
return AjaxResult.success(obj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|