稳态报表功能适配台账

This commit is contained in:
cdf
2025-12-22 19:56:21 +08:00
parent 240ec304b0
commit 2894a4780b
7 changed files with 32 additions and 23 deletions

View File

@@ -100,7 +100,7 @@ public class CustomReportController extends BaseController {
@GetMapping("/getTemplateByDept")
@ApiOperation("根据部门查询模板")
@ApiImplicitParam(name = "id", value = "id", required = true)
public HttpResult<List<ReportTemplateVO>> getTemplateByDept(@RequestParam("id") String id){
public HttpResult<List<ReportTemplateVO>> getTemplateByDept(@RequestParam(value = "id",required = false) String id){
String methodDescribe = getMethodDescribe("getTemplateList");
List<ReportTemplateVO> list = customReportService.getTemplateByDept(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);

View File

@@ -375,7 +375,7 @@ public class CustomReportServiceImpl implements CustomReportService {
}
} else if (v.contains("start_time") && v.contains("end_time")){
//如时间是大于当前时间则用当前时间
LocalDate startDate = LocalDateTimeUtil.parseDate(queryParam.getSearchBeginTime(), DatePattern.NORM_DATE_PATTERN);
LocalDate startDate = LocalDateTimeUtil.parseDate(queryParam.getStartTime(), DatePattern.NORM_DATE_PATTERN);
LocalDate nowDate = LocalDate.now();
if (!nowDate.isAfter(startDate)) {
startDate = LocalDate.now();
@@ -383,11 +383,11 @@ public class CustomReportServiceImpl implements CustomReportService {
String startTime = LocalDateTimeUtil.format(startDate, DatePattern.NORM_DATE_PATTERN) + InfluxDbSqlConstant.START_TIME;
//如时间是大于当前时间则用当前时间
String localTime = InfluxDbSqlConstant.END_TIME;
LocalDate endDate = LocalDateTimeUtil.parseDate(queryParam.getSearchEndTime(), DatePattern.NORM_DATE_PATTERN);
LocalDate endDate = LocalDateTimeUtil.parseDate(queryParam.getEndTime(), DatePattern.NORM_DATE_PATTERN);
if (nowDate.isAfter(endDate)) {
localTime = " " + LocalTime.now().format(DatePattern.NORM_TIME_FORMATTER);
}
String endTime = queryParam.getSearchEndTime() + localTime;
String endTime = queryParam.getEndTime() + localTime;
String val = v.replace(STR_THREE, "").replace("start_time", startTime).replace("end_time", endTime);
son.putOpt(V, val);
@@ -1050,9 +1050,9 @@ public class CustomReportServiceImpl implements CustomReportService {
}
//时间范围处理
sql.append(InfluxDbSqlConstant.AND)
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.GE).append(InfluxDbSqlConstant.QM).append(queryParam.getSearchBeginTime()).append(InfluxDbSqlConstant.START_TIME).append(InfluxDbSqlConstant.QM)
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.GE).append(InfluxDbSqlConstant.QM).append(queryParam.getStartTime()).append(InfluxDbSqlConstant.START_TIME).append(InfluxDbSqlConstant.QM)
.append(InfluxDbSqlConstant.AND)
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.LT).append(InfluxDbSqlConstant.QM).append(queryParam.getSearchEndTime()).append(InfluxDbSqlConstant.END_TIME).append(InfluxDbSqlConstant.QM);
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.LT).append(InfluxDbSqlConstant.QM).append(queryParam.getEndTime()).append(InfluxDbSqlConstant.END_TIME).append(InfluxDbSqlConstant.QM);
System.out.println(sql);
List<Map<String, Object>> mapList = Collections.emptyList();
@@ -1130,6 +1130,8 @@ public class CustomReportServiceImpl implements CustomReportService {
Map<String, List<ReportTemplateDTO>> valueTypeMap = templateValue.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getStatMethod));
//每张表开启一个独立线程查询
futures.add(executorService.submit(() -> {
// 子线程中手动指定数据源(关键)
DynamicDataSourceContextHolder.push("sjzx");
//avg.max,min,cp95
valueTypeMap.forEach((valueTypeKey, valueTypeVal) -> {
//相别分组
@@ -1174,7 +1176,7 @@ public class CustomReportServiceImpl implements CustomReportService {
//处理台账信息
Map<String, String> finalTerminalMap;
if (CollUtil.isNotEmpty(terminalList)) {
finalTerminalMap = convertKeysToUpperCase(commTerminalGeneralClient.getCustomDetailByLineId(reportSearchParam.getLineId()).getData());
finalTerminalMap = convertKeysToUpperCase(csLineFeignClient.getCustomDetailByLineId(reportSearchParam.getLineId()).getData());
} else {
finalTerminalMap = new HashMap<>();
}

View File

@@ -33,6 +33,10 @@ spring:
refresh: true
main:
allow-bean-definition-overriding: true
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
#项目日志的配置
@@ -46,6 +50,8 @@ logging:
mybatis-plus:
#别名扫描
type-aliases-package: com.njcn.harmonic.pojo
global-config:
enable-sql-runner: true
mqtt:
client-id: @artifactId@${random.value}
client-id: @artifactId@${random.value}