From 6c0c3557e791dc46948190dd3745335ed043d051 Mon Sep 17 00:00:00 2001 From: 杜洪波 <1074825718@qq.com> Date: 星期三, 17 九月 2025 09:30:32 +0800 Subject: [PATCH] 代码提交 --- src/main/java/com/product/server/report/service/GenerateEChartService.java | 52 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/product/server/report/service/GenerateEChartService.java b/src/main/java/com/product/server/report/service/GenerateEChartService.java index 813c664..adf07be 100644 --- a/src/main/java/com/product/server/report/service/GenerateEChartService.java +++ b/src/main/java/com/product/server/report/service/GenerateEChartService.java @@ -17,6 +17,7 @@ import com.product.core.transfer.Transactional; import com.product.server.report.config.CmnConst; import com.product.server.report.config.ReportCode; +import com.product.server.report.config.SystemCode; import com.product.server.report.service.idel.IGenerateEChartService; import com.product.util.BaseUtil; import com.product.util.SystemParamReplace; @@ -104,21 +105,30 @@ // object.put("function",this.functionArray(uuid)); return object; } + sql_text = "SELECT user_id,SUM(countNo) countNo, type \n" + + "FROM ( \t\n" + + "\tSELECT receiver user_id,COUNT(receiver) countNo,'寰呭姙' as type \n" + + "\tFROM product_oa_cooperate_flow_node \n" + + "\tWHERE status IN (0,1) \n" + + "\tGROUP BY receiver \t\n" + + ") a \n" + + "WHERE user_id=13563 \n" + + "GROUP BY user_id,type"; DataTableEntity valueData = baseDao.listTable(sql_text,new Object[]{}); //鑾峰彇鎶ヨ〃閰嶇疆灞炴�ц〃 鍔爀charts閰嶇疆灞炴�� //鍙兘鏌ヨ鍒板叧鑱斿睘鎬у�肩殑灞炴�ц〃锛屽鏋滅埗绾у睘鎬т笅鏈夊涓浉鍚屽瓙灞炴�с�傞�氳繃grouping鍒嗙粍銆� - DataTableEntity attributeData = baseDao.listTable("SELECT a.field_name,a.report_type_attr_value,a.uuid,a.grouping ,b.* FROM product_sys_report_config_attribute a LEFT JOIN product_sys_report_type_attribute b on a.report_type_attr = b.uuid WHERE a.report_config_uuid = ? ORDER BY a.grouping,b.parentAttributeUuid " ,new Object[]{fse.getString(CmnConst.UUID)}); + DataTableEntity attributeData = baseDao.listTable("SELECT a.field_name,a.report_type_attr_value,a.uuid,a.grouping ,b.* FROM product_sys_report_config_attribute a LEFT JOIN product_sys_report_type_attribute b on a.report_type_attr = b.uuid WHERE a.report_config_uuid = ? ORDER BY a.grouping,b.parent_attribute_uuid " ,new Object[]{fse.getString(CmnConst.UUID)}); JSONObject allProperties = new JSONObject(); if(attributeData.getRows() > 0){ JSONObject propertyObject = new JSONObject(); - String parenUuid1 = attributeData.getString(0,"parentAttributeUuid"); + String parenUuid1 = attributeData.getString(0,"parent_attribute_uuid"); String grouping1 = attributeData.getString(0,"grouping"); for (int i = 0,length = attributeData.getRows(); i < length; i++) { FieldSetEntity fieldSet = attributeData.getFieldSetEntity(i); //涓婄骇uuid - String parenUuid2 = fieldSet.getString("parentAttributeUuid"); + String parenUuid2 = fieldSet.getString("parent_attribute_uuid"); //涓婄骇name - String parenName = fieldSet.getString("parentAttributeName"); + String parenName = fieldSet.getString("parent_attribute_name"); //鍥捐〃灞炴�у�� String attr_value = fieldSet.getString("report_type_attr_value"); //涓虹┖浼犻粯璁ゅ�� @@ -156,9 +166,9 @@ grouping1 = grouping2; //楗肩姸鍥炬彃鍏ユ暟鎹悓灞炰竴涓埗鍏冪礌 澶氫釜鍏冪礌鍜屽搴旂殑鏁版嵁闇�鍏ㄩ儴鎵惧嚭鏉ヤ竴璧峰皝瑁卝son if(!BaseUtil.strIsNull(fieldName)){ - String parentAttributeName = fieldSet.getString("parentAttributeName"); + String parentAttributeName = fieldSet.getString(CmnConst.PARENT_ATTRIBUTE_NAME); //涓嬬骇涓哄璞¤繕鏄暟缁� - String type = fieldSet.getString("subordinateElementType"); + String type = fieldSet.getString("subordinate_element_ype"); List<String> keys = ListUtils.newArrayList(); List<String> keys2 = ListUtils.newArrayList(); keys.add(fieldName); @@ -166,7 +176,7 @@ //涓烘渶鍚庝竴浣� while (i < length-1) { FieldSetEntity fieldSet2 = attributeData.getFieldSetEntity(i+1); - String parenUuid3 = fieldSet2.getString("parentAttributeUuid"); + String parenUuid3 = fieldSet2.getString("parent_attribute_uuid"); String fieldName3 = fieldSet2.getString(CmnConst.FIELD_NAME); if(parenUuid2.equals(parenUuid3) && !BaseUtil.strIsNull(fieldName3)){ keys.add(fieldName3); @@ -219,7 +229,7 @@ JSONArray objSubArray = obj.getJSONArray(attribute_name); //纭畾浠栫殑瀛愬睘鎬ф椂(1)array 杩樻槸(0)object // if(objSubArray == null){ - if ("1".equals(fieldSet.getString("subordinateElementType"))) { + if ("1".equals(fieldSet.getString(CmnConst.SUBORDINATE_ELEMENT_TYPE))) { JSONArray array = new JSONArray(); array.add(obj); superiorObj.put(attribute_name, array); @@ -230,9 +240,9 @@ // superiorObj = obj; // } //涓婄骇灞炴�ame - superiorUuid = fieldSet.getString("parentAttributeUuid"); + superiorUuid = fieldSet.getString(CmnConst.PARENT_ATTRIBUTE_UUID); //涓婄骇鍚嶇О - String parentAttributeName = fieldSet.getString("parentAttributeName"); + String parentAttributeName = fieldSet.getString(CmnConst.PARENT_ATTRIBUTE_NAME); //濡傛灉鐖跺厓绱爑uid涓虹┖ if(BaseUtil.strIsNull(superiorUuid)){ JSONArray allSubProperties = allProperties.getJSONArray(attribute_name); @@ -527,7 +537,13 @@ */ @Transactional @Override - public List<String> releaseConfig(FieldSetEntity fse, String module_uuid, String parentCode) { + public List<String> releaseConfig(FieldSetEntity fse, String parentModuleUUID) { + + //鑾峰彇鎸囧畾鍙戝竷鐩綍淇℃伅 + FieldSetEntity fseParentModuleData = baseDao.getFieldSetEntity(CmnConst.PRODUCT_SYS_FUNCTIONS, parentModuleUUID, false); + if (fseParentModuleData == null) { + throw new BaseException(SystemCode.PUBLISH_REPORT_FAIL_MODULE_NO_EXIST.getValue(), SystemCode.PUBLISH_REPORT_FAIL_MODULE_NO_EXIST.getText()); + } FieldSetEntity fseReport=baseDao.getFieldSetEntity(CmnConst.PRODUCT_SYS_REPORT_CONFIG, fse.getUUID(), false); @@ -536,11 +552,10 @@ fseFunction.setTableName(CmnConst.PRODUCT_SYS_FUNCTIONS); //1.鍒涘缓MVC(绯荤粺MVC鐩綍涓�) //鐢熸垚鍔熻兘缂栫爜 - codeService.createCode(fseFunction,CmnConst.PRODUCT_SYS_FUNCTIONS, CmnConst.TRICODE, parentCode); + codeService.createCode(fseFunction,CmnConst.PRODUCT_SYS_FUNCTIONS, CmnConst.TRICODE, fseParentModuleData.getString(CmnConst.TRICODE)); String function_tricode=fseFunction.getString(CmnConst.TRICODE); fseFunction.setTableName(CmnConst.PRODUCT_SYS_FUNCTIONS); fseFunction.setValue(CmnConst.TRICODE, function_tricode); //鍔熻兘缂栫爜 - fseFunction.setValue(CmnConst.MODULE_UUID, module_uuid); //鎵�灞炴ā鍧桿UID fseFunction.setValue(CmnConst.TABLE_UUID, CmnConst.PRODUCT_SYS_REPORT_CONFIG); //鍔熻兘鍏宠仈琛� fseFunction.setValue(CmnConst.FUNCTION_NAME, fseReport.getString(CmnConst.REPORT_NAME)); //鍔熻兘鍚嶇О fseFunction.setValue(CmnConst.FUNCTION_DESCRIPTION, fseReport.getString(CmnConst.REPORT_NAME)); //鍔熻兘鎻忚堪 @@ -548,7 +563,7 @@ fseFunction.setValue(CmnConst.FUNCTION_TYPE_UUID, 1); //鍔熻兘绫诲瀷-涓氬姟鍔熻兘 fseFunction.setValue(CmnConst.CLIENT_TYPE_UUID, "web"); //瀹㈡埛绔被鍨� fseFunction.setValue(CmnConst.VERSION_UUID, "001"); //鐗堟湰uuid - fseFunction.setValue(CmnConst.TRICODE_PARENT, parentCode); + fseFunction.setValue(CmnConst.TRICODE_PARENT, fseParentModuleData.getString(CmnConst.TRICODE)); fseFunction.setValue("data_type", 1); //绫诲瀷 1涓哄姛鑳� BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fseFunction); @@ -674,12 +689,15 @@ Integer pageSize = fieldSetEntity.getInteger(CmnConst.PAGE_SIZE); StringBuffer sql = new StringBuffer(); // sql.append(" select * from ( ") - sql.append(" select rc.uuid,rc.report_name,'鍥捐〃' type_name,t1.role_info,mp.menu_name tricode_parent,m.menu_icon,m.menu_name,rc.function_uuid ") + sql.append(" select rc.uuid,rc.report_name,'鍥捐〃' type_name,mp.menu_name tricode_parent,m.menu_icon,m.menu_name,rc.function_uuid ") +// sql.append(" select rc.uuid,rc.report_name,'鍥捐〃' type_name,t1.role_info,mp.menu_name tricode_parent,m.menu_icon,m.menu_name,rc.function_uuid ") .append(" FROM product_sys_report_config rc ") .append(" inner join ( ") - .append(" select function_uuid,group_concat(role_info separator ',') role_info ") + .append(" select function_uuid ") +// .append(" select function_uuid,group_concat(role_info separator ',') role_info ") //Duird瑙f瀽涓嶄簡杩欎釜鍑芥暟鐢ㄦ硶 .append(" from ( ") - .append(" select function_uuid,concat(c.client_name,'/',o.org_level_name,'/',role_name) role_info ") +// .append(" select function_uuid,concat(c.client_name,'/',o.org_level_name,'/',role_name) role_info ") + .append(" select function_uuid ") .append(" FROM product_sys_clients c ") .append(" inner join product_sys_org_levels o on o.client_uuid=c.uuid ") .append(" inner join ( ") -- Gitblit v1.9.2