|
@@ -3,6 +3,7 @@ package com.example.opc_da.service.impl;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.example.opc_common.entity.Print;
|
|
|
import com.example.opc_common.entity.PrintConfig;
|
|
|
+import com.example.opc_common.entity.ReportTable;
|
|
|
import com.example.opc_common.enums.ResultEnum;
|
|
|
import com.example.opc_common.util.Blank;
|
|
|
import com.example.opc_common.util.ConstantStr;
|
|
@@ -126,6 +127,17 @@ public class PrintServiceImpl implements PrintService {
|
|
|
|
|
|
@Override
|
|
|
public Result getPrintConfigByTableId(String reportTableId) {
|
|
|
+ ReportTable reportTable = reportTableDao.getReportTableById(reportTableId);
|
|
|
+ if (Blank.isEmpty(reportTable)) {
|
|
|
+ return Result.ok(new PrintConfig());
|
|
|
+ }
|
|
|
+ Integer reportTableType = reportTable.getReportTableType();
|
|
|
+ if (reportTableType.equals(ConstantStr.AUTOMATIC_GENERATE_REPORT) ||
|
|
|
+ reportTableType.equals(ConstantStr.EVENT_GENERATE_REPORT) ||
|
|
|
+ reportTableType.equals(ConstantStr.DEVICE_GENERATE_REPORT)) {
|
|
|
+ ReportTable mainReportTable = reportTableDao.getMainTableBychTableId(reportTableId);
|
|
|
+ reportTableId = mainReportTable.getId();
|
|
|
+ }
|
|
|
Print print = printDao.getPrintByReportId(reportTableId);
|
|
|
if (Blank.isEmpty(print)) {
|
|
|
return Result.ok(new PrintConfig());
|