杜洪波
4 天以前 3b6b2e8d625b3d9dfc1a819b52e23da1a493506e
src/main/java/com/product/server/report/service/GenerateEChartService.java
@@ -117,9 +117,6 @@
        sql.append("WHERE a.report_config_uuid = ? \n");
        sql.append("ORDER BY a.group_sign,b.parent_attribute_uuid");
        DataTableEntity attributeData = baseDao.listTable(sql.toString() ,new Object[]{fse.getString(CmnConst.UUID)});
        if ("13081b93-bd02-4319-a423-e3000cd9e9b4".equals(fse.getUUID())) {
         System.out.println("");
      }
        // 创建图表属性容器
        JSONObject allProperties = new JSONObject();
        if(!BaseUtil.dataTableIsEmpty(attributeData)){
@@ -130,9 +127,6 @@
                FieldSetEntity fseAttr = attributeData.getFieldSetEntity(i);
                // 图表属性和配置值
                String attrName = fseAttr.getString(CmnConst.ATTRIBUTE_NAME);
                if("show".equals(attrName)) {
                   System.out.println();
                }
                String attrValue = fseAttr.getString(CmnConst.REPORT_TYPE_ATTR_VALUE);
                if(BaseUtil.strIsNull(attrValue)){
                   // 配置值为空则用默认值
@@ -330,7 +324,22 @@
                        if(theOriginalData == null){
                            currentProperty.put(attribute_name,arr);
                        }else {
                            theOriginalData.add(arr.getJSONObject(arr.size()-1));
                           JSONObject lastJSONObject = theOriginalData.getJSONObject(theOriginalData.size() - 1);
                           JSONObject insertJsonObject = arr.getJSONObject(arr.size()-1);
                           for (String key : insertJsonObject.keySet()) {
                                if (lastJSONObject.containsKey(key)) {
                                    // key已存在,新建对象
                                   theOriginalData.add(insertJsonObject);
                                    break;
                                } else {
                                    // key不存在,合并
                                   lastJSONObject.putAll(insertJsonObject);
                                    break;
                                }
                            }
//                           theOriginalData.getJSONObject(theOriginalData.size() - 1)
//                            .putAll(JSONObject.parseObject(arr.getJSONObject(arr.size()-1).toJSONString()));
//                            theOriginalData.add(arr.getJSONObject(arr.size()-1));
                        }
                    }else {
@@ -432,7 +441,7 @@
                oArray[0] = subObj;
            }
        }else {
            oArray[0] = attr_value;
            oArray[0] = SystemParamReplace.systemParamsReplace(attr_value);
        }
        return oArray;
    }