Commit 41e3e6bd authored by tianhongyang's avatar tianhongyang

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents ca986227 37d1fcc8
...@@ -171,6 +171,8 @@ tenant: ...@@ -171,6 +171,8 @@ tenant:
- advisory_body_custom_form - advisory_body_custom_form
- dim_area - dim_area
- biz_dict_data - biz_dict_data
- push_monitor_rules
- push_monitor_info
# MyBatisPlus配置 # MyBatisPlus配置
......
...@@ -12,6 +12,7 @@ import java.time.LocalDateTime; ...@@ -12,6 +12,7 @@ import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
/** /**
...@@ -191,4 +192,30 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { ...@@ -191,4 +192,30 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
int year = localDate.getHour(); int year = localDate.getHour();
return year; return year;
} }
/**
* 获取小时前后日期
* @param date
* @param hours
* @return
*/
public static Date addDays(Date date, int hours) {
return org.apache.commons.lang3.time.DateUtils.addHours(date, hours);
}
/***
*@Description: yyyy-MM-dd HH:mm:ss
*@Param:
*@return: java.lang.String
*@Author: Dgm
*@date: 2023/12/21 18:23
*/
public static String format(Date date) {
Calendar calendar = Calendar.getInstance();
if (date != null) {
calendar.setTime(date);
}
return new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS).format(calendar.getTime());
}
} }
//package com.dsk.monitor.job; package com.dsk.monitor.job;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import cn.hutool.core.date.DateUtil;
//import com.dsk.common.utils.DateUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.dsk.monitor.domain.dto.PushMonitorRules; import com.dsk.common.tenant.helper.TenantHelper;
//import com.dsk.monitor.mapper.PushMonitorInfoMapper; import com.dsk.common.utils.DateUtils;
//import com.dsk.monitor.mapper.PushMonitorRulesMapper; import com.dsk.monitor.domain.dto.PushMonitorRules;
//import com.dsk.monitor.util.SendMessageUtil; import com.dsk.monitor.domain.vo.ConditionVo;
//import org.springframework.scheduling.annotation.Scheduled; import com.dsk.monitor.domain.vo.PushMonitorDynamicPageVo;
// import com.dsk.monitor.mapper.PushMonitorInfoMapper;
//import javax.annotation.Resource; import com.dsk.monitor.mapper.PushMonitorRulesMapper;
// import com.dsk.monitor.service.MonitorService;
///** import com.dsk.monitor.util.SendMessageUtil;
// * @ClassName PushScheduling import org.springframework.scheduling.annotation.Scheduled;
// * @Description 发送短信 import org.springframework.stereotype.Component;
// * @Author Dgm
// * @Date 2023/12/9 13:51 import javax.annotation.Resource;
// * @Version import java.util.Arrays;
// */ import java.util.Date;
//public class PushScheduling { import java.util.List;
//
// @Resource /**
// private PushMonitorInfoMapper monitorInfoMapper; * @ClassName PushScheduling
// * @Description 发送短信
// @Resource * @Author Dgm
// private PushMonitorRulesMapper rulesMapper; * @Date 2023/12/9 13:51
// * @Version
// @Scheduled(cron = "0 0 5 * * * ?") */
// public void receiveModePhone() { @Component
// // 获取当前整点时间 public class PushScheduling {
// Integer concurrentHour = DateUtils.getHour();
// QueryWrapper queryWrapper = new QueryWrapper(); @Resource
// PushMonitorRules detail = rulesMapper.selectOne(queryWrapper); private MonitorService monitorService;
// // 推送时段-起
// Integer timePeriodStart = detail.getTimePeriodStart(); @Resource
// // 推送时段-止 private PushMonitorInfoMapper monitorInfoMapper;
// Integer timePeriodEnd = detail.getTimePeriodEnd();
// if (concurrentHour > timePeriodStart && concurrentHour < timePeriodEnd) { @Resource
// QueryWrapper monitorInfoWrapper = new QueryWrapper(); private PushMonitorRulesMapper rulesMapper;
// // 风险类型
// @Scheduled(cron = "0 0/2 * * * ?")
@Scheduled(cron = "0 0 * * * ?")
public void receiveModePhone() throws Exception {
// 是否是周末
boolean isWeekend = DateUtil.isWeekend(new Date());
String aa = DateUtil.now();
TenantHelper.setTenantId("1");
// 获取当前整点时间
Integer concurrentHour = DateUtils.getHour();
QueryWrapper<PushMonitorRules> queryWrapper = new QueryWrapper();
List<PushMonitorRules> detailList = rulesMapper.selectList(queryWrapper);
for (PushMonitorRules detail : detailList) {
// 推送时段-起
String timePeriodStart = detail.getTimePeriodStart();
timePeriodStart = timePeriodStart.substring(0,2);
if (timePeriodStart.contains("0")) {
timePeriodStart = timePeriodStart.substring(1,2);
}
// 推送时段-止
String timePeriodEnd = detail.getTimePeriodEnd();
timePeriodEnd = timePeriodEnd.substring(0,2);
if (timePeriodEnd.contains("0")) {
timePeriodEnd = timePeriodEnd.substring(1,2);
}
Integer pushFrequency = detail.getPushFrequency();
if (pushFrequency > 1) {
if (isWeekend) {
continue;
}
}
Integer timeStart = Integer.valueOf(timePeriodStart);
Integer timeEnd = Integer.valueOf(timePeriodEnd);
if (concurrentHour >= timeStart && concurrentHour <= timeEnd) {
QueryWrapper monitorInfoWrapper = new QueryWrapper();
// 风险类型
// monitorInfoWrapper.in("risk_type", detail.getRiskType()); // monitorInfoWrapper.in("risk_type", detail.getRiskType());
// // 监控维度 PushMonitorDynamicPageVo pageVo = new PushMonitorDynamicPageVo();
// monitorInfoWrapper.in("dimension", detail.getDimension()); pageVo.setUserId(detail.getUserId());
// Long count = monitorInfoMapper.selectCount(monitorInfoWrapper); ConditionVo vo = new ConditionVo();
// if (count >0 ) { // 截止时间
// SendMessageUtil.sendMessage(detail.getPhones(), count.toString()); vo.setEndTime(DateUtils.getDate());
// } vo.setBeginTime(DateUtils.format(DateUtils.addDays(new Date(),-1)));
// } // 监控维度
// } vo.setDimension(getDimension(detail.getDimension()));
//} vo.setUserId(detail.getUserId());
pageVo.setCondition(vo);;
Integer count = monitorService.companyDynamicPage2(pageVo);
if (count > 0 ) {
SendMessageUtil.sendMessage(detail.getPhones(), count.toString());
}
}
}
}
public List<String> getDimension(String dimension) {
List<String> dimensionList = Arrays.asList(dimension.split(","));
return dimensionList;
}
}
...@@ -52,7 +52,7 @@ public interface MonitorService { ...@@ -52,7 +52,7 @@ public interface MonitorService {
/*** /***
*@Description: 监控动态/监控报告 分页 *@Description: 监控动态 分页
*@Param: pageVo 信息 *@Param: pageVo 信息
*@return: R *@return: R
*@Author: Dgm *@Author: Dgm
...@@ -60,6 +60,15 @@ public interface MonitorService { ...@@ -60,6 +60,15 @@ public interface MonitorService {
*/ */
TableDataInfo companyDynamicPage(PushMonitorDynamicPageVo pageVo) throws Exception; TableDataInfo companyDynamicPage(PushMonitorDynamicPageVo pageVo) throws Exception;
/***
*@Description: 监控动态分页(定时任务使用)
*@Param: pageVo 信息
*@return: R
*@Author: Dgm
*@date: 2023/12/9 10:03
*/
Integer companyDynamicPage2(PushMonitorDynamicPageVo pageVo) throws Exception;
/*** /***
*@Description: 监控报告 *@Description: 监控报告
*@Param: pageVo 信息 *@Param: pageVo 信息
......
...@@ -14,6 +14,7 @@ import com.dsk.monitor.mapper.PushMonitorRulesMapper; ...@@ -14,6 +14,7 @@ import com.dsk.monitor.mapper.PushMonitorRulesMapper;
import com.dsk.monitor.service.MonitorService; import com.dsk.monitor.service.MonitorService;
import com.dsk.system.utils.DskOpenApiUtil; import com.dsk.system.utils.DskOpenApiUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
...@@ -92,7 +93,6 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -92,7 +93,6 @@ public class MonitorServiceImpl implements MonitorService {
@Override @Override
public TableDataInfo companyDynamicPage(PushMonitorDynamicPageVo pageVo) throws Exception { public TableDataInfo companyDynamicPage(PushMonitorDynamicPageVo pageVo) throws Exception {
pageVo.setPageSize(3);
Long userId = LoginHelper.getUserId(); Long userId = LoginHelper.getUserId();
if (ObjectUtil.isNotEmpty(userId)) { if (ObjectUtil.isNotEmpty(userId)) {
pageVo.setUserId(userId); pageVo.setUserId(userId);
...@@ -103,6 +103,19 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -103,6 +103,19 @@ public class MonitorServiceImpl implements MonitorService {
return dskOpenApiUtil.responsePageT(map); return dskOpenApiUtil.responsePageT(map);
} }
@Override
public Integer companyDynamicPage2(PushMonitorDynamicPageVo pageVo) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/monitor/company/info/companyDynamicList", BeanUtil.beanToMap(pageVo, false, false));
log.info("companyDynamicPage=============================>"+map);
Integer code = MapUtils.getInteger(map, "code", 300);
Map data = MapUtils.getMap(map, "data", null);
Integer count = 0;
if (code.equals(200)) {
count = MapUtils.getInteger(data, "totalCount", 0);
}
return count;
}
@Override @Override
public TableDataInfo reportPage(PushMonitorReportPageVo pageVo) throws Exception { public TableDataInfo reportPage(PushMonitorReportPageVo pageVo) throws Exception {
Long userId = LoginHelper.getUserId(); Long userId = LoginHelper.getUserId();
......
...@@ -455,12 +455,11 @@ li { ...@@ -455,12 +455,11 @@ li {
.table-item { .table-item {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; // 骨架屏预留
align-items: center; min-height: 360px;
justify-content: center;
.el-table { .el-table {
width: 100%; width: 100%;
height: 100%; height: auto;
font-size: 14px; font-size: 14px;
color: #232323; color: #232323;
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</template> </template>
</el-table> </el-table>
<div style="padding: 30px 0;box-sizing:border-box;" v-else> <div class="table-empty-container" v-else>
<no-data /> <no-data />
</div> </div>
</div> </div>
...@@ -250,11 +250,25 @@ export default { ...@@ -250,11 +250,25 @@ export default {
height: 16px; height: 16px;
} }
// 空状态容器
.table-empty-container {
width: 100%;
height: 100%;
padding: 30px 0;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
.el-table { .el-table {
/* .cell { height: auto;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
} */ .el-table__header-wrapper {
min-height: 40px;
}
} }
} }
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<skeleton v-if="tableLoading"></skeleton> <skeleton v-if="tableLoading"></skeleton>
<!-- table 列表 --> <!-- table 列表 -->
<table-list-com ref="tableContainer" :tableData="tableDataList" :formColum="formColum" :tableDataTotal="total" :queryParams="queryParams" <table-list-com ref="tableContainer" :tableData="tableDataList" :formColum="formColum" :tableDataTotal="total" :queryParams="queryParams"
v-else-if="!tableLoading" :height="'100%'" @handle-current-change="handleCurrentChange"> v-else-if="!tableLoading" :maxHeight="'100%'" @handle-current-change="handleCurrentChange">
<!-- 项目列表 --> <!-- 项目列表 -->
<template slot="projectName" slot-scope="{data,row}"> <template slot="projectName" slot-scope="{data,row}">
<div v-if="row.projectName" class="no-line-feed ">{{row.projectName}}</div> <div v-if="row.projectName" class="no-line-feed ">{{row.projectName}}</div>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<skeleton v-if="tableLoading"></skeleton> <skeleton v-if="tableLoading"></skeleton>
<!-- table 列表 --> <!-- table 列表 -->
<table-list-com ref="tableContainer" :tableData="tableDataList" :formColum="formColum" :tableDataTotal="total" :queryParams="queryParams" <table-list-com ref="tableContainer" :tableData="tableDataList" :formColum="formColum" :tableDataTotal="total" :queryParams="queryParams"
v-else-if="!tableLoading" :height="'100%'" @handle-current-change="handleCurrentChange"> v-else-if="!tableLoading" :maxHeight="'100%'" @handle-current-change="handleCurrentChange">
<!-- 咨询机构名称 --> <!-- 咨询机构名称 -->
<template slot="advisoryBodyName" slot-scope="{data,row}"> <template slot="advisoryBodyName" slot-scope="{data,row}">
<div v-if="row.advisoryBodyName" class="no-line-feed ">{{row.advisoryBodyName}}</div> <div v-if="row.advisoryBodyName" class="no-line-feed ">{{row.advisoryBodyName}}</div>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<skeleton v-if="tableLoading"></skeleton> <skeleton v-if="tableLoading"></skeleton>
<!-- table 列表 --> <!-- table 列表 -->
<table-list-com ref="tableContainer" :tableData="tableDataList" :formColum="formColum" :tableDataTotal="total" :queryParams="queryParams" <table-list-com ref="tableContainer" :tableData="tableDataList" :formColum="formColum" :tableDataTotal="total" :queryParams="queryParams"
v-else-if="!tableLoading" :height="'100%'" @handle-current-change="handleCurrentChange"> v-else-if="!tableLoading" :maxHeight="'100%'" @handle-current-change="handleCurrentChange">
<!-- 项目列表 --> <!-- 项目列表 -->
<template slot="projectName" slot-scope="{data,row}"> <template slot="projectName" slot-scope="{data,row}">
<div v-if="row.projectName" class="no-line-feed" v-html="row.projectName">{{row.projectName}}</div> <div v-if="row.projectName" class="no-line-feed" v-html="row.projectName">{{row.projectName}}</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment