switch (destSystemName) { case SystemEnum.DW:// if(StringUtils.isNoneBlank(majorTableName)){ postJsonMap.put(majorTableName,majorRows); } if(StringUtils.isNoneBlank(subTableName)){ postJsonMap.put(subTableName,subRows); } break; case SystemEnum.JM:// break; case SystemEnum.SL:// Map<String, String> messageHeader = new HashMap<String, String>(); messageHeader.put("Receiver", "1011"); messageHeader.put("SendDate", "20210225"); messageHeader.put("SendTime", "103202"); messageHeader.put("Flag", "0"); messageHeader.put("Msg", ""); postJsonMap.put("MessageHeader", messageHeader);//约定的消息头 List<Map<String, Object>> majorColumnInfos;//主表列元数据 List<Map<String, Object>> subColumnInfos;//子表列元数据 List<Map<String, Object>> tables = new ArrayList<Map<String, Object>>();//格式中的Tables内容(根据约定由两个元素) Map<String, Object> table0 = new HashMap<String, Object>();//Tables中的元素1 Map<String, Object> table1 = new HashMap<String, Object>();//Tables中的元素2 if (StringUtils.isNoneBlank(majorTableName)) {//获取主表列元数据 Map<String, Object> tableNameParams = new HashMap<>(); tableNameParams.put("tableName", majorTableName); majorColumnInfos = this.commonMapper.selectMetaCloumnByTableName(tableNameParams);//获取主表列元数据 table0.put("Name", "BODY"); table0.put("Columns", majorColumnInfos); if (CollectionUtils.isNotEmpty(majorRows)) { table0.put("Rows", majorRows); tables.add(table0); postJsonMap.put("Tables", tables); } } if (StringUtils.isNoneBlank(subTableName)) {//获取子表列元数据 Map<String, Object> tableNameParams = new HashMap<>(); tableNameParams.put("tableName", subTableName); subColumnInfos = this.commonMapper.selectMetaCloumnByTableName(tableNameParams);//获取明细表列元数据 table1.put("Name", "detail"); table1.put("Columns", subColumnInfos); if (CollectionUtils.isNotEmpty(majorRows)) { table1.put("Rows", subRows); tables.add(table1); } } break; default://默认目标格式 System.out.println("未知平台");
java switch 语句
最新推荐文章于 2022-09-25 23:01:18 发布