zhoupeng 2 years ago
parent
commit
ed3ef38b49

+ 7 - 4
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/service/impl/ReportTableServiceImpl.java

@@ -189,14 +189,17 @@ public class ReportTableServiceImpl implements ReportTableService {
         if (Blank.isNotEmpty(userGroupList)) {
             reportTable.setUserGroupList(userGroupList);
         }
-        if (reportTable.getIsAutoReport() == ConstantStr.EVENT_DRIVEN_REPORT){
+        if (reportTable.getIsAutoReport() == ConstantStr.EVENT_DRIVEN_REPORT) {
             List<ItemGroup> itemGroupList = itemGroupDao.getItemGroupListByTableId(id);
             if (Blank.isNotEmpty(itemGroupList)) {
-                for (ItemGroup itemGroup : itemGroupList) {
-                    if (itemGroup.getRunState() == ConstantStr.START_UP) {
-                        return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "此报表作为事件驱动报表,已被配置在数据组上了,请撤销后再试");
+                String message = "";
+                for (int i = 0; i < itemGroupList.size(); i++) {
+                    message += itemGroupList.get(i).getGroupName();
+                    if (i != itemGroupList.size() - 1) {
+                        message += ",";
                     }
                 }
+                return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "事件驱动报表被配置在【" + message + "】数据组中,不能直接转换");
             }
         }
         if (isAutoReport == ConstantStr.AUTOMATIC_REPORT) {