提交代码
This commit is contained in:
@@ -180,7 +180,6 @@ logging:
|
|||||||
|
|
||||||
whitelist:
|
whitelist:
|
||||||
urls:
|
urls:
|
||||||
- /
|
|
||||||
- /user-boot/user/generateSm2Key
|
- /user-boot/user/generateSm2Key
|
||||||
- /user-boot/theme/getTheme
|
- /user-boot/theme/getTheme
|
||||||
- /user-boot/user/updateFirstPassword
|
- /user-boot/user/updateFirstPassword
|
||||||
@@ -199,6 +198,7 @@ whitelist:
|
|||||||
- /*/v2/api-docs
|
- /*/v2/api-docs
|
||||||
- /favicon.ico
|
- /favicon.ico
|
||||||
- /system-boot/theme/getTheme
|
- /system-boot/theme/getTheme
|
||||||
|
- /system-boot/image/toStream
|
||||||
- /cs-system-boot/appinfo/queryAppInfoByType
|
- /cs-system-boot/appinfo/queryAppInfoByType
|
||||||
#- /device-boot/**
|
#- /device-boot/**
|
||||||
#- /system-boot/**
|
#- /system-boot/**
|
||||||
|
|||||||
@@ -36,4 +36,6 @@ public interface CommonMapper extends InfluxDbBaseMapper<PowerQualityData> {
|
|||||||
|
|
||||||
@Select(value = "#{sql}",resultType = HarmonicHistoryData.class)
|
@Select(value = "#{sql}",resultType = HarmonicHistoryData.class)
|
||||||
List<HarmonicHistoryData> getHistoryResult(@Param("sql")String sql);
|
List<HarmonicHistoryData> getHistoryResult(@Param("sql")String sql);
|
||||||
|
|
||||||
|
List<StatisticalDataDTO> getTopTemperature(InfluxQueryWrapper influxQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ public class StatisticalDataDTO {
|
|||||||
@Column(name = "value_type")
|
@Column(name = "value_type")
|
||||||
private String valueType;
|
private String valueType;
|
||||||
|
|
||||||
|
@Column(name = "cl_did")
|
||||||
|
private String clDid;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指标值
|
* 指标值
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -68,4 +68,14 @@ public interface CommonService {
|
|||||||
* @return StatisticalDataDTO
|
* @return StatisticalDataDTO
|
||||||
*/
|
*/
|
||||||
StatisticalDataDTO selectBySql(StringBuilder sql);
|
StatisticalDataDTO selectBySql(StringBuilder sql);
|
||||||
|
/*获取各个模块温度数据*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param lineId
|
||||||
|
* @param tableName apf_data
|
||||||
|
* @param columnName Apf_Temp_Env
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StatisticalDataDTO> getTopTemperature(String lineId,String tableName, String columnName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,16 @@ public class CommonServiceImpl implements CommonService {
|
|||||||
return commonMapper.selectBySql(sql);
|
return commonMapper.selectBySql(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StatisticalDataDTO> getTopTemperature(String lineId, String tableName, String columnName) {
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
|
||||||
|
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||||
|
.select(StatisticalDataDTO::getClDid)
|
||||||
|
.last(columnName,InfluxDBTableConstant.VALUE)
|
||||||
|
.eq(InfluxDBTableConstant.LINE_ID,lineId).groupBy(InfluxDBTableConstant.CL_DID);
|
||||||
|
return commonMapper.getTopTemperature(influxQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/*表名换成了id本方法做转换*/
|
/*表名换成了id本方法做转换*/
|
||||||
private String getTableNameByClassId(String classId){
|
private String getTableNameByClassId(String classId){
|
||||||
DictData data = dicDataFeignClient.getDicDataById(classId).getData();
|
DictData data = dicDataFeignClient.getDicDataById(classId).getData();
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.njcn.system.controller;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.FileUtil;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||||
|
import com.njcn.device.pq.pojo.vo.DataScaleVO;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.core.io.InputStreamResource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/8/30 11:08【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "图片处理")
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/image")
|
||||||
|
public class ImageToStreamController extends BaseController {
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
/**
|
||||||
|
* 数据规模
|
||||||
|
*/
|
||||||
|
@GetMapping("/toStream")
|
||||||
|
@ApiImplicitParam(name = "bgImage", value = "图片路径", required = true)
|
||||||
|
public void toStream(@RequestParam("bgImage") String bgImage,HttpServletResponse response) {
|
||||||
|
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
FileInputStream fis = null;
|
||||||
|
BufferedInputStream bis = null;
|
||||||
|
try {
|
||||||
|
//获取部分参数,用于从minIO上将文件下载到tmp(此步骤不是必须)
|
||||||
|
InputStream fileStream = fileStorageUtil.getFileStream(bgImage);
|
||||||
|
|
||||||
|
response.setContentType("application/octet-stream");
|
||||||
|
response.setHeader("content-type", "image/png");
|
||||||
|
response.setHeader("Content-Disposition", "attachment;fileName=download" +System.currentTimeMillis() + "");// 设置文件名
|
||||||
|
//返回流处理
|
||||||
|
bis = new BufferedInputStream(fileStream);
|
||||||
|
OutputStream os = response.getOutputStream();
|
||||||
|
int i = bis.read(buffer);
|
||||||
|
while (i != -1) {
|
||||||
|
os.write(buffer, 0, i);
|
||||||
|
i = bis.read(buffer);
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
|
||||||
|
}finally {
|
||||||
|
if (bis != null) {
|
||||||
|
try {
|
||||||
|
bis.close();
|
||||||
|
} catch (IOException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fis != null) {
|
||||||
|
try {
|
||||||
|
fis.close();
|
||||||
|
} catch (IOException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.system.pojo.po.UserLog;
|
import com.njcn.system.pojo.po.UserLog;
|
||||||
import com.njcn.system.service.IUserLogService;
|
import com.njcn.system.service.IUserLogService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -63,7 +64,8 @@ public class UserLogController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||||
@PostMapping("/query")
|
@PostMapping("/query")
|
||||||
@ApiOperation("查询审计日志(治理模块)")
|
@ApiOperation("查询审计日志(治理模块)")
|
||||||
public HttpResult<List<UserLog>> queryUserLog() {
|
@ApiImplicitParam(name = "baseParam", value = "查询日志参数", required = true)
|
||||||
|
public HttpResult<List<UserLog>> queryUserLog(@RequestBody BaseParam baseParam) {
|
||||||
String methodDescribe = getMethodDescribe("queryUserLog");
|
String methodDescribe = getMethodDescribe("queryUserLog");
|
||||||
List<UserLog> list = userLogService.lambdaQuery().eq(UserLog::getLoginName, RequestUtil.getUsername()).
|
List<UserLog> list = userLogService.lambdaQuery().eq(UserLog::getLoginName, RequestUtil.getUsername()).
|
||||||
in(UserLog::getServiceName, Stream.of(ServerInfo.CS_DEVICE_BOOT,
|
in(UserLog::getServiceName, Stream.of(ServerInfo.CS_DEVICE_BOOT,
|
||||||
@@ -71,7 +73,8 @@ public class UserLogController extends BaseController {
|
|||||||
ServerInfo.CS_REPORT_BOOT,
|
ServerInfo.CS_REPORT_BOOT,
|
||||||
ServerInfo.CS_EVENT_BOOT,
|
ServerInfo.CS_EVENT_BOOT,
|
||||||
ServerInfo.CS_WARN_BOOT,
|
ServerInfo.CS_WARN_BOOT,
|
||||||
ServerInfo.CS_SYSTEM_BOOT).collect(Collectors.toList())).orderByDesc(UserLog::getCreateTime).last("limit 100").list();
|
ServerInfo.CS_SYSTEM_BOOT).collect(Collectors.toList())).between(UserLog::getCreateTime,baseParam.getSearchBeginTime(),baseParam.getSearchEndTime())
|
||||||
|
.orderByDesc(UserLog::getCreateTime).last("limit 100").list();
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user