资产负债表、利润表、经营现金流、统计指标计算程序
1、资产负债表
package com.sankuai.qinling.data.mmp.biz.bo;import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;import java.math.BigDecimal;/*** 东方财富资产负债表数据BO** @author system* @date 2024-12-19*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class EastMoneyBalanceSheetDataBo {/*** 证券代码,002594.SZ*/@JsonProperty("SECUCODE")private String secuCode;/*** 证券简称,002594*/@JsonProperty("SECURITY_CODE")private String securityCode;/*** 证券名称简称,比亚迪*/@JsonProperty("SECURITY_NAME_ABBR")private String securityNameAbbr;/*** 机构代码,10010554*/@JsonProperty("ORG_CODE")private String orgCode;/*** 机构类型,通用*/@JsonProperty("ORG_TYPE")private String orgType;/*** 报告日期,2025-03-31 00:00:00*/@JsonProperty("REPORT_DATE")private String reportDate;/*** 报告类型,一季报*/@JsonProperty("REPORT_TYPE")private String reportType;/*** 报告日期名称,2025一季报*/@JsonProperty("REPORT_DATE_NAME")private String reportDateName;/*** 证券类型代码,058001001*/@JsonProperty("SECURITY_TYPE_CODE")private String securityTypeCode;/*** 公告日期,2025-04-26 00:00:00*/@JsonProperty("NOTICE_DATE")private String noticeDate;/*** 更新日期,2025-04-26 00:00:00*/@JsonProperty("UPDATE_DATE")private String updateDate;/*** 货币单位,CNY*/@JsonProperty("CURRENCY")private String currency;// ========== 资产类科目 ==========/*** 货币资金,117406726000*/@JsonProperty("MONETARYFUNDS")private BigDecimal monetaryFunds;/*** 交易性金融资产,35984229000*/@JsonProperty("TRADE_FINASSET_NOTFVTPL")private BigDecimal tradeFinassetNotfvtpl;/*** 衍生金融资产,118106000*/@JsonProperty("DERIVE_FINASSET")private BigDecimal deriveFinasset;/*** 应收票据,null*/@JsonProperty("NOTE_RECE")private BigDecimal noteRece;/*** 应收账款,53182767000*/@JsonProperty("ACCOUNTS_RECE")private BigDecimal accountsRece;/*** 应收票据及应收账款,53182767000*/@JsonProperty("NOTE_ACCOUNTS_RECE")private BigDecimal noteAccountsRece;/*** 应收款项融资,5736785000*/@JsonProperty("FINANCE_RECE")private BigDecimal financeRece;/*** 预付款项,5182250000*/@JsonProperty("PREPAYMENT")private BigDecimal prepayment;/*** 其他应收款合计,3634755000*/@JsonProperty("TOTAL_OTHER_RECE")private BigDecimal totalOtherRece;/*** 存货,154373616000*/@JsonProperty("INVENTORY")private BigDecimal inventory;/*** 合同资产,1406810000*/@JsonProperty("CONTRACT_ASSET")private BigDecimal contractAsset;/*** 一年内到期的非流动资产,11405482000*/@JsonProperty("NONCURRENT_ASSET_1YEAR")private BigDecimal noncurrentAsset1year;/*** 其他流动资产,21483112000*/@JsonProperty("OTHER_CURRENT_ASSET")private BigDecimal otherCurrentAsset;/*** 流动资产合计,409994229000*/@JsonProperty("TOTAL_CURRENT_ASSETS")private BigDecimal totalCurrentAssets;/*** 长期应收款,10006386000*/@JsonProperty("LONG_RECE")private BigDecimal longRece;/*** 长期股权投资,19630668000*/@JsonProperty("LONG_EQUITY_INVEST")private BigDecimal longEquityInvest;/*** 其他权益工具投资,8268838000*/@JsonProperty("OTHER_EQUITY_INVEST")private BigDecimal otherEquityInvest;/*** 其他非流动金融资产,2892352000*/@JsonProperty("OTHER_NONCURRENT_FINASSET")private BigDecimal otherNoncurrentFinasset;/*** 投资性房地产,59801000*/@JsonProperty("INVEST_REALESTATE")private BigDecimal investRealestate;/*** 固定资产,269814106000*/@JsonProperty("FIXED_ASSET")private BigDecimal fixedAsset;/*** 在建工程,25668828000*/@JsonProperty("CIP")private BigDecimal cip;/*** 使用权资产,10247504000*/@JsonProperty("USERIGHT_ASSET")private BigDecimal userightAsset;/*** 无形资产,40143957000*/@JsonProperty("INTANGIBLE_ASSET")private BigDecimal intangibleAsset;/*** 开发支出,859988000*/@JsonProperty("DEVELOP_EXPENSE")private BigDecimal developExpense;/*** 商誉,4427571000*/@JsonProperty("GOODWILL")private BigDecimal goodwill;/*** 长期待摊费用,4812800000*/@JsonProperty("LONG_PREPAID_EXPENSE")private BigDecimal longPrepaidExpense;/*** 递延所得税资产,9308768000*/@JsonProperty("DEFER_TAX_ASSET")private BigDecimal deferTaxAsset;/*** 其他非流动资产,24391349000*/@JsonProperty("OTHER_NONCURRENT_ASSET")private BigDecimal otherNoncurrentAsset;/*** 非流动资产合计,430532916000*/@JsonProperty("TOTAL_NONCURRENT_ASSETS")private BigDecimal totalNoncurrentAssets;/*** 资产总计,840527145000*/@JsonProperty("TOTAL_ASSETS")private BigDecimal totalAssets;// ========== 负债类科目 ==========/*** 短期借款,13144785000*/@JsonProperty("SHORT_LOAN")private BigDecimal shortLoan;/*** 衍生金融负债,0*/@JsonProperty("DERIVE_FINLIAB")private BigDecimal deriveFinliab;/*** 应付票据,1889615000*/@JsonProperty("NOTE_PAYABLE")private BigDecimal notePayable;/*** 应付账款,250772811000*/@JsonProperty("ACCOUNTS_PAYABLE")private BigDecimal accountsPayable;/*** 应付票据及应付账款,252662426000*/@JsonProperty("NOTE_ACCOUNTS_PAYABLE")private BigDecimal noteAccountsPayable;/*** 合同负债,46141085000*/@JsonProperty("CONTRACT_LIAB")private BigDecimal contractLiab;/*** 应付职工薪酬,21714175000*/@JsonProperty("STAFF_SALARY_PAYABLE")private BigDecimal staffSalaryPayable;/*** 应交税费,7476567000*/@JsonProperty("TAX_PAYABLE")private BigDecimal taxPayable;/*** 其他应付款,143466215000*/@JsonProperty("TOTAL_OTHER_PAYABLE")private BigDecimal totalOtherPayable;/*** 一年内到期的非流动负债,12000950000*/@JsonProperty("NONCURRENT_LIAB_1YEAR")private BigDecimal noncurrentLiab1year;/*** 其他流动负债,5319828000*/@JsonProperty("OTHER_CURRENT_LIAB")private BigDecimal otherCurrentLiab;/*** 预计流动负债,3871044000*/@JsonProperty("PREDICT_CURRENT_LIAB")private BigDecimal predictCurrentLiab;/*** 流动负债合计,505797075000*/@JsonProperty("TOTAL_CURRENT_LIAB")private BigDecimal totalCurrentLiab;/*** 长期借款,6339145000*/@JsonProperty("LONG_LOAN")private BigDecimal longLoan;/*** 租赁负债,9643092000*/@JsonProperty("LEASE_LIAB")private BigDecimal leaseLiab;/*** 递延所得税负债,2500174000*/@JsonProperty("DEFER_TAX_LIAB")private BigDecimal deferTaxLiab;/*** 其他非流动负债,70086094000*/@JsonProperty("OTHER_NONCURRENT_LIAB")private BigDecimal otherNoncurrentLiab;/*** 非流动负债合计*/@JsonProperty("TOTAL_NONCURRENT_LIAB")private BigDecimal totalNoncurrentLiab;/*** 负债合计,88568505000*/@JsonProperty("TOTAL_LIABILITIES")private BigDecimal totalLiabilities;// ========== 所有者权益类科目 ==========/*** 实收资本(或股本),3039066000*/@JsonProperty("SHARE_CAPITAL")private BigDecimal shareCapital;/*** 其他权益工具,15000000000*/@JsonProperty("OTHER_EQUITY_TOOL")private BigDecimal otherEquityTool;/*** 其中:永续债,15000000000*/@JsonProperty("PERPETUAL_BOND")private BigDecimal perpetualBond;/*** 资本公积,99569473000*/@JsonProperty("CAPITAL_RESERVE")private BigDecimal capitalReserve;/*** 减:库存股,723968000*/@JsonProperty("TREASURY_SHARES")private BigDecimal treasuryShares;/*** 其他综合收益,1197714000*/@JsonProperty("OTHER_COMPRE_INCOME")private BigDecimal otherCompreIncome;/*** 专项储备,30606000*/@JsonProperty("SPECIAL_RESERVE")private BigDecimal specialReserve;/*** 盈余公积,7374087000*/@JsonProperty("SURPLUS_RESERVE")private BigDecimal surplusReserve;/*** 未分配利润,107874344000*/@JsonProperty("UNASSIGN_RPOFIT")private BigDecimal unassignRpofit;/*** 归属于母公司股东权益合计,233361322000*/@JsonProperty("TOTAL_PARENT_EQUITY")private BigDecimal totalParentEquity;/*** 少数股东权益,12800243000*/@JsonProperty("MINORITY_EQUITY")private BigDecimal minorityEquity;/*** 股东权益合计,246161565000*/@JsonProperty("TOTAL_EQUITY")private BigDecimal totalEquity;/*** 负债和股东权益总计,840527145000*/@JsonProperty("TOTAL_LIAB_EQUITY")private BigDecimal totalLiabEquity;// ========== 同比增长率字段 ==========/*** 货币资金同比增长率*/@JsonProperty("MONETARYFUNDS_YOY")private BigDecimal monetaryFundsYoy;/*** 应收账款同比增长率*/@JsonProperty("ACCOUNTS_RECE_YOY")private BigDecimal accountsReceYoy;/*** 存货同比增长率*/@JsonProperty("INVENTORY_YOY")private BigDecimal inventoryYoy;/*** 固定资产同比增长率*/@JsonProperty("FIXED_ASSET_YOY")private BigDecimal fixedAssetYoy;/*** 资产总计同比增长率*/@JsonProperty("TOTAL_ASSETS_YOY")private BigDecimal totalAssetsYoy;/*** 应付账款同比增长率*/@JsonProperty("ACCOUNTS_PAYABLE_YOY")private BigDecimal accountsPayableYoy;/*** 负债合计同比增长率*/@JsonProperty("TOTAL_LIABILITIES_YOY")private BigDecimal totalLiabilitiesYoy;/*** 所有者权益合计同比增长率*/@JsonProperty("TOTAL_EQUITY_YOY")private BigDecimal totalEquityYoy;/*** 归属于母公司所有者权益合计同比增长率*/@JsonProperty("TOTAL_PARENT_EQUITY_YOY")private BigDecimal totalParentEquityYoy;// ========== 其他字段 ==========/*** 审计意见类型*/@JsonProperty("OPINION_TYPE")private String opinionType;/*** 上市状态*/@JsonProperty("LISTING_STATE")private String listingState;
}package com.sankuai.qinling.data.mmp.biz.service.impl;import com.fasterxml.jackson.databind.ObjectMapper;
import com.sankuai.csc.common.tool.JsonUtils;
import com.sankuai.csc.common.tool.log.JsonLogUtil;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyBalanceSheetApiResponseBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyBalanceSheetDataBo;
import com.sankuai.qinling.data.mmp.biz.service.EastMoneyBalanceSheetService;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Service;import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;/*** 东方财富资产负债表数据服务实现类** @author system* @date 2024-12-19*/
@Service
public class EastMoneyBalanceSheetServiceImpl implements EastMoneyBalanceSheetService {/*** 东方财富资产负债表API基础URL*/private static final String BALANCE_SHEET_BASE_URL = "https://datacenter.eastmoney.com/securities/api/data/get";/*** 资产负债表报告名称*/private static final String BALANCE_SHEET_REPORT_NAME = "RPT_F10_FINANCE_GBALANCE";/*** 资产负债表报告样式*/private static final String BALANCE_SHEET_STYLE = "F10_FINANCE_GBALANCE";/*** HTTP客户端*/private final CloseableHttpClient httpClient;/*** JSON对象映射器*/private final ObjectMapper objectMapper;public EastMoneyBalanceSheetServiceImpl() {// 配置请求超时时间RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setConnectionRequestTimeout(30000).build();this.httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();this.objectMapper = new ObjectMapper();}@Overridepublic List<EastMoneyBalanceSheetDataBo> getBalanceSheetDataBySecuCodeAndReportDates(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) throws Exception {System.out.println("开始获取资产负债表数据, secuCode: " + secuCode + ", pageNumber: " + pageNumber + ", pageSize: " + pageSize + ", reportDateList: " + JsonLogUtil.createLogObject(reportDateList));EastMoneyBalanceSheetApiResponseBo response = getBalanceSheetApiResponse(secuCode, pageNumber, pageSize, reportDateList);if (response == null || response.getResult() == null || response.getResult().getData() == null) {System.out.println("获取资产负债表数据为空, secuCode: " + secuCode);return Collections.emptyList();}List<EastMoneyBalanceSheetDataBo> dataList = response.getResult().getData();System.out.println("成功获取资产负债表数据, secuCode: " + secuCode + ", 数据条数: " + dataList.size());return dataList;}@Overridepublic EastMoneyBalanceSheetApiResponseBo getBalanceSheetApiResponse(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) throws Exception {// 参数校验if (StringUtils.isBlank(secuCode)) {throw new IllegalArgumentException("证券代码不能为空");}if (pageNumber == null || pageNumber < 1) {pageNumber = 1;}if (pageSize == null || pageSize < 1) {pageSize = 5;}if (reportDateList == null || reportDateList.isEmpty()) {throw new IllegalArgumentException("报告日期列表不能为空");}try {// 构建请求URLString url = buildRequestUrl(secuCode, pageNumber, pageSize, reportDateList);System.out.println("开始调用东方财富资产负债表API, url: " + url);// 创建HTTP GET请求HttpGet httpGet = new HttpGet(url);httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36");// 发送请求CloseableHttpResponse response = httpClient.execute(httpGet);try {int statusCode = response.getStatusLine().getStatusCode();System.out.println("东方财富资产负债表API调用完成, 状态码: " + statusCode);// 检查响应状态if (statusCode != 200) {throw new RuntimeException("API调用失败, 状态码: " + statusCode);}// 获取响应内容HttpEntity entity = response.getEntity();String responseBody = EntityUtils.toString(entity, StandardCharsets.UTF_8);System.out.println("响应长度: " + responseBody.length());System.out.println("API响应内容: " + responseBody);EastMoneyBalanceSheetApiResponseBo apiResponse = objectMapper.readValue(responseBody, EastMoneyBalanceSheetApiResponseBo.class);// 检查业务响应if (apiResponse == null || !Boolean.TRUE.equals(apiResponse.getSuccess())) {String errorMsg = apiResponse != null ? apiResponse.getMessage() : "未知错误";throw new RuntimeException("API业务调用失败: " + errorMsg);}System.out.println("成功解析资产负债表API响应, 总记录数: " +(apiResponse.getResult() != null ? apiResponse.getResult().getCount() : 0) +", 总页数: " + (apiResponse.getResult() != null ? apiResponse.getResult().getPages() : 0));return apiResponse;} finally {response.close();}} catch (IOException e) {System.out.println("调用东方财富资产负债表API发生IO异常, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("网络请求异常: " + e.getMessage(), e);} catch (Exception e) {System.out.println("调用东方财富资产负债表API发生未知异常, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("系统异常: " + e.getMessage(), e);}}/*** 构建请求URL** @param secuCode 证券代码* @param pageNumber 页码* @param pageSize 每页大小* @param reportDateList 报告日期列表* @return 完整的请求URL*/private String buildRequestUrl(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) {try {// 构建证券代码过滤条件String secuCodeFilter = String.format("(SECUCODE=\"%s\")", secuCode);// 构建报告日期过滤条件String reportDateFilter = reportDateList.stream().map(date -> String.format("'%s'", date)).collect(Collectors.joining(",", "(REPORT_DATE in (", "))"));// 组合过滤条件String combinedFilter = secuCodeFilter + reportDateFilter;// URL编码过滤条件String encodedFilter = URLEncoder.encode(combinedFilter, StandardCharsets.UTF_8.toString());// 构建完整URLString url = String.format("%s?type=%s&sty=%s&filter=%s&p=%d&ps=%d&sr=-1&st=REPORT_DATE&source=HSF10&client=PC&v=%s",BALANCE_SHEET_BASE_URL, BALANCE_SHEET_REPORT_NAME, BALANCE_SHEET_STYLE, encodedFilter, pageNumber, pageSize, generateVersion());System.out.println("构建的请求URL: " + url);return url;} catch (Exception e) {System.out.println("构建请求URL失败, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("构建请求URL失败: " + e.getMessage(), e);}}/*** 生成版本号** @return 版本号字符串*/private String generateVersion() {// 生成一个简单的版本号,可以使用时间戳或随机数return String.valueOf(System.currentTimeMillis() % 100000000000000L);}/*** 测试方法** @param args 命令行参数*/public static void main(String[] args) {EastMoneyBalanceSheetServiceImpl service = new EastMoneyBalanceSheetServiceImpl();try {// 测试参数String secuCode = "002594.SZ";Integer pageNumber = 1;Integer pageSize = 5;List<String> reportDateList = Arrays.asList("2025-03-31", "2024-12-31", "2024-09-30");System.out.println("开始测试获取资产负债表数据, secuCode: " + secuCode +", pageNumber: " + pageNumber +", pageSize: " + pageSize +", reportDateList: " + reportDateList);// 调用方法获取资产负债表数据List<EastMoneyBalanceSheetDataBo> balanceSheetDataList = service.getBalanceSheetDataBySecuCodeAndReportDates(secuCode, pageNumber, pageSize, reportDateList);System.out.println("资产负债表数据详情:");System.out.println(JsonUtils.toJSONString(balanceSheetDataList));if (balanceSheetDataList != null && !balanceSheetDataList.isEmpty()) {System.out.println("成功获取资产负债表数据, 总条数: " + balanceSheetDataList.size());// 打印前几条数据作为示例for (int i = 0; i < Math.min(3, balanceSheetDataList.size()); i++) {EastMoneyBalanceSheetDataBo data = balanceSheetDataList.get(i);System.out.println("第" + (i + 1) + "条数据 - 证券代码: " + data.getSecuCode() +", 证券名称: " + data.getSecurityNameAbbr() +", 报告日期: " + data.getReportDate() +", 资产总计: " + data.getTotalAssets() +", 负债合计: " + data.getTotalLiabilities() +", 所有者权益合计: " + data.getTotalEquity());}} else {System.out.println("未获取到资产负债表数据");}} catch (Exception e) {System.err.println("测试获取资产负债表数据失败, error: " + e.getMessage());e.printStackTrace();}}
}
2、利润表
package com.sankuai.qinling.data.mmp.biz.bo;import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;import java.math.BigDecimal;/*** 东方财富利润表数据BO** @author system* @date 2024-12-19*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class EastMoneyIncomeStatementDataBo {/*** 证券代码,002594.SZ*/@JsonProperty("SECUCODE")private String secuCode;/*** 证券简称,002594*/@JsonProperty("SECURITY_CODE")private String securityCode;/*** 证券名称简称,比亚迪*/@JsonProperty("SECURITY_NAME_ABBR")private String securityNameAbbr;/*** 机构代码,10010554*/@JsonProperty("ORG_CODE")private String orgCode;/*** 机构类型,通用*/@JsonProperty("ORG_TYPE")private String orgType;/*** 报告日期,2025-03-31 00:00:00*/@JsonProperty("REPORT_DATE")private String reportDate;/*** 报告类型,一季报*/@JsonProperty("REPORT_TYPE")private String reportType;/*** 报告日期名称,2025一季报*/@JsonProperty("REPORT_DATE_NAME")private String reportDateName;/*** 证券类型代码,058001001*/@JsonProperty("SECURITY_TYPE_CODE")private String securityTypeCode;/*** 公告日期,2025-04-26 00:00:00*/@JsonProperty("NOTICE_DATE")private String noticeDate;/*** 更新日期,2025-04-26 00:00:00*/@JsonProperty("UPDATE_DATE")private String updateDate;/*** 货币单位,CNY*/@JsonProperty("CURRENCY")private String currency;// ========== 收入类科目 ==========/*** 营业总收入,170360448000*/@JsonProperty("TOTAL_OPERATE_INCOME")private BigDecimal totalOperateIncome;/*** 营业总收入同比增长率,36.3490097119*/@JsonProperty("TOTAL_OPERATE_INCOME_YOY")private BigDecimal totalOperateIncomeYoy;/*** 营业收入,170360448000*/@JsonProperty("OPERATE_INCOME")private BigDecimal operateIncome;/*** 营业收入同比增长率,36.3490097119*/@JsonProperty("OPERATE_INCOME_YOY")private BigDecimal operateIncomeYoy;/*** 利息收入,null*/@JsonProperty("INTEREST_INCOME")private BigDecimal interestIncome;/*** 利息收入同比增长率,null*/@JsonProperty("INTEREST_INCOME_YOY")private BigDecimal interestIncomeYoy;/*** 已赚保费,null*/@JsonProperty("EARNED_PREMIUM")private BigDecimal earnedPremium;/*** 已赚保费同比增长率,null*/@JsonProperty("EARNED_PREMIUM_YOY")private BigDecimal earnedPremiumYoy;/*** 手续费及佣金收入,null*/@JsonProperty("FEE_COMMISSION_INCOME")private BigDecimal feeCommissionIncome;/*** 手续费及佣金收入同比增长率,null*/@JsonProperty("FEE_COMMISSION_INCOME_YOY")private BigDecimal feeCommissionIncomeYoy;/*** 其他业务收入,null*/@JsonProperty("OTHER_BUSINESS_INCOME")private BigDecimal otherBusinessIncome;/*** 其他业务收入同比增长率,null*/@JsonProperty("OTHER_BUSINESS_INCOME_YOY")private BigDecimal otherBusinessIncomeYoy;/*** 营业总收入其他,null*/@JsonProperty("TOI_OTHER")private BigDecimal toiOther;/*** 营业总收入其他同比增长率,null*/@JsonProperty("TOI_OTHER_YOY")private BigDecimal toiOtherYoy;// ========== 成本费用类科目 ==========/*** 营业总成本,162850401000*/@JsonProperty("TOTAL_OPERATE_COST")private BigDecimal totalOperateCost;/*** 营业总成本同比增长率,34.8842985049*/@JsonProperty("TOTAL_OPERATE_COST_YOY")private BigDecimal totalOperateCostYoy;/*** 营业成本,136175385000*/@JsonProperty("OPERATE_COST")private BigDecimal operateCost;/*** 营业成本同比增长率,37.4477636891*/@JsonProperty("OPERATE_COST_YOY")private BigDecimal operateCostYoy;/*** 利息支出,null*/@JsonProperty("INTEREST_EXPENSE")private BigDecimal interestExpense;/*** 利息支出同比增长率,null*/@JsonProperty("INTEREST_EXPENSE_YOY")private BigDecimal interestExpenseYoy;/*** 手续费及佣金支出,null*/@JsonProperty("FEE_COMMISSION_EXPENSE")private BigDecimal feeCommissionExpense;/*** 手续费及佣金支出同比增长率,null*/@JsonProperty("FEE_COMMISSION_EXPENSE_YOY")private BigDecimal feeCommissionExpenseYoy;/*** 研发费用,14223006000*/@JsonProperty("RESEARCH_EXPENSE")private BigDecimal researchExpense;/*** 研发费用同比增长率,34.0445744438*/@JsonProperty("RESEARCH_EXPENSE_YOY")private BigDecimal researchExpenseYoy;/*** 退保金,null*/@JsonProperty("SURRENDER_VALUE")private BigDecimal surrenderValue;/*** 退保金同比增长率,null*/@JsonProperty("SURRENDER_VALUE_YOY")private BigDecimal surrenderValueYoy;/*** 赔付支出净额,null*/@JsonProperty("NET_COMPENSATE_EXPENSE")private BigDecimal netCompensateExpense;/*** 赔付支出净额同比增长率,null*/@JsonProperty("NET_COMPENSATE_EXPENSE_YOY")private BigDecimal netCompensateExpenseYoy;/*** 提取保险合同准备金净额,null*/@JsonProperty("NET_CONTRACT_RESERVE")private BigDecimal netContractReserve;/*** 提取保险合同准备金净额同比增长率,null*/@JsonProperty("NET_CONTRACT_RESERVE_YOY")private BigDecimal netContractReserveYoy;/*** 保单红利支出,null*/@JsonProperty("POLICY_BONUS_EXPENSE")private BigDecimal policyBonusExpense;/*** 保单红利支出同比增长率,null*/@JsonProperty("POLICY_BONUS_EXPENSE_YOY")private BigDecimal policyBonusExpenseYoy;/*** 分保费用,null*/@JsonProperty("REINSURE_EXPENSE")private BigDecimal reinsureExpense;/*** 分保费用同比增长率,null*/@JsonProperty("REINSURE_EXPENSE_YOY")private BigDecimal reinsureExpenseYoy;/*** 其他业务成本,null*/@JsonProperty("OTHER_BUSINESS_COST")private BigDecimal otherBusinessCost;/*** 其他业务成本同比增长率,null*/@JsonProperty("OTHER_BUSINESS_COST_YOY")private BigDecimal otherBusinessCostYoy;/*** 营业税金及附加,3273367000*/@JsonProperty("OPERATE_TAX_ADD")private BigDecimal operateTaxAdd;/*** 营业税金及附加同比增长率,52.873708156*/@JsonProperty("OPERATE_TAX_ADD_YOY")private BigDecimal operateTaxAddYoy;/*** 销售费用,6181121000*/@JsonProperty("SALE_EXPENSE")private BigDecimal saleExpense;/*** 销售费用同比增长率,15.9099134509,*/@JsonProperty("SALE_EXPENSE_YOY")private BigDecimal saleExpenseYoy;/*** 管理费用,4905868000*/@JsonProperty("MANAGE_EXPENSE")private BigDecimal manageExpense;/*** 管理费用同比增长率,30.1806098911*/@JsonProperty("MANAGE_EXPENSE_YOY")private BigDecimal manageExpenseYoy;/*** 管理费用中的研发费用,null*/@JsonProperty("ME_RESEARCH_EXPENSE")private BigDecimal meResearchExpense;/*** 管理费用中的研发费用同比增长率,null*/@JsonProperty("ME_RESEARCH_EXPENSE_YOY")private BigDecimal meResearchExpenseYoy;/*** 财务费用,-1908346000*/@JsonProperty("FINANCE_EXPENSE")private BigDecimal financeExpense;/*** 财务费用同比增长率,-883.8812957244*/@JsonProperty("FINANCE_EXPENSE_YOY")private BigDecimal financeExpenseYoy;/*** 财务费用中的利息费用,601460000*/@JsonProperty("FE_INTEREST_EXPENSE")private BigDecimal feInterestExpense;/*** 财务费用中的利息费用同比增长率,3.6197839948*/@JsonProperty("FE_INTEREST_EXPENSE_YOY")private BigDecimal feInterestExpenseYoy;/*** 财务费用中的利息收入,573960000*/@JsonProperty("FE_INTEREST_INCOME")private BigDecimal feInterestIncome;/*** 财务费用中的利息收入同比增长率,-3.5568818809*/@JsonProperty("FE_INTEREST_INCOME_YOY")private BigDecimal feInterestIncomeYoy;/*** 资产减值损失,null*/@JsonProperty("ASSET_IMPAIRMENT_LOSS")private BigDecimal assetImpairmentLoss;/*** 资产减值损失同比增长率,null*/@JsonProperty("ASSET_IMPAIRMENT_LOSS_YOY")private BigDecimal assetImpairmentLossYoy;/*** 信用减值损失,null*/@JsonProperty("CREDIT_IMPAIRMENT_LOSS")private BigDecimal creditImpairmentLoss;/*** 信用减值损失同比增长率,null*/@JsonProperty("CREDIT_IMPAIRMENT_LOSS_YOY")private BigDecimal creditImpairmentLossYoy;/*** 营业总成本其他,null*/@JsonProperty("TOC_OTHER")private BigDecimal tocOther;/*** 营业总成本其他同比增长率,null*/@JsonProperty("TOC_OTHER_YOY")private BigDecimal tocOtherYoy;// ========== 其他损益类科目 ==========/*** 公允价值变动收益,246269000*/@JsonProperty("FAIRVALUE_CHANGE_INCOME")private BigDecimal fairvalueChangeIncome;/*** 公允价值变动收益同比增长率*/@JsonProperty("FAIRVALUE_CHANGE_INCOME_YOY")private BigDecimal fairvalueChangeIncomeYoy;/*** 投资收益,696730000*/@JsonProperty("INVEST_INCOME")private BigDecimal investIncome;/*** 投资收益同比增长率*/@JsonProperty("INVEST_INCOME_YOY")private BigDecimal investIncomeYoy;/*** 对联营企业和合营企业的投资收益,377476000*/@JsonProperty("INVEST_JOINT_INCOME")private BigDecimal investJointIncome;/*** 对联营企业和合营企业的投资收益同比增长率*/@JsonProperty("INVEST_JOINT_INCOME_YOY")private BigDecimal investJointIncomeYoy;/*** 净敞口套期收益,null*/@JsonProperty("NET_EXPOSURE_INCOME")private BigDecimal netExposureIncome;/*** 净敞口套期收益同比增长率*/@JsonProperty("NET_EXPOSURE_INCOME_YOY")private BigDecimal netExposureIncomeYoy;/*** 汇兑收益,null*/@JsonProperty("EXCHANGE_INCOME")private BigDecimal exchangeIncome;/*** 汇兑收益同比增长率*/@JsonProperty("EXCHANGE_INCOME_YOY")private BigDecimal exchangeIncomeYoy;/*** 资产处置收益,2942000*/@JsonProperty("ASSET_DISPOSAL_INCOME")private BigDecimal assetDisposalIncome;/*** 资产处置收益同比增长率*/@JsonProperty("ASSET_DISPOSAL_INCOME_YOY")private BigDecimal assetDisposalIncomeYoy;/*** 资产减值损失(新),-709812000*/@JsonProperty("ASSET_IMPAIRMENT_INCOME")private BigDecimal assetImpairmentIncome;/*** 资产减值收益同比增长率*/@JsonProperty("ASSET_IMPAIRMENT_INCOME_YOY")private BigDecimal assetImpairmentIncomeYoy;/*** 信用减值损失(新),-23694000*/@JsonProperty("CREDIT_IMPAIRMENT_INCOME")private BigDecimal creditImpairmentIncome;/*** 信用减值收益同比增长率*/@JsonProperty("CREDIT_IMPAIRMENT_INCOME_YOY")private BigDecimal creditImpairmentIncomeYoy;/*** 其他收益,3298167000*/@JsonProperty("OTHER_INCOME")private BigDecimal otherIncome;/*** 其他收益同比增长率*/@JsonProperty("OTHER_INCOME_YOY")private BigDecimal otherIncomeYoy;/*** 营业利润其他,null*/@JsonProperty("OPERATE_PROFIT_OTHER")private BigDecimal operateProfitOther;/*** 营业利润其他同比增长率*/@JsonProperty("OPERATE_PROFIT_OTHER_YOY")private BigDecimal operateProfitOtherYoy;/*** 营业利润平衡项目,null*/@JsonProperty("OPERATE_PROFIT_BALANCE")private BigDecimal operateProfitBalance;/*** 营业利润平衡项目同比增长率*/@JsonProperty("OPERATE_PROFIT_BALANCE_YOY")private BigDecimal operateProfitBalanceYoy;/*** 营业利润,11020649000*/@JsonProperty("OPERATE_PROFIT")private BigDecimal operateProfit;/*** 营业利润同比增长率*/@JsonProperty("OPERATE_PROFIT_YOY")private BigDecimal operateProfitYoy;// ========== 营业外损益 ==========/*** 营业外收入,585882000*/@JsonProperty("NONBUSINESS_INCOME")private BigDecimal nonbusinessIncome;/*** 营业外收入同比增长率*/@JsonProperty("NONBUSINESS_INCOME_YOY")private BigDecimal nonbusinessIncomeYoy;/*** 非流动资产处置利得,null*/@JsonProperty("NONCURRENT_DISPOSAL_INCOME")private BigDecimal noncurrentDisposalIncome;/*** 非流动资产处置利得同比增长率*/@JsonProperty("NONCURRENT_DISPOSAL_INCOME_YOY")private BigDecimal noncurrentDisposalIncomeYoy;/*** 营业外支出,415648000*/@JsonProperty("NONBUSINESS_EXPENSE")private BigDecimal nonbusinessExpense;/*** 营业外支出同比增长率*/@JsonProperty("NONBUSINESS_EXPENSE_YOY")private BigDecimal nonbusinessExpenseYoy;/*** 非流动资产处置损失,null*/@JsonProperty("NONCURRENT_DISPOSAL_LOSS")private BigDecimal noncurrentDisposalLoss;/*** 非流动资产处置损失同比增长率*/@JsonProperty("NONCURRENT_DISPOSAL_LOSS_YOY")private BigDecimal noncurrentDisposalLossYoy;/*** 影响利润总额的其他项目,null*/@JsonProperty("EFFECT_TP_OTHER")private BigDecimal effectTpOther;/*** 影响利润总额的其他项目同比增长率*/@JsonProperty("EFFECT_TP_OTHER_YOY")private BigDecimal effectTpOtherYoy;/*** 利润总额平衡项目,0*/@JsonProperty("TOTAL_PROFIT_BALANCE")private BigDecimal totalProfitBalance;/*** 利润总额平衡项目同比增长率*/@JsonProperty("TOTAL_PROFIT_BALANCE_YOY")private BigDecimal totalProfitBalanceYoy;/*** 利润总额,11190883000*/@JsonProperty("TOTAL_PROFIT")private BigDecimal totalProfit;/*** 利润总额同比增长率*/@JsonProperty("TOTAL_PROFIT_YOY")private BigDecimal totalProfitYoy;// ========== 所得税及净利润 ==========/*** 所得税费用,1747743000*/@JsonProperty("INCOME_TAX")private BigDecimal incomeTax;/*** 所得税费用同比增长率*/@JsonProperty("INCOME_TAX_YOY")private BigDecimal incomeTaxYoy;/*** 影响净利润的其他项目,null*/@JsonProperty("EFFECT_NETPROFIT_OTHER")private BigDecimal effectNetprofitOther;/*** 影响净利润的其他项目同比增长率*/@JsonProperty("EFFECT_NETPROFIT_OTHER_YOY")private BigDecimal effectNetprofitOtherYoy;/*** 净利润平衡项目,null*/@JsonProperty("EFFECT_NETPROFIT_BALANCE")private BigDecimal effectNetprofitBalance;/*** 净利润平衡项目同比增长率*/@JsonProperty("EFFECT_NETPROFIT_BALANCE_YOY")private BigDecimal effectNetprofitBalanceYoy;/*** 未确认投资损失,null*/@JsonProperty("UNCONFIRM_INVEST_LOSS")private BigDecimal unconfirmInvestLoss;/*** 未确认投资损失同比增长率*/@JsonProperty("UNCONFIRM_INVEST_LOSS_YOY")private BigDecimal unconfirmInvestLossYoy;/*** 净利润,9443140000*/@JsonProperty("NETPROFIT")private BigDecimal netprofit;/*** 净利润同比增长率*/@JsonProperty("NETPROFIT_YOY")private BigDecimal netprofitYoy;/*** 企业合并前净利润,null*/@JsonProperty("PRECOMBINE_PROFIT")private BigDecimal precombineProfit;/*** 企业合并前净利润同比增长率*/@JsonProperty("PRECOMBINE_PROFIT_YOY")private BigDecimal precombineProfitYoy;/*** 持续经营净利润,9443140000*/@JsonProperty("CONTINUED_NETPROFIT")private BigDecimal continuedNetprofit;/*** 持续经营净利润同比增长率*/@JsonProperty("CONTINUED_NETPROFIT_YOY")private BigDecimal continuedNetprofitYoy;/*** 终止经营净利润,null*/@JsonProperty("DISCONTINUED_NETPROFIT")private BigDecimal discontinuedNetprofit;/*** 终止经营净利润同比增长率*/@JsonProperty("DISCONTINUED_NETPROFIT_YOY")private BigDecimal discontinuedNetprofitYoy;/*** 归属于母公司股东的净利润,9154985000*/@JsonProperty("PARENT_NETPROFIT")private BigDecimal parentNetprofit;/*** 归属于母公司股东的净利润同比增长率*/@JsonProperty("PARENT_NETPROFIT_YOY")private BigDecimal parentNetprofitYoy;/*** 少数股东损益,288155000*/@JsonProperty("MINORITY_INTEREST")private BigDecimal minorityInterest;/*** 少数股东损益同比增长率*/@JsonProperty("MINORITY_INTEREST_YOY")private BigDecimal minorityInterestYoy;/*** 扣除非经常性损益后的净利润,8171627000*/@JsonProperty("DEDUCT_PARENT_NETPROFIT")private BigDecimal deductParentNetprofit;/*** 扣除非经常性损益后的净利润同比增长率*/@JsonProperty("DEDUCT_PARENT_NETPROFIT_YOY")private BigDecimal deductParentNetprofitYoy;/*** 净利润其他,null*/@JsonProperty("NETPROFIT_OTHER")private BigDecimal netprofitOther;/*** 净利润其他同比增长率*/@JsonProperty("NETPROFIT_OTHER_YOY")private BigDecimal netprofitOtherYoy;/*** 净利润平衡项目,null*/@JsonProperty("NETPROFIT_BALANCE")private BigDecimal netprofitBalance;/*** 净利润平衡项目同比增长率*/@JsonProperty("NETPROFIT_BALANCE_YOY")private BigDecimal netprofitBalanceYoy;// ========== 每股收益 ==========/*** 基本每股收益,3.12*/@JsonProperty("BASIC_EPS")private BigDecimal basicEps;/*** 基本每股收益同比增长率,98.7261146497*/@JsonProperty("BASIC_EPS_YOY")private BigDecimal basicEpsYoy;/*** 稀释每股收益,3.12*/@JsonProperty("DILUTED_EPS")private BigDecimal dilutedEps;/*** 稀释每股收益同比增长率*/@JsonProperty("DILUTED_EPS_YOY")private BigDecimal dilutedEpsYoy;// ========== 其他综合收益 ==========/*** 其他综合收益,-241917000*/@JsonProperty("OTHER_COMPRE_INCOME")private BigDecimal otherCompreIncome;/*** 其他综合收益同比增长率*/@JsonProperty("OTHER_COMPRE_INCOME_YOY")private BigDecimal otherCompreIncomeYoy;/*** 归属于母公司股东的其他综合收益*/@JsonProperty("PARENT_OCI")private BigDecimal parentOci;/*** 归属于母公司股东的其他综合收益同比增长率*/@JsonProperty("PARENT_OCI_YOY")private BigDecimal parentOciYoy;/*** 归属于少数股东的其他综合收益*/@JsonProperty("MINORITY_OCI")private BigDecimal minorityOci;/*** 归属于少数股东的其他综合收益同比增长率*/@JsonProperty("MINORITY_OCI_YOY")private BigDecimal minorityOciYoy;/*** 归属于母公司股东的其他综合收益其他*/@JsonProperty("PARENT_OCI_OTHER")private BigDecimal parentOciOther;/*** 归属于母公司股东的其他综合收益其他同比增长率*/@JsonProperty("PARENT_OCI_OTHER_YOY")private BigDecimal parentOciOtherYoy;/*** 归属于母公司股东的其他综合收益平衡项目*/@JsonProperty("PARENT_OCI_BALANCE")private BigDecimal parentOciBalance;/*** 归属于母公司股东的其他综合收益平衡项目同比增长率*/@JsonProperty("PARENT_OCI_BALANCE_YOY")private BigDecimal parentOciBalanceYoy;/*** 不能重分类进损益的其他综合收益*/@JsonProperty("UNABLE_OCI")private BigDecimal unableOci;/*** 不能重分类进损益的其他综合收益同比增长率*/@JsonProperty("UNABLE_OCI_YOY")private BigDecimal unableOciYoy;/*** 其他债权投资信用减值准备*/@JsonProperty("CREDITRISK_FAIRVALUE_CHANGE")private BigDecimal creditriskFairvalueChange;/*** 其他债权投资信用减值准备同比增长率*/@JsonProperty("CREDITRISK_FAIRVALUE_CHANGE_YOY")private BigDecimal creditriskFairvalueChangeYoy;/*** 其他权益工具投资公允价值变动*/@JsonProperty("OTHERRIGHT_FAIRVALUE_CHANGE")private BigDecimal otherrightFairvalueChange;/*** 其他权益工具投资公允价值变动同比增长率*/@JsonProperty("OTHERRIGHT_FAIRVALUE_CHANGE_YOY")private BigDecimal otherrightFairvalueChangeYoy;/*** 企业自身信用风险公允价值变动*/@JsonProperty("SETUP_PROFIT_CHANGE")private BigDecimal setupProfitChange;/*** 企业自身信用风险公允价值变动同比增长率*/@JsonProperty("SETUP_PROFIT_CHANGE_YOY")private BigDecimal setupProfitChangeYoy;/*** 权益法下不能转损益的其他综合收益*/@JsonProperty("RIGHTLAW_UNABLE_OCI")private BigDecimal rightlawUnableOci;/*** 权益法下不能转损益的其他综合收益同比增长率*/@JsonProperty("RIGHTLAW_UNABLE_OCI_YOY")private BigDecimal rightlawUnableOciYoy;/*** 不能重分类进损益的其他综合收益其他*/@JsonProperty("UNABLE_OCI_OTHER")private BigDecimal unableOciOther;/*** 不能重分类进损益的其他综合收益其他同比增长率*/@JsonProperty("UNABLE_OCI_OTHER_YOY")private BigDecimal unableOciOtherYoy;/*** 不能重分类进损益的其他综合收益平衡项目*/@JsonProperty("UNABLE_OCI_BALANCE")private BigDecimal unableOciBalance;/*** 不能重分类进损益的其他综合收益平衡项目同比增长率*/@JsonProperty("UNABLE_OCI_BALANCE_YOY")private BigDecimal unableOciBalanceYoy;/*** 将重分类进损益的其他综合收益*/@JsonProperty("ABLE_OCI")private BigDecimal ableOci;/*** 将重分类进损益的其他综合收益同比增长率*/@JsonProperty("ABLE_OCI_YOY")private BigDecimal ableOciYoy;/*** 权益法下可转损益的其他综合收益*/@JsonProperty("RIGHTLAW_ABLE_OCI")private BigDecimal rightlawAbleOci;/*** 权益法下可转损益的其他综合收益同比增长率*/@JsonProperty("RIGHTLAW_ABLE_OCI_YOY")private BigDecimal rightlawAbleOciYoy;/*** 其他债权投资公允价值变动*/@JsonProperty("AFA_FAIRVALUE_CHANGE")private BigDecimal afaFairvalueChange;/*** 其他债权投资公允价值变动同比增长率*/@JsonProperty("AFA_FAIRVALUE_CHANGE_YOY")private BigDecimal afaFairvalueChangeYoy;/*** 金融资产重分类计入其他综合收益的金额*/@JsonProperty("HMI_AFA")private BigDecimal hmiAfa;/*** 金融资产重分类计入其他综合收益的金额同比增长率*/@JsonProperty("HMI_AFA_YOY")private BigDecimal hmiAfaYoy;/*** 现金流量套期储备*/@JsonProperty("CASHFLOW_HEDGE_VALID")private BigDecimal cashflowHedgeValid;/*** 现金流量套期储备同比增长率*/@JsonProperty("CASHFLOW_HEDGE_VALID_YOY")private BigDecimal cashflowHedgeValidYoy;/*** 其他债权投资信用减值准备*/@JsonProperty("CREDITOR_FAIRVALUE_CHANGE")private BigDecimal creditorFairvalueChange;/*** 其他债权投资信用减值准备同比增长率*/@JsonProperty("CREDITOR_FAIRVALUE_CHANGE_YOY")private BigDecimal creditorFairvalueChangeYoy;/*** 其他债权投资减值准备*/@JsonProperty("CREDITOR_IMPAIRMENT_RESERVE")private BigDecimal creditorImpairmentReserve;/*** 其他债权投资减值准备同比增长率*/@JsonProperty("CREDITOR_IMPAIRMENT_RESERVE_YOY")private BigDecimal creditorImpairmentReserveYoy;/*** 一般风险准备*/@JsonProperty("FINANCE_OCI_AMT")private BigDecimal financeOciAmt;/*** 一般风险准备同比增长率*/@JsonProperty("FINANCE_OCI_AMT_YOY")private BigDecimal financeOciAmtYoy;/*** 外币财务报表折算差额*/@JsonProperty("CONVERT_DIFF")private BigDecimal convertDiff;/*** 外币财务报表折算差额同比增长率*/@JsonProperty("CONVERT_DIFF_YOY")private BigDecimal convertDiffYoy;/*** 将重分类进损益的其他综合收益其他*/@JsonProperty("ABLE_OCI_OTHER")private BigDecimal ableOciOther;/*** 将重分类进损益的其他综合收益其他同比增长率*/@JsonProperty("ABLE_OCI_OTHER_YOY")private BigDecimal ableOciOtherYoy;/*** 将重分类进损益的其他综合收益平衡项目*/@JsonProperty("ABLE_OCI_BALANCE")private BigDecimal ableOciBalance;/*** 将重分类进损益的其他综合收益平衡项目同比增长率*/@JsonProperty("ABLE_OCI_BALANCE_YOY")private BigDecimal ableOciBalanceYoy;/*** 其他综合收益其他*/@JsonProperty("OCI_OTHER")private BigDecimal ociOther;/*** 其他综合收益其他同比增长率*/@JsonProperty("OCI_OTHER_YOY")private BigDecimal ociOtherYoy;/*** 其他综合收益平衡项目*/@JsonProperty("OCI_BALANCE")private BigDecimal ociBalance;/*** 其他综合收益平衡项目同比增长率*/@JsonProperty("OCI_BALANCE_YOY")private BigDecimal ociBalanceYoy;// ========== 综合收益总额 ==========/*** 综合收益总额*/@JsonProperty("TOTAL_COMPRE_INCOME")private BigDecimal totalCompreIncome;/*** 综合收益总额同比增长率*/@JsonProperty("TOTAL_COMPRE_INCOME_YOY")private BigDecimal totalCompreIncomeYoy;/*** 归属于母公司股东的综合收益总额*/@JsonProperty("PARENT_TCI")private BigDecimal parentTci;/*** 归属于母公司股东的综合收益总额同比增长率*/@JsonProperty("PARENT_TCI_YOY")private BigDecimal parentTciYoy;/*** 归属于少数股东的综合收益总额*/@JsonProperty("MINORITY_TCI")private BigDecimal minorityTci;/*** 归属于少数股东的综合收益总额同比增长率*/@JsonProperty("MINORITY_TCI_YOY")private BigDecimal minorityTciYoy;/*** 企业合并前综合收益总额*/@JsonProperty("PRECOMBINE_TCI")private BigDecimal precombineTci;/*** 企业合并前综合收益总额同比增长率*/@JsonProperty("PRECOMBINE_TCI_YOY")private BigDecimal precombineTciYoy;/*** 影响综合收益总额的平衡项目*/@JsonProperty("EFFECT_TCI_BALANCE")private BigDecimal effectTciBalance;/*** 影响综合收益总额的平衡项目同比增长率*/@JsonProperty("EFFECT_TCI_BALANCE_YOY")private BigDecimal effectTciBalanceYoy;/*** 综合收益总额其他*/@JsonProperty("TCI_OTHER")private BigDecimal tciOther;/*** 综合收益总额其他同比增长率*/@JsonProperty("TCI_OTHER_YOY")private BigDecimal tciOtherYoy;/*** 综合收益总额平衡项目*/@JsonProperty("TCI_BALANCE")private BigDecimal tciBalance;/*** 综合收益总额平衡项目同比增长率*/@JsonProperty("TCI_BALANCE_YOY")private BigDecimal tciBalanceYoy;/*** 会计政策变更对期初净利润的影响*/@JsonProperty("ACF_END_INCOME")private BigDecimal acfEndIncome;/*** 会计政策变更对期初净利润的影响同比增长率*/@JsonProperty("ACF_END_INCOME_YOY")private BigDecimal acfEndIncomeYoy;/*** 审计意见类型*/@JsonProperty("OPINION_TYPE")private String opinionType;
}package com.sankuai.qinling.data.mmp.biz.service.impl;import com.fasterxml.jackson.databind.ObjectMapper;
import com.sankuai.csc.common.tool.JsonUtils;
import com.sankuai.csc.common.tool.log.JsonLogUtil;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyIncomeStatementApiResponseBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyIncomeStatementDataBo;
import com.sankuai.qinling.data.mmp.biz.service.EastMoneyIncomeStatementService;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Service;import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;/*** 东方财富利润表数据服务实现类** @author system* @date 2024-12-19*/
@Service
public class EastMoneyIncomeStatementServiceImpl implements EastMoneyIncomeStatementService {/*** 东方财富利润表API基础URL*/private static final String INCOME_STATEMENT_BASE_URL = "https://datacenter.eastmoney.com/securities/api/data/get";/*** 利润表报告名称*/private static final String INCOME_STATEMENT_REPORT_NAME = "RPT_F10_FINANCE_GINCOME";/*** 利润表报告样式*/private static final String INCOME_STATEMENT_STYLE = "APP_F10_GINCOME";/*** HTTP客户端*/private final CloseableHttpClient httpClient;/*** JSON对象映射器*/private final ObjectMapper objectMapper;public EastMoneyIncomeStatementServiceImpl() {// 配置请求超时时间RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setConnectionRequestTimeout(30000).build();this.httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();this.objectMapper = new ObjectMapper();}@Overridepublic List<EastMoneyIncomeStatementDataBo> getIncomeStatementDataBySecuCodeAndReportDates(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) throws Exception {System.out.println("开始获取利润表数据, secuCode: " + secuCode + ", pageNumber: " + pageNumber + ", pageSize: " + pageSize + ", reportDateList: " + JsonLogUtil.createLogObject(reportDateList));EastMoneyIncomeStatementApiResponseBo response = getIncomeStatementApiResponse(secuCode, pageNumber, pageSize, reportDateList);if (response == null || response.getResult() == null || response.getResult().getData() == null) {System.out.println("获取利润表数据为空, secuCode: " + secuCode);return Collections.emptyList();}List<EastMoneyIncomeStatementDataBo> dataList = response.getResult().getData();System.out.println("成功获取利润表数据, secuCode: " + secuCode + ", 数据条数: " + dataList.size());return dataList;}@Overridepublic EastMoneyIncomeStatementApiResponseBo getIncomeStatementApiResponse(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) throws Exception {// 参数校验if (StringUtils.isBlank(secuCode)) {throw new IllegalArgumentException("证券代码不能为空");}if (pageNumber == null || pageNumber < 1) {pageNumber = 1;}if (pageSize == null || pageSize < 1) {pageSize = 5;}if (reportDateList == null || reportDateList.isEmpty()) {throw new IllegalArgumentException("报告日期列表不能为空");}try {// 构建请求URLString url = buildRequestUrl(secuCode, pageNumber, pageSize, reportDateList);System.out.println("开始调用东方财富利润表API, url: " + url);// 创建HTTP GET请求HttpGet httpGet = new HttpGet(url);httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36");// 发送请求CloseableHttpResponse response = httpClient.execute(httpGet);try {int statusCode = response.getStatusLine().getStatusCode();System.out.println("东方财富利润表API调用完成, 状态码: " + statusCode);// 检查响应状态if (statusCode != 200) {throw new RuntimeException("API调用失败, 状态码: " + statusCode);}// 获取响应内容HttpEntity entity = response.getEntity();String responseBody = EntityUtils.toString(entity, StandardCharsets.UTF_8);System.out.println("响应长度: " + responseBody.length());System.out.println("API响应内容: " + responseBody);EastMoneyIncomeStatementApiResponseBo apiResponse = objectMapper.readValue(responseBody, EastMoneyIncomeStatementApiResponseBo.class);// 检查业务响应if (apiResponse == null || !Boolean.TRUE.equals(apiResponse.getSuccess())) {String errorMsg = apiResponse != null ? apiResponse.getMessage() : "未知错误";throw new RuntimeException("API业务调用失败: " + errorMsg);}System.out.println("成功解析利润表API响应, 总记录数: " +(apiResponse.getResult() != null ? apiResponse.getResult().getCount() : 0) +", 总页数: " + (apiResponse.getResult() != null ? apiResponse.getResult().getPages() : 0));return apiResponse;} finally {response.close();}} catch (IOException e) {System.out.println("调用东方财富利润表API发生IO异常, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("网络请求异常: " + e.getMessage(), e);} catch (Exception e) {System.out.println("调用东方财富利润表API发生未知异常, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("系统异常: " + e.getMessage(), e);}}/*** 构建请求URL** @param secuCode 证券代码* @param pageNumber 页码* @param pageSize 每页大小* @param reportDateList 报告日期列表* @return 完整的请求URL*/private String buildRequestUrl(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) {try {// 构建证券代码过滤条件String secuCodeFilter = String.format("(SECUCODE=\"%s\")", secuCode);// 构建报告日期过滤条件String reportDateFilter = reportDateList.stream().map(date -> String.format("'%s'", date)).collect(Collectors.joining(",", "(REPORT_DATE in (", "))"));// 组合过滤条件String combinedFilter = secuCodeFilter + reportDateFilter;// URL编码过滤条件String encodedFilter = URLEncoder.encode(combinedFilter, StandardCharsets.UTF_8.toString());// 构建完整URLString url = String.format("%s?type=%s&sty=%s&filter=%s&p=%d&ps=%d&sr=-1&st=REPORT_DATE&source=HSF10&client=PC&v=%s",INCOME_STATEMENT_BASE_URL, INCOME_STATEMENT_REPORT_NAME, INCOME_STATEMENT_STYLE, encodedFilter, pageNumber, pageSize, generateVersion());System.out.println("构建的请求URL: " + url);return url;} catch (Exception e) {System.out.println("构建请求URL失败, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("构建请求URL失败: " + e.getMessage(), e);}}/*** 生成版本号** @return 版本号字符串*/private String generateVersion() {// 生成一个简单的版本号,可以使用时间戳或随机数return String.valueOf(System.currentTimeMillis() % 100000000000000L);}/*** 测试方法** @param args 命令行参数*/public static void main(String[] args) {EastMoneyIncomeStatementServiceImpl service = new EastMoneyIncomeStatementServiceImpl();try {// 测试参数String secuCode = "002594.SZ";Integer pageNumber = 1;Integer pageSize = 5;List<String> reportDateList = Arrays.asList("2025-03-31", "2024-12-31", "2024-09-30");System.out.println("开始测试获取利润表数据, secuCode: " + secuCode +", pageNumber: " + pageNumber +", pageSize: " + pageSize +", reportDateList: " + reportDateList);// 调用方法获取利润表数据List<EastMoneyIncomeStatementDataBo> incomeStatementDataList = service.getIncomeStatementDataBySecuCodeAndReportDates(secuCode, pageNumber, pageSize, reportDateList);System.out.println("利润表数据详情:");System.out.println(JsonUtils.toJSONString(incomeStatementDataList));if (incomeStatementDataList != null && !incomeStatementDataList.isEmpty()) {System.out.println("成功获取利润表数据, 总条数: " + incomeStatementDataList.size());// 打印前几条数据作为示例for (int i = 0; i < Math.min(3, incomeStatementDataList.size()); i++) {EastMoneyIncomeStatementDataBo data = incomeStatementDataList.get(i);System.out.println("第" + (i + 1) + "条数据 - 证券代码: " + data.getSecuCode() +", 证券名称: " + data.getSecurityNameAbbr() +", 报告日期: " + data.getReportDate() +", 营业总收入: " + data.getTotalOperateIncome() +", 营业利润: " + data.getOperateProfit() +", 净利润: " + data.getNetprofit() +", 归属于母公司股东的净利润: " + data.getParentNetprofit());}} else {System.out.println("未获取到利润表数据");}} catch (Exception e) {System.err.println("测试获取利润表数据失败, error: " + e.getMessage());e.printStackTrace();}}
}
3、经营现金流
package com.sankuai.qinling.data.mmp.biz.bo;import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;import java.math.BigDecimal;/*** 东方财富现金流数据Bo对象** @author system* @date 2024-12-19*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class EastMoneyCashFlowDataBo {/*** 证券代码,002594.SZ*/@JsonProperty("SECUCODE")private String secuCode;/*** 股票代码,002594*/@JsonProperty("SECURITY_CODE")private String securityCode;/*** 股票简称,比亚迪*/@JsonProperty("SECURITY_NAME_ABBR")private String securityNameAbbr;/*** 机构代码,10010554*/@JsonProperty("ORG_CODE")private String orgCode;/*** 机构类型,通用*/@JsonProperty("ORG_TYPE")private String orgType;/*** 报告日期,2024-12-31 00:00:00*/@JsonProperty("REPORT_DATE")private String reportDate;/*** 报告类型,年报*/@JsonProperty("REPORT_TYPE")private String reportType;/*** 报告日期名称,2024年报*/@JsonProperty("REPORT_DATE_NAME")private String reportDateName;/*** 证券类型代码,058001001*/@JsonProperty("SECURITY_TYPE_CODE")private String securityTypeCode;/*** 公告日期,2025-03-25 00:00:00*/@JsonProperty("NOTICE_DATE")private String noticeDate;/*** 更新日期,2025-03-25 00:00:00*/@JsonProperty("UPDATE_DATE")private String updateDate;/*** 货币单位,CNY*/@JsonProperty("CURRENCY")private String currency;// ========== 经营活动现金流量 ==========/*** 销售商品、提供劳务收到的现金,774347395000*/@JsonProperty("SALES_SERVICES")private BigDecimal salesServices;/*** 客户存款和同业存放款项净增加额,null*/@JsonProperty("DEPOSIT_INTERBANK_ADD")private BigDecimal depositInterbankAdd;/*** 向中央银行借款净增加额,null*/@JsonProperty("LOAN_PBC_ADD")private BigDecimal loanPbcAdd;/*** 向其他金融机构拆入资金净增加额,null*/@JsonProperty("OFI_BF_ADD")private BigDecimal ofiBfAdd;/*** 收到原保险合同保费取得的现金,null*/@JsonProperty("RECEIVE_ORIGIC_PREMIUM")private BigDecimal receiveOrigicPremium;/*** 收到再保险业务现金净额,null*/@JsonProperty("RECEIVE_REINSURE_NET")private BigDecimal receiveReinsureNet;/*** 保户储金及投资款净增加额,null*/@JsonProperty("INSURED_INVEST_ADD")private BigDecimal insuredInvestAdd;/*** 处置交易性金融资产净增加额,null*/@JsonProperty("DISPOSAL_TFA_ADD")private BigDecimal disposalTfaAdd;/*** 收取利息、手续费及佣金的现金,null*/@JsonProperty("RECEIVE_INTEREST_COMMISSION")private BigDecimal receiveInterestCommission;/*** 拆入资金净增加额,null*/@JsonProperty("BORROW_FUND_ADD")private BigDecimal borrowFundAdd;/*** 回购业务资金净增加额,null*/@JsonProperty("LOAN_ADVANCE_REDUCE")private BigDecimal loanAdvanceReduce;/*** 代理买卖证券收到的现金净额,null*/@JsonProperty("REPO_BUSINESS_ADD")private BigDecimal repoBusinessAdd;/*** 收到的税收返还,12073925000*/@JsonProperty("RECEIVE_TAX_REFUND")private BigDecimal receiveTaxRefund;/*** 收到其他与经营活动有关的现金,28396310000*/@JsonProperty("RECEIVE_OTHER_OPERATE")private BigDecimal receiveOtherOperate;// /**
// * 收到其他与经营活动有关的现金,null
// */
// @JsonProperty("OPERATE_INFLOW_OTHER")
// private BigDecimal operateInflowOther;/*** 经营活动现金流入平衡项目,0*/@JsonProperty("OPERATE_INFLOW_BALANCE")private BigDecimal operateInflowBalance;/*** 经营活动现金流入小计,814817630000*/@JsonProperty("TOTAL_OPERATE_INFLOW")private BigDecimal totalOperateInflow;/*** 购买商品、接受劳务支付的现金,489866241000*/@JsonProperty("BUY_SERVICES")private BigDecimal buyServices;/*** 客户贷款及垫款净增加额,null*/@JsonProperty("LOAN_ADVANCE_ADD")private BigDecimal loanAdvanceAdd;/*** 存放中央银行和同业款项净增加额,null*/@JsonProperty("PBC_INTERBANK_ADD")private BigDecimal pbcInterbankAdd;/*** 支付原保险合同赔付款项的现金,null*/@JsonProperty("PAY_ORIGIC_COMPENSATE")private BigDecimal payOrigicCompensate;/*** 支付利息、手续费及佣金的现金,null*/@JsonProperty("PAY_INTEREST_COMMISSION")private BigDecimal payInterestCommission;/*** 支付保单红利的现金,null*/@JsonProperty("PAY_POLICY_BONUS")private BigDecimal payPolicyBonus;/*** 支付给职工以及为职工支付的现金,117067584000*/@JsonProperty("PAY_STAFF_CASH")private BigDecimal payStaffCash;/*** 支付的各项税费,52697132000*/@JsonProperty("PAY_ALL_TAX")private BigDecimal payAllTax;/*** 支付其他与经营活动有关的现金,21732800000*/@JsonProperty("PAY_OTHER_OPERATE")private BigDecimal payOtherOperate;/*** 经营活动现金流出其他项目,null*/@JsonProperty("OPERATE_OUTFLOW_OTHER")private BigDecimal operateOutflowOther;/*** 经营活动现金流出平衡项目0*/@JsonProperty("OPERATE_OUTFLOW_BALANCE")private BigDecimal operateOutflowBalance;/*** 经营活动现金流出小计,681363757000*/@JsonProperty("TOTAL_OPERATE_OUTFLOW")private BigDecimal totalOperateOutflow;/*** 经营活动产生的现金流量净额其他项目,null*/@JsonProperty("OPERATE_NETCASH_OTHER")private BigDecimal operateNetcashOther;/*** 经营活动产生的现金流量净额平衡项目,0*/@JsonProperty("OPERATE_NETCASH_BALANCE")private BigDecimal operateNetcashBalance;/*** 经营活动产生的现金流量净额,133453873000*/@JsonProperty("NETCASH_OPERATE")private BigDecimal netcashOperate;// ========== 投资活动现金流量 ==========/*** 收回投资收到的现金,128755000*/@JsonProperty("WITHDRAW_INVEST")private BigDecimal withdrawInvest;/*** 取得投资收益收到的现金,469217000*/@JsonProperty("RECEIVE_INVEST_INCOME")private BigDecimal receiveInvestIncome;/*** 处置固定资产、无形资产和其他长期资产收回的现金净额,1068016000*/@JsonProperty("DISPOSAL_LONG_ASSET")private BigDecimal disposalLongAsset;/*** 处置子公司及其他营业单位收到的现金,7776000*/@JsonProperty("DISPOSAL_SUBSIDIARY_OTHER")private BigDecimal disposalSubsidiaryOther;/*** 减少质押和定期存款所收到的现金,null*/@JsonProperty("REDUCE_PLEDGE_TIMEDEPOSITS")private BigDecimal reducePledgeTimedeposits;/*** 收到其他与投资活动有关的现金,13712511000*/@JsonProperty("RECEIVE_OTHER_INVEST")private BigDecimal receiveOtherInvest;/*** 投资活动现金流入其他项目,13898000*/@JsonProperty("INVEST_INFLOW_OTHER")private BigDecimal investInflowOther;/*** 投资活动现金流入平衡项目,0*/@JsonProperty("INVEST_INFLOW_BALANCE")private BigDecimal investInflowBalance;/*** 投资活动现金流入小计,15400173000*/@JsonProperty("TOTAL_INVEST_INFLOW")private BigDecimal totalInvestInflow;/*** 购建固定资产、无形资产和其他长期资产支付的现金,97359768000*/@JsonProperty("CONSTRUCT_LONG_ASSET")private BigDecimal constructLongAsset;/*** 投资支付的现金,3666259000*/@JsonProperty("INVEST_PAY_CASH")private BigDecimal investPayCash;/*** 质押贷款净增加额,null*/@JsonProperty("PLEDGE_LOAN_ADD")private BigDecimal pledgeLoanAdd;/*** 取得子公司及其他营业单位支付的现金净额,125437000*/@JsonProperty("OBTAIN_SUBSIDIARY_OTHER")private BigDecimal obtainSubsidiaryOther;/*** 增加质押和定期存款所支付的现金,null*/@JsonProperty("ADD_PLEDGE_TIMEDEPOSITS")private BigDecimal addPledgeTimedeposits;/*** 支付其他与投资活动有关的现金,43330991000*/@JsonProperty("PAY_OTHER_INVEST")private BigDecimal payOtherInvest;/*** 投资活动现金流出其他项目,null*/@JsonProperty("INVEST_OUTFLOW_OTHER")private BigDecimal investOutflowOther;/*** 投资活动现金流出平衡项目,0*/@JsonProperty("INVEST_OUTFLOW_BALANCE")private BigDecimal investOutflowBalance;/*** 投资活动现金流出小计,144482455000*/@JsonProperty("TOTAL_INVEST_OUTFLOW")private BigDecimal totalInvestOutflow;/*** 投资活动产生的现金流量净额其他项目,null*/@JsonProperty("INVEST_NETCASH_OTHER")private BigDecimal investNetcashOther;/*** 投资活动产生的现金流量净额平衡项目,0*/@JsonProperty("INVEST_NETCASH_BALANCE")private BigDecimal investNetcashBalance;/*** 投资活动产生的现金流量净额,-129082282000*/@JsonProperty("NETCASH_INVEST")private BigDecimal netcashInvest;// ========== 筹资活动现金流量 ==========/*** 吸收投资收到的现金,98000000*/@JsonProperty("ACCEPT_INVEST_CASH")private BigDecimal acceptInvestCash;/*** 子公司吸收少数股东投资收到的现金,null*/@JsonProperty("SUBSIDIARY_ACCEPT_INVEST")private BigDecimal subsidiaryAcceptInvest;/*** 取得借款收到的现金,37663666000*/@JsonProperty("RECEIVE_LOAN_CASH")private BigDecimal receiveLoanCash;/*** 发行债券收到的现金,2960000000*/@JsonProperty("ISSUE_BOND")private BigDecimal issueBond;/*** 收到其他与筹资活动有关的现金,105558000*/@JsonProperty("RECEIVE_OTHER_FINANCE")private BigDecimal receiveOtherFinance;/*** 筹资活动现金流入其他项目,14894442000*/@JsonProperty("FINANCE_INFLOW_OTHER")private BigDecimal financeInflowOther;/*** 筹资活动现金流入平衡项目,0*/@JsonProperty("FINANCE_INFLOW_BALANCE")private BigDecimal financeInflowBalance;/*** 筹资活动现金流入小计,55721666000*/@JsonProperty("TOTAL_FINANCE_INFLOW")private BigDecimal totalFinanceInflow;/*** 偿还债务支付的现金,50103695000*/@JsonProperty("PAY_DEBT_CASH")private BigDecimal payDebtCash;/*** 分配股利、利润或偿付利息支付的现金,10051081000*/@JsonProperty("ASSIGN_DIVIDEND_PORFIT")private BigDecimal assignDividendPorfit;/*** 其中:子公司支付给少数股东的股利、利润,415066000*/@JsonProperty("SUBSIDIARY_PAY_DIVIDEND")private BigDecimal subsidiaryPayDividend;/*** 购买少数股权支付的现金,null*/@JsonProperty("BUY_SUBSIDIARY_EQUITY")private BigDecimal buySubsidiaryEquity;/*** 支付的其他与筹资活动有关的现金,5834437000*/@JsonProperty("PAY_OTHER_FINANCE")private BigDecimal payOtherFinance;/*** 子公司减资支付给少数股东的现金,null*/@JsonProperty("SUBSIDIARY_REDUCE_CASH")private BigDecimal subsidiaryReduceCash;/*** 筹资活动现金流出其他项目,null*/@JsonProperty("FINANCE_OUTFLOW_OTHER")private BigDecimal financeOutflowOther;/*** 筹资活动现金流出平衡项目,0*/@JsonProperty("FINANCE_OUTFLOW_BALANCE")private BigDecimal financeOutflowBalance;/*** 筹资活动现金流出小计,65989213000*/@JsonProperty("TOTAL_FINANCE_OUTFLOW")private BigDecimal totalFinanceOutflow;/*** 筹资活动产生的现金流量净额其他项目,null*/@JsonProperty("FINANCE_NETCASH_OTHER")private BigDecimal financeNetcashOther;/*** 筹资活动产生的现金流量净额平衡项目,0*/@JsonProperty("FINANCE_NETCASH_BALANCE")private BigDecimal financeNetcashBalance;/*** 筹资活动产生的现金流量净额,-10267547000*/@JsonProperty("NETCASH_FINANCE")private BigDecimal netcashFinance;// ========== 汇率变动及现金净增加额 ==========/*** 汇率变动对现金及现金等价物的影响,-359247000*/@JsonProperty("RATE_CHANGE_EFFECT")private BigDecimal rateChangeEffect;/*** 现金及现金等价物净增加额其他项目,null*/@JsonProperty("CCE_ADD_OTHER")private BigDecimal cceAddOther;/*** 现金及现金等价物净增加额平衡项目,0*/@JsonProperty("CCE_ADD_BALANCE")private BigDecimal cceAddBalance;/*** 现金及现金等价物净增加额,-6255203000*/@JsonProperty("CCE_ADD")private BigDecimal cceAdd;/*** 加:期初现金及现金等价物余额 ,108511745000*/@JsonProperty("BEGIN_CCE")private BigDecimal beginCce;/*** 期末现金及现金等价物余额其他项目,null*/@JsonProperty("END_CCE_OTHER")private BigDecimal endCceOther;/*** 期末现金及现金等价物余额平衡项目,0*/@JsonProperty("END_CCE_BALANCE")private BigDecimal endCceBalance;/*** 期末现金及现金等价物余额,102256542000*/@JsonProperty("END_CCE")private BigDecimal endCce;// ========== 补充资料 ==========/*** 净利润,41587940000*/@JsonProperty("NETPROFIT")private BigDecimal netProfit;/*** 资产减值准备,3871677000*/@JsonProperty("ASSET_IMPAIRMENT")private BigDecimal assetImpairment;/*** 固定资产和投资性房地产折旧,56921769000*/@JsonProperty("FA_IR_DEPR")private BigDecimal faIrDepr;/*** 其中:固定资产折旧、油气资产折耗、生产性生物资产折旧,56920062000*/@JsonProperty("OILGAS_BIOLOGY_DEPR")private BigDecimal oilgasBiologyDepr;/*** 投资性房地产折旧,1707000*/@JsonProperty("IR_DEPR")private BigDecimal irDepr;/*** 无形资产摊销,5514039000*/@JsonProperty("IA_AMORTIZE")private BigDecimal iaAmortize;/*** 长期待摊费用摊销,1827327000*/@JsonProperty("LPE_AMORTIZE")private BigDecimal lpeAmortize;/*** 递延收益摊销,null*/@JsonProperty("DEFER_INCOME_AMORTIZE")private BigDecimal deferIncomeAmortize;/*** 预付费用减少,null*/@JsonProperty("PREPAID_EXPENSE_REDUCE")private BigDecimal prepaidExpenseReduce;/*** 预提费用增加,null*/@JsonProperty("ACCRUED_EXPENSE_ADD")private BigDecimal accruedExpenseAdd;/*** 处置固定资产、无形资产和其他长期资产的损失,1758636000*/@JsonProperty("DISPOSAL_LONGASSET_LOSS")private BigDecimal disposalLongassetLoss;/*** 固定资产报废损失,null*/@JsonProperty("FA_SCRAP_LOSS")private BigDecimal faScrapLoss;/*** 公允价值变动损失,-531933000*/@JsonProperty("FAIRVALUE_CHANGE_LOSS")private BigDecimal fairvalueChangeLoss;/*** 财务费用,1907942000*/@JsonProperty("FINANCE_EXPENSE")private BigDecimal financeExpense;/*** 投资损失,-2298886000*/@JsonProperty("INVEST_LOSS")private BigDecimal investLoss;/*** 递延所得税,-3179245000*/@JsonProperty("DEFER_TAX")private BigDecimal deferTax;/*** 其中:递延所得税资产减少,-1975070000*/@JsonProperty("DT_ASSET_REDUCE")private BigDecimal dtAssetReduce;/*** 递延所得税负债增加,-1204175000*/@JsonProperty("DT_LIAB_ADD")private BigDecimal dtLiabAdd;/*** 预计负债增加,null*/@JsonProperty("PREDICT_LIAB_ADD")private BigDecimal predictLiabAdd;/*** 存货的减少,-31248137000*/@JsonProperty("INVENTORY_REDUCE")private BigDecimal inventoryReduce;/*** 经营性应收项目的减少,-14841203000*/@JsonProperty("OPERATE_RECE_REDUCE")private BigDecimal operateReceReduce;/*** 经营性应付项目的增加,67559896000*/@JsonProperty("OPERATE_PAYABLE_ADD")private BigDecimal operatePayableAdd;/*** 其他,407495000*/@JsonProperty("OTHER")private BigDecimal other;/*** 经营活动产生的现金流量净额其他项目(补充资料),null*/@JsonProperty("OPERATE_NETCASH_OTHERNOTE")private BigDecimal operateNetcashOthernote;/*** 经营活动产生的现金流量净额平衡项目(补充资料),0*/@JsonProperty("OPERATE_NETCASH_BALANCENOTE")private BigDecimal operateNetcashBalancenote;/*** 经营活动产生的现金流量净额(补充资料),133453873000*/@JsonProperty("NETCASH_OPERATENOTE")private BigDecimal netcashOperatenote;/*** 债务转为资本,null*/@JsonProperty("DEBT_TRANSFER_CAPITAL")private BigDecimal debtTransferCapital;/*** 一年内到期的可转换公司债券,null*/@JsonProperty("CONVERT_BOND_1YEAR")private BigDecimal convertBond1year;/*** 融资租入固定资产,null*/@JsonProperty("FINLEASE_OBTAIN_FA")private BigDecimal finleaseObtainFa;/*** 不涉及现金收支的投资和筹资活动金额其他项目,3912264000*/@JsonProperty("UNINVOLVE_INVESTFIN_OTHER")private BigDecimal uninvolveInvestfinOther;/*** 现金的期末余额,102256542000*/@JsonProperty("END_CASH")private BigDecimal endCash;/*** 减:现金的期初余额,108511745000*/@JsonProperty("BEGIN_CASH")private BigDecimal beginCash;/*** 现金等价物的期末余额,null*/@JsonProperty("END_CASH_EQUIVALENTS")private BigDecimal endCashEquivalents;/*** 现金等价物的期初余额,null*/@JsonProperty("BEGIN_CASH_EQUIVALENTS")private BigDecimal beginCashEquivalents;/*** 现金及现金等价物净增加额其他项目(补充资料),null*/@JsonProperty("CCE_ADD_OTHERNOTE")private BigDecimal cceAddOthernote;/*** 现金及现金等价物净增加额平衡项目(补充资料),null*/@JsonProperty("CCE_ADD_BALANCENOTE")private BigDecimal cceAddBalancenote;/*** 现金及现金等价物的净增加额(补充资料),-6255203000*/@JsonProperty("CCE_ADDNOTE")private BigDecimal cceAddnote;// ========== 同比增长率字段 ==========/*** 销售商品、提供劳务收到的现金同比增长率*/@JsonProperty("SALES_SERVICES_YOY")private BigDecimal salesServicesYoy;/*** 客户存款和同业存放款项净增加额同比增长率*/@JsonProperty("DEPOSIT_INTERBANK_ADD_YOY")private BigDecimal depositInterbankAddYoy;/*** 向中央银行借款净增加额同比增长率*/@JsonProperty("LOAN_PBC_ADD_YOY")private BigDecimal loanPbcAddYoy;/*** 向其他金融机构拆入资金净增加额同比增长率*/@JsonProperty("OFI_BF_ADD_YOY")private BigDecimal ofiBfAddYoy;/*** 收到原保险合同保费取得的现金同比增长率*/@JsonProperty("RECEIVE_ORIGIC_PREMIUM_YOY")private BigDecimal receiveOrigicPremiumYoy;/*** 收到再保险业务现金净额同比增长率*/@JsonProperty("RECEIVE_REINSURE_NET_YOY")private BigDecimal receiveReinsureNetYoy;/*** 保户储金及投资款净增加额同比增长率*/@JsonProperty("INSURED_INVEST_ADD_YOY")private BigDecimal insuredInvestAddYoy;/*** 处置交易性金融资产净增加额同比增长率*/@JsonProperty("DISPOSAL_TFA_ADD_YOY")private BigDecimal disposalTfaAddYoy;/*** 收取利息、手续费及佣金的现金同比增长率*/@JsonProperty("RECEIVE_INTEREST_COMMISSION_YOY")private BigDecimal receiveInterestCommissionYoy;/*** 拆入资金净增加额同比增长率*/@JsonProperty("BORROW_FUND_ADD_YOY")private BigDecimal borrowFundAddYoy;/*** 回购业务资金净增加额同比增长率*/@JsonProperty("LOAN_ADVANCE_REDUCE_YOY")private BigDecimal loanAdvanceReduceYoy;/*** 代理买卖证券收到的现金净额同比增长率*/@JsonProperty("REPO_BUSINESS_ADD_YOY")private BigDecimal repoBusinessAddYoy;/*** 收到的税费返还同比增长率*/@JsonProperty("RECEIVE_TAX_REFUND_YOY")private BigDecimal receiveTaxRefundYoy;/*** 收到其他与经营活动有关的现金同比增长率*/@JsonProperty("RECEIVE_OTHER_OPERATE_YOY")private BigDecimal receiveOtherOperateYoy;/*** 经营活动现金流入其他项目同比增长率*/@JsonProperty("OPERATE_INFLOW_OTHER_YOY")private BigDecimal operateInflowOtherYoy;/*** 经营活动现金流入平衡项目同比增长率*/@JsonProperty("OPERATE_INFLOW_BALANCE_YOY")private BigDecimal operateInflowBalanceYoy;/*** 经营活动现金流入小计同比增长率*/@JsonProperty("TOTAL_OPERATE_INFLOW_YOY")private BigDecimal totalOperateInflowYoy;/*** 购买商品、接受劳务支付的现金同比增长率*/@JsonProperty("BUY_SERVICES_YOY")private BigDecimal buyServicesYoy;/*** 客户贷款及垫款净增加额同比增长率*/@JsonProperty("LOAN_ADVANCE_ADD_YOY")private BigDecimal loanAdvanceAddYoy;/*** 存放中央银行和同业款项净增加额同比增长率*/@JsonProperty("PBC_INTERBANK_ADD_YOY")private BigDecimal pbcInterbankAddYoy;/*** 支付原保险合同赔付款项的现金同比增长率*/@JsonProperty("PAY_ORIGIC_COMPENSATE_YOY")private BigDecimal payOrigicCompensateYoy;/*** 支付利息、手续费及佣金的现金同比增长率*/@JsonProperty("PAY_INTEREST_COMMISSION_YOY")private BigDecimal payInterestCommissionYoy;/*** 支付保单红利的现金同比增长率*/@JsonProperty("PAY_POLICY_BONUS_YOY")private BigDecimal payPolicyBonusYoy;/*** 支付给职工以及为职工支付的现金同比增长率*/@JsonProperty("PAY_STAFF_CASH_YOY")private BigDecimal payStaffCashYoy;/*** 支付的各项税费同比增长率*/@JsonProperty("PAY_ALL_TAX_YOY")private BigDecimal payAllTaxYoy;/*** 支付其他与经营活动有关的现金同比增长率*/@JsonProperty("PAY_OTHER_OPERATE_YOY")private BigDecimal payOtherOperateYoy;/*** 经营活动现金流出其他项目同比增长率*/@JsonProperty("OPERATE_OUTFLOW_OTHER_YOY")private BigDecimal operateOutflowOtherYoy;/*** 经营活动现金流出平衡项目同比增长率*/@JsonProperty("OPERATE_OUTFLOW_BALANCE_YOY")private BigDecimal operateOutflowBalanceYoy;/*** 经营活动现金流出小计同比增长率*/@JsonProperty("TOTAL_OPERATE_OUTFLOW_YOY")private BigDecimal totalOperateOutflowYoy;/*** 经营活动产生的现金流量净额其他项目同比增长率*/@JsonProperty("OPERATE_NETCASH_OTHER_YOY")private BigDecimal operateNetcashOtherYoy;/*** 经营活动产生的现金流量净额平衡项目同比增长率*/@JsonProperty("OPERATE_NETCASH_BALANCE_YOY")private BigDecimal operateNetcashBalanceYoy;/*** 经营活动产生的现金流量净额同比增长率*/@JsonProperty("NETCASH_OPERATE_YOY")private BigDecimal netcashOperateYoy;/*** 收回投资收到的现金同比增长率*/@JsonProperty("WITHDRAW_INVEST_YOY")private BigDecimal withdrawInvestYoy;/*** 取得投资收益收到的现金同比增长率*/@JsonProperty("RECEIVE_INVEST_INCOME_YOY")private BigDecimal receiveInvestIncomeYoy;/*** 处置固定资产、无形资产和其他长期资产收回的现金净额同比增长率*/@JsonProperty("DISPOSAL_LONG_ASSET_YOY")private BigDecimal disposalLongAssetYoy;/*** 处置子公司及其他营业单位收到的现金净额同比增长率*/@JsonProperty("DISPOSAL_SUBSIDIARY_OTHER_YOY")private BigDecimal disposalSubsidiaryOtherYoy;/*** 减少质押和定期存款所收到的现金同比增长率*/@JsonProperty("REDUCE_PLEDGE_TIMEDEPOSITS_YOY")private BigDecimal reducePledgeTimedepositsYoy;/*** 收到其他与投资活动有关的现金同比增长率*/@JsonProperty("RECEIVE_OTHER_INVEST_YOY")private BigDecimal receiveOtherInvestYoy;/*** 投资活动现金流入其他项目同比增长率*/@JsonProperty("INVEST_INFLOW_OTHER_YOY")private BigDecimal investInflowOtherYoy;/*** 投资活动现金流入平衡项目同比增长率*/@JsonProperty("INVEST_INFLOW_BALANCE_YOY")private BigDecimal investInflowBalanceYoy;/*** 投资活动现金流入小计同比增长率*/@JsonProperty("TOTAL_INVEST_INFLOW_YOY")private BigDecimal totalInvestInflowYoy;/*** 购建固定资产、无形资产和其他长期资产支付的现金同比增长率*/@JsonProperty("CONSTRUCT_LONG_ASSET_YOY")private BigDecimal constructLongAssetYoy;/*** 投资支付的现金同比增长率*/@JsonProperty("INVEST_PAY_CASH_YOY")private BigDecimal investPayCashYoy;/*** 质押贷款净增加额同比增长率*/@JsonProperty("PLEDGE_LOAN_ADD_YOY")private BigDecimal pledgeLoanAddYoy;/*** 取得子公司及其他营业单位支付的现金净额同比增长率*/@JsonProperty("OBTAIN_SUBSIDIARY_OTHER_YOY")private BigDecimal obtainSubsidiaryOtherYoy;/*** 增加质押和定期存款所支付的现金同比增长率*/@JsonProperty("ADD_PLEDGE_TIMEDEPOSITS_YOY")private BigDecimal addPledgeTimedepositsYoy;/*** 支付其他与投资活动有关的现金同比增长率*/@JsonProperty("PAY_OTHER_INVEST_YOY")private BigDecimal payOtherInvestYoy;/*** 投资活动现金流出其他项目同比增长率*/@JsonProperty("INVEST_OUTFLOW_OTHER_YOY")private BigDecimal investOutflowOtherYoy;/*** 投资活动现金流出平衡项目同比增长率*/@JsonProperty("INVEST_OUTFLOW_BALANCE_YOY")private BigDecimal investOutflowBalanceYoy;/*** 投资活动现金流出小计同比增长率*/@JsonProperty("TOTAL_INVEST_OUTFLOW_YOY")private BigDecimal totalInvestOutflowYoy;/*** 投资活动产生的现金流量净额其他项目同比增长率*/@JsonProperty("INVEST_NETCASH_OTHER_YOY")private BigDecimal investNetcashOtherYoy;/*** 投资活动产生的现金流量净额平衡项目同比增长率*/@JsonProperty("INVEST_NETCASH_BALANCE_YOY")private BigDecimal investNetcashBalanceYoy;/*** 投资活动产生的现金流量净额同比增长率*/@JsonProperty("NETCASH_INVEST_YOY")private BigDecimal netcashInvestYoy;/*** 吸收投资收到的现金同比增长率*/@JsonProperty("ACCEPT_INVEST_CASH_YOY")private BigDecimal acceptInvestCashYoy;/*** 子公司吸收少数股东投资收到的现金同比增长率*/@JsonProperty("SUBSIDIARY_ACCEPT_INVEST_YOY")private BigDecimal subsidiaryAcceptInvestYoy;/*** 取得借款收到的现金同比增长率*/@JsonProperty("RECEIVE_LOAN_CASH_YOY")private BigDecimal receiveLoanCashYoy;/*** 发行债券收到的现金同比增长率*/@JsonProperty("ISSUE_BOND_YOY")private BigDecimal issueBondYoy;/*** 收到其他与筹资活动有关的现金同比增长率*/@JsonProperty("RECEIVE_OTHER_FINANCE_YOY")private BigDecimal receiveOtherFinanceYoy;/*** 筹资活动现金流入其他项目同比增长率*/@JsonProperty("FINANCE_INFLOW_OTHER_YOY")private BigDecimal financeInflowOtherYoy;/*** 筹资活动现金流入平衡项目同比增长率*/@JsonProperty("FINANCE_INFLOW_BALANCE_YOY")private BigDecimal financeInflowBalanceYoy;/*** 筹资活动现金流入小计同比增长率*/@JsonProperty("TOTAL_FINANCE_INFLOW_YOY")private BigDecimal totalFinanceInflowYoy;/*** 偿还债务支付的现金同比增长率*/@JsonProperty("PAY_DEBT_CASH_YOY")private BigDecimal payDebtCashYoy;/*** 分配股利、利润或偿付利息支付的现金同比增长率*/@JsonProperty("ASSIGN_DIVIDEND_PORFIT_YOY")private BigDecimal assignDividendPorfitYoy;/*** 子公司支付给少数股东的股利、利润同比增长率*/@JsonProperty("SUBSIDIARY_PAY_DIVIDEND_YOY")private BigDecimal subsidiaryPayDividendYoy;/*** 购买少数股权支付的现金同比增长率*/@JsonProperty("BUY_SUBSIDIARY_EQUITY_YOY")private BigDecimal buySubsidiaryEquityYoy;/*** 支付其他与筹资活动有关的现金同比增长率*/@JsonProperty("PAY_OTHER_FINANCE_YOY")private BigDecimal payOtherFinanceYoy;/*** 子公司减资支付给少数股东的现金同比增长率*/@JsonProperty("SUBSIDIARY_REDUCE_CASH_YOY")private BigDecimal subsidiaryReduceCashYoy;/*** 筹资活动现金流出其他项目同比增长率*/@JsonProperty("FINANCE_OUTFLOW_OTHER_YOY")private BigDecimal financeOutflowOtherYoy;/*** 筹资活动现金流出平衡项目同比增长率*/@JsonProperty("FINANCE_OUTFLOW_BALANCE_YOY")private BigDecimal financeOutflowBalanceYoy;/*** 筹资活动现金流出小计同比增长率*/@JsonProperty("TOTAL_FINANCE_OUTFLOW_YOY")private BigDecimal totalFinanceOutflowYoy;/*** 筹资活动产生的现金流量净额其他项目同比增长率*/@JsonProperty("FINANCE_NETCASH_OTHER_YOY")private BigDecimal financeNetcashOtherYoy;/*** 筹资活动产生的现金流量净额平衡项目同比增长率*/@JsonProperty("FINANCE_NETCASH_BALANCE_YOY")private BigDecimal financeNetcashBalanceYoy;/*** 筹资活动产生的现金流量净额同比增长率*/@JsonProperty("NETCASH_FINANCE_YOY")private BigDecimal netcashFinanceYoy;/*** 汇率变动对现金及现金等价物的影响同比增长率*/@JsonProperty("RATE_CHANGE_EFFECT_YOY")private BigDecimal rateChangeEffectYoy;/*** 现金及现金等价物净增加额其他项目同比增长率*/@JsonProperty("CCE_ADD_OTHER_YOY")private BigDecimal cceAddOtherYoy;/*** 现金及现金等价物净增加额平衡项目同比增长率*/@JsonProperty("CCE_ADD_BALANCE_YOY")private BigDecimal cceAddBalanceYoy;/*** 现金及现金等价物净增加额同比增长率*/@JsonProperty("CCE_ADD_YOY")private BigDecimal cceAddYoy;/*** 期初现金及现金等价物余额同比增长率*/@JsonProperty("BEGIN_CCE_YOY")private BigDecimal beginCceYoy;/*** 期末现金及现金等价物余额其他项目同比增长率*/@JsonProperty("END_CCE_OTHER_YOY")private BigDecimal endCceOtherYoy;/*** 期末现金及现金等价物余额平衡项目同比增长率*/@JsonProperty("END_CCE_BALANCE_YOY")private BigDecimal endCceBalanceYoy;/*** 期末现金及现金等价物余额同比增长率*/@JsonProperty("END_CCE_YOY")private BigDecimal endCceYoy;/*** 净利润同比增长率*/@JsonProperty("NETPROFIT_YOY")private BigDecimal netProfitYoy;/*** 资产减值准备同比增长率*/@JsonProperty("ASSET_IMPAIRMENT_YOY")private BigDecimal assetImpairmentYoy;/*** 固定资产折旧、油气资产折耗、生产性生物资产折旧同比增长率*/@JsonProperty("FA_IR_DEPR_YOY")private BigDecimal faIrDeprYoy;/*** 油气资产折耗同比增长率*/@JsonProperty("OILGAS_BIOLOGY_DEPR_YOY")private BigDecimal oilgasBiologyDeprYoy;/*** 生产性生物资产折旧同比增长率*/@JsonProperty("IR_DEPR_YOY")private BigDecimal irDeprYoy;/*** 无形资产摊销同比增长率*/@JsonProperty("IA_AMORTIZE_YOY")private BigDecimal iaAmortizeYoy;/*** 长期待摊费用摊销同比增长率*/@JsonProperty("LPE_AMORTIZE_YOY")private BigDecimal lpeAmortizeYoy;/*** 递延收益摊销同比增长率*/@JsonProperty("DEFER_INCOME_AMORTIZE_YOY")private BigDecimal deferIncomeAmortizeYoy;/*** 预付费用减少同比增长率*/@JsonProperty("PREPAID_EXPENSE_REDUCE_YOY")private BigDecimal prepaidExpenseReduceYoy;/*** 预提费用增加同比增长率*/@JsonProperty("ACCRUED_EXPENSE_ADD_YOY")private BigDecimal accruedExpenseAddYoy;/*** 处置固定资产、无形资产和其他长期资产的损失同比增长率*/@JsonProperty("DISPOSAL_LONGASSET_LOSS_YOY")private BigDecimal disposalLongassetLossYoy;/*** 固定资产报废损失同比增长率*/@JsonProperty("FA_SCRAP_LOSS_YOY")private BigDecimal faScrapLossYoy;/*** 公允价值变动损失同比增长率*/@JsonProperty("FAIRVALUE_CHANGE_LOSS_YOY")private BigDecimal fairvalueChangeLossYoy;/*** 财务费用同比增长率*/@JsonProperty("FINANCE_EXPENSE_YOY")private BigDecimal financeExpenseYoy;/*** 投资损失同比增长率*/@JsonProperty("INVEST_LOSS_YOY")private BigDecimal investLossYoy;/*** 递延所得税同比增长率*/@JsonProperty("DEFER_TAX_YOY")private BigDecimal deferTaxYoy;/*** 递延所得税资产减少同比增长率*/@JsonProperty("DT_ASSET_REDUCE_YOY")private BigDecimal dtAssetReduceYoy;/*** 递延所得税负债增加同比增长率*/@JsonProperty("DT_LIAB_ADD_YOY")private BigDecimal dtLiabAddYoy;/*** 预计负债增加同比增长率*/@JsonProperty("PREDICT_LIAB_ADD_YOY")private BigDecimal predictLiabAddYoy;/*** 存货的减少同比增长率*/@JsonProperty("INVENTORY_REDUCE_YOY")private BigDecimal inventoryReduceYoy;/*** 经营性应收项目的减少同比增长率*/@JsonProperty("OPERATE_RECE_REDUCE_YOY")private BigDecimal operateReceReduceYoy;/*** 经营性应付项目的增加同比增长率*/@JsonProperty("OPERATE_PAYABLE_ADD_YOY")private BigDecimal operatePayableAddYoy;/*** 其他同比增长率*/@JsonProperty("OTHER_YOY")private BigDecimal otherYoy;/*** 经营活动产生的现金流量净额其他项目同比增长率(补充资料)*/@JsonProperty("OPERATE_NETCASH_OTHERNOTE_YOY")private BigDecimal operateNetcashOthernoteYoy;/*** 经营活动产生的现金流量净额平衡项目同比增长率(补充资料)*/@JsonProperty("OPERATE_NETCASH_BALANCENOTE_YOY")private BigDecimal operateNetcashBalancenoteYoy;/*** 经营活动产生的现金流量净额同比增长率(补充资料)*/@JsonProperty("NETCASH_OPERATENOTE_YOY")private BigDecimal netcashOperatenoteYoy;/*** 债务转为资本同比增长率*/@JsonProperty("DEBT_TRANSFER_CAPITAL_YOY")private BigDecimal debtTransferCapitalYoy;/*** 一年内到期的可转换公司债券同比增长率*/@JsonProperty("CONVERT_BOND_1YEAR_YOY")private BigDecimal convertBond1yearYoy;/*** 融资租入固定资产同比增长率*/@JsonProperty("FINLEASE_OBTAIN_FA_YOY")private BigDecimal finleaseObtainFaYoy;/*** 不涉及现金收支的投资和筹资活动其他项目同比增长率*/@JsonProperty("UNINVOLVE_INVESTFIN_OTHER_YOY")private BigDecimal uninvolveInvestfinOtherYoy;/*** 现金的期末余额同比增长率*/@JsonProperty("END_CASH_YOY")private BigDecimal endCashYoy;/*** 现金的期初余额同比增长率*/@JsonProperty("BEGIN_CASH_YOY")private BigDecimal beginCashYoy;/*** 现金等价物的期末余额同比增长率*/@JsonProperty("END_CASH_EQUIVALENTS_YOY")private BigDecimal endCashEquivalentsYoy;/*** 现金等价物的期初余额同比增长率*/@JsonProperty("BEGIN_CASH_EQUIVALENTS_YOY")private BigDecimal beginCashEquivalentsYoy;/*** 现金及现金等价物净增加额其他项目同比增长率(补充资料)*/@JsonProperty("CCE_ADD_OTHERNOTE_YOY")private BigDecimal cceAddOthernoteYoy;/*** 现金及现金等价物净增加额平衡项目同比增长率(补充资料)*/@JsonProperty("CCE_ADD_BALANCENOTE_YOY")private BigDecimal cceAddBalancenoteYoy;/*** 现金及现金等价物净增加额同比增长率(补充资料)*/@JsonProperty("CCE_ADDNOTE_YOY")private BigDecimal cceAddnoteYoy;/*** 审计意见*/@JsonProperty("OPINION_TYPE")private String opinionType;/*** 其他审计意见*/@JsonProperty("OSOPINION_TYPE")private String osopinionType;/*** 少数股东损益*/@JsonProperty("MINORITY_INTEREST")private BigDecimal minorityInterest;/*** 少数股东损益同比增长率*/@JsonProperty("MINORITY_INTEREST_YOY")private BigDecimal minorityInterestYoy;/*** 使用权资产摊销*/@JsonProperty("USERIGHT_ASSET_AMORTIZE")private BigDecimal userightAssetAmortize;/*** 使用权资产摊销同比增长率*/@JsonProperty("USERIGHT_ASSET_AMORTIZE_YOY")private BigDecimal userightAssetAmortizeYoy;
}package com.sankuai.qinling.data.mmp.biz.service.impl;import com.fasterxml.jackson.databind.ObjectMapper;
import com.sankuai.csc.common.tool.JsonUtils;
import com.sankuai.csc.common.tool.log.JsonLogUtil;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyCashFlowApiResponseBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyCashFlowDataBo;
import com.sankuai.qinling.data.mmp.biz.service.EastMoneyCashFlowService;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Service;import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;/*** 东方财富现金流数据服务实现类** @author system* @date 2024-12-19*/
@Service
public class EastMoneyCashFlowServiceImpl implements EastMoneyCashFlowService {/*** 东方财富现金流API基础URL*/private static final String CASH_FLOW_BASE_URL = "https://datacenter.eastmoney.com/securities/api/data/get";/*** 现金流报告名称*/private static final String CASH_FLOW_REPORT_NAME = "RPT_F10_FINANCE_GCASHFLOW";/*** 现金流报告样式*/private static final String CASH_FLOW_STYLE = "APP_F10_GCASHFLOW";/*** HTTP客户端*/private final CloseableHttpClient httpClient;/*** JSON对象映射器*/private final ObjectMapper objectMapper;public EastMoneyCashFlowServiceImpl() {// 配置请求超时时间RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setConnectionRequestTimeout(30000).build();this.httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();this.objectMapper = new ObjectMapper();}@Overridepublic List<EastMoneyCashFlowDataBo> getCashFlowDataBySecuCodeAndReportDates(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) throws Exception {System.out.println("开始获取现金流数据, secuCode: " + secuCode + ", pageNumber: " + pageNumber +", pageSize: " + pageSize + ", reportDateList: " + JsonLogUtil.createLogObject(reportDateList));EastMoneyCashFlowApiResponseBo response = getCashFlowApiResponse(secuCode, pageNumber, pageSize, reportDateList);if (response == null || response.getResult() == null || response.getResult().getData() == null) {System.out.println("获取现金流数据为空, secuCode: " + secuCode);return Collections.emptyList();}List<EastMoneyCashFlowDataBo> dataList = response.getResult().getData();System.out.println("成功获取现金流数据, secuCode: " + secuCode + ", 数据条数: " + dataList.size());return dataList;}@Overridepublic EastMoneyCashFlowApiResponseBo getCashFlowApiResponse(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) throws Exception {// 参数校验if (StringUtils.isBlank(secuCode)) {throw new IllegalArgumentException("证券代码不能为空");}if (pageNumber == null || pageNumber < 1) {pageNumber = 1;}if (pageSize == null || pageSize < 1) {pageSize = 5;}if (reportDateList == null || reportDateList.isEmpty()) {throw new IllegalArgumentException("报告日期列表不能为空");}try {// 构建请求URLString url = buildRequestUrl(secuCode, pageNumber, pageSize, reportDateList);System.out.println("开始调用东方财富现金流API, url: " + url);// 创建HTTP GET请求HttpGet httpGet = new HttpGet(url);httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36");// 发送请求CloseableHttpResponse response = httpClient.execute(httpGet);try {int statusCode = response.getStatusLine().getStatusCode();System.out.println("东方财富现金流API调用完成, 状态码: " + statusCode);// 检查响应状态if (statusCode != 200) {throw new RuntimeException("API调用失败, 状态码: " + statusCode);}// 获取响应内容HttpEntity entity = response.getEntity();String responseBody = EntityUtils.toString(entity, StandardCharsets.UTF_8);System.out.println("响应长度: " + responseBody.length());System.out.println("API响应内容: " + responseBody);EastMoneyCashFlowApiResponseBo apiResponse = objectMapper.readValue(responseBody, EastMoneyCashFlowApiResponseBo.class);// 检查业务响应if (apiResponse == null || !Boolean.TRUE.equals(apiResponse.getSuccess())) {String errorMsg = apiResponse != null ? apiResponse.getMessage() : "未知错误";throw new RuntimeException("API业务调用失败: " + errorMsg);}System.out.println("成功解析现金流API响应, 总记录数: " +(apiResponse.getResult() != null ? apiResponse.getResult().getCount() : 0) +", 总页数: " + (apiResponse.getResult() != null ? apiResponse.getResult().getPages() : 0));return apiResponse;} finally {response.close();}} catch (IOException e) {System.err.println("调用东方财富现金流API发生IO异常, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("网络请求异常: " + e.getMessage(), e);} catch (Exception e) {System.err.println("调用东方财富现金流API发生未知异常, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("系统异常: " + e.getMessage(), e);}}/*** 构建请求URL** @param secuCode 证券代码* @param pageNumber 页码* @param pageSize 每页大小* @param reportDateList 报告日期列表* @return 完整的请求URL*/private String buildRequestUrl(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) {try {// 构建证券代码过滤条件String secuCodeFilter = String.format("(SECUCODE=\"%s\")", secuCode);// 构建报告日期过滤条件String reportDateFilter = reportDateList.stream().map(date -> String.format("'%s'", date)).collect(Collectors.joining(",", "(REPORT_DATE in (", "))"));// 组合过滤条件String combinedFilter = secuCodeFilter + reportDateFilter;// URL编码过滤条件String encodedFilter = URLEncoder.encode(combinedFilter, StandardCharsets.UTF_8.toString());// 构建完整URLString url = String.format("%s?type=%s&sty=%s&filter=%s&p=%d&ps=%d&sr=-1&st=REPORT_DATE&source=HSF10&client=PC&v=%s",CASH_FLOW_BASE_URL, CASH_FLOW_REPORT_NAME, CASH_FLOW_STYLE, encodedFilter, pageNumber, pageSize, generateVersion());System.out.println("构建的请求URL: " + url);return url;} catch (Exception e) {System.err.println("构建请求URL失败, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("构建请求URL失败: " + e.getMessage(), e);}}/*** 生成版本号** @return 版本号字符串*/private String generateVersion() {// 生成一个简单的版本号,可以使用时间戳或随机数return String.valueOf(System.currentTimeMillis() % 100000000000000L);}/*** 测试方法** @param args 命令行参数*/public static void main(String[] args) {EastMoneyCashFlowServiceImpl service = new EastMoneyCashFlowServiceImpl();try {// 测试参数String secuCode = "002594.SZ";Integer pageNumber = 1;Integer pageSize = 5;List<String> reportDateList = Arrays.asList("2024-12-31", "2024-09-30");System.out.println("开始测试获取现金流数据, secuCode: " + secuCode +", pageNumber: " + pageNumber +", pageSize: " + pageSize +", reportDateList: " + reportDateList);// 调用方法获取现金流数据List<EastMoneyCashFlowDataBo> cashFlowDataList = service.getCashFlowDataBySecuCodeAndReportDates(secuCode, pageNumber, pageSize, reportDateList);System.out.println("现金流数据详情:");System.out.println(JsonUtils.toJSONString(cashFlowDataList));if (cashFlowDataList != null && !cashFlowDataList.isEmpty()) {System.out.println("成功获取现金流数据, 总条数: " + cashFlowDataList.size());// 打印前几条数据作为示例for (int i = 0; i < Math.min(3, cashFlowDataList.size()); i++) {EastMoneyCashFlowDataBo data = cashFlowDataList.get(i);System.out.println("第" + (i + 1) + "条数据 - 证券代码: " + data.getSecuCode() +", 证券名称: " + data.getSecurityNameAbbr() +", 报告日期: " + data.getReportDate() +", 经营活动现金流量净额: " + data.getNetcashOperate());}} else {System.out.println("未获取到现金流数据");}} catch (Exception e) {System.err.println("测试获取现金流数据失败, error: " + e.getMessage());e.printStackTrace();}}
}
4、杜邦分析数据获取
package com.sankuai.qinling.data.mmp.biz.bo;import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;import java.math.BigDecimal;/*** 东方财富财务数据Bo对象** @author system* @date 2024-12-19*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class EastMoneyFinanceDataBo {/** 证券代码,002594.SZ */@JsonProperty("SECUCODE")private String secuCode;/** 股票代码,002594 */@JsonProperty("SECURITY_CODE")private String securityCode;/** 股票简称,比亚迪 */@JsonProperty("SECURITY_NAME_ABBR")private String securityNameAbbr;/** 机构代码,10010554 */@JsonProperty("ORG_CODE")private String orgCode;/** 机构类型,通用 */@JsonProperty("ORG_TYPE")private String orgType;/** 报告日期,2025-06-30 00:00:00 */@JsonProperty("REPORT_DATE")private String reportDate;/** 报告类型,2025中报 */@JsonProperty("REPORT_TYPE")private String reportType;/** 报告日期名称,中报 */@JsonProperty("REPORT_DATE_NAME")private String reportDateName;/** 证券类型代码,058001001 */@JsonProperty("SECURITY_TYPE_CODE")private String securityTypeCode;/** 公告日期,2025-08-30 00:00:00 */@JsonProperty("NOTICE_DATE")private String noticeDate;/** 更新日期,2025-08-30 00:00:00 */@JsonProperty("UPDATE_DATE")private String updateDate;/** 货币单位,CNY(元) */@JsonProperty("CURRENCY")private String currency;/** 净利润,16038939000 */@JsonProperty("NETPROFIT")private BigDecimal netProfit;/** 营业总收入,371280948000 */@JsonProperty("TOTAL_OPERATE_INCOME")private BigDecimal totalOperateIncome;/** 总资产总计,846342643000 */@JsonProperty("TOTAL_ASSETS")private BigDecimal totalAssets;/** 总负债合计,601592451000 */@JsonProperty("TOTAL_LIABILITIES")private BigDecimal totalLiabilities;/** 流动资产合计,390635460000 */@JsonProperty("TOTAL_CURRENT_ASSETS")private BigDecimal totalCurrentAssets;/** 非流动资产合计,455707183000 */@JsonProperty("TOTAL_NONCURRENT_ASSETS")private BigDecimal totalNonCurrentAssets;/** 归属于母公司股东的净利润,15510533000 */@JsonProperty("PARENT_NETPROFIT")private BigDecimal parentNetProfit;/** 净利率(%),4.319892816046 */@JsonProperty("SALE_NPR")private BigDecimal saleNpr;/** 总资产周转率(次),0.45564372607 */@JsonProperty("TOTAL_ASSETS_TR")private BigDecimal totalAssetsTr;/** 总资产收益率(加权)(%),1.9683320589 */@JsonProperty("JROA")private BigDecimal jroa;/** 归属于母公司股东的净利润占比,96.705480331336 */@JsonProperty("PARENT_NETPROFIT_RATIO")private BigDecimal parentNetProfitRatio;/** 权益乘数,3.457985614165 */@JsonProperty("EQUITY_MULTIPLIER")private BigDecimal equityMultiplier;/** 净资产收益率,7.43 */@JsonProperty("ROE")private BigDecimal roe;/** 资产负债率(%),71.081429723021 */@JsonProperty("DEBT_ASSET_RATIO")private BigDecimal debtAssetRatio;/** 收入总额(收入总额=营业总收入+(其他收益+投资收益+汇兑收益+净敞口套期收益+公允价值变动收益+资产处置收益)+营业外收入),380439530000 */@JsonProperty("TOTAL_INCOME")private BigDecimal totalIncome;/** 成本总额,361071664000 */@JsonProperty("TOTAL_COST")private BigDecimal totalCost;/** 期间费用,49146573000 */@JsonProperty("TOTAL_EXPENSE")private BigDecimal totalExpense;/** 货币资金,111734283000 */@JsonProperty("MONETARYFUNDS")private BigDecimal monetaryFunds;/** 交易性金融资产,35694505000 */@JsonProperty("TRADE_FINASSET")private BigDecimal tradeFinAsset;/** 应收票据,null */@JsonProperty("NOTE_RECE")private BigDecimal noteRece;/** 应收账款,43381542000 */@JsonProperty("ACCOUNTS_RECE")private BigDecimal accountsRece;/** 应收款项融资,7810231000 */@JsonProperty("FINANCE_RECE")private BigDecimal financeRece;/** 其他应收款,4620945000 */@JsonProperty("OTHER_RECE")private BigDecimal otherRece;/** 存货,140839351000 */@JsonProperty("INVENTORY")private BigDecimal inventory;/** 债权投资,null */@JsonProperty("CREDITOR_INVEST")private BigDecimal creditorInvest;/** 长期股权投资,20353959000 */@JsonProperty("LONG_EQUITY_INVEST")private BigDecimal longEquityInvest;/** 投资性房地产,59374000 */@JsonProperty("INVEST_REALESTATE")private BigDecimal investRealEstate;/** 固定资产,280794676000 */@JsonProperty("FIXED_ASSET")private BigDecimal fixedAsset;/** 在建工程,35606548000 */@JsonProperty("CIP")private BigDecimal cip;/** 使用权资产,9665615000 */@JsonProperty("USERIGHT_ASSET")private BigDecimal userightAsset;/** 无形资产,41062499000 */@JsonProperty("INTANGIBLE_ASSET")private BigDecimal intangibleAsset;/** 开发支出 ,1792011000*/@JsonProperty("DEVELOP_EXPENSE")private BigDecimal developExpense;/** 商誉,4427571000 */@JsonProperty("GOODWILL")private BigDecimal goodwill;/** 长期待摊费用 ,4536454000*/@JsonProperty("LONG_PREPAID_EXPENSE")private BigDecimal longPrepaidExpense;/** 递延所得税资产 ,10767098000*/@JsonProperty("DEFER_TAX_ASSET")private BigDecimal deferTaxAsset;/** 投资收益,1375879000 */@JsonProperty("INVEST_INCOME")private BigDecimal investIncome;/** 汇兑收益,null */@JsonProperty("EXCHANGE_INCOME")private BigDecimal exchangeIncome;/** 公允价值变动收益,373458000 */@JsonProperty("FAIRVALUE_CHANGE_INCOME")private BigDecimal fairValueChangeIncome;/** 资产处置收益,-17633000 */@JsonProperty("ASSET_DISPOSAL_INCOME")private BigDecimal assetDisposalIncome;/** 营业成本,304415089000 */@JsonProperty("OPERATE_COST")private BigDecimal operateCost;/** 退保金,null */@JsonProperty("SURRENDER_VALUE")private BigDecimal surrenderValue;/** 赔付支出净额,null */@JsonProperty("NET_COMPENSATE_EXPENSE")private BigDecimal netCompensateExpense;/** 提取保险合同准备金净额,null */@JsonProperty("NET_CONTRACT_RESERVE")private BigDecimal netContractReserve;/** 保单红利支出,null */@JsonProperty("POLICY_BONUS_EXPENSE")private BigDecimal policyBonusExpense;/** 营业税金及附加,5996077000 */@JsonProperty("OPERATE_TAX_ADD")private BigDecimal operateTaxAdd;/** 减:所得税,2871076000 */@JsonProperty("INCOME_TAX")private BigDecimal incomeTax;/** 资产减值损失(元),-1254303000 */@JsonProperty("ASSET_IMPAIRMENT_INCOME")private BigDecimal assetImpairmentIncome;/** 信用减值损失,-102848000 */@JsonProperty("CREDIT_IMPAIRMENT_INCOME")private BigDecimal creditImpairmentIncome;/** 减:营业外支出(元),614625000 */@JsonProperty("NONBUSINESS_EXPENSE")private BigDecimal nonBusinessExpense;/** 财务费用,-3247033000 */@JsonProperty("FINANCE_EXPENSE")private BigDecimal financeExpense;/** 销售费用 ,12410973000*/@JsonProperty("SALE_EXPENSE")private BigDecimal saleExpense;/** 管理费用,10386267000 */@JsonProperty("MANAGE_EXPENSE")private BigDecimal manageExpense;/** 研发费用,29596366000 */@JsonProperty("RESEARCH_EXPENSE")private BigDecimal researchExpense;/** 利息净收入,null */@JsonProperty("INTEREST_NI")private BigDecimal interestNi;/** 手续费及佣金净收入,null */@JsonProperty("FEE_COMMISSION_NI")private BigDecimal feeCommissionNi;/** 已赚保费,null */@JsonProperty("EARNED_PREMIUM")private BigDecimal earnedPremium;/** 业务及管理费,null */@JsonProperty("BUSINESS_MANAGE_EXPENSE")private BigDecimal businessManageExpense;/** 其他债权投资,null */@JsonProperty("OTHER_CREDITOR_INVEST")private BigDecimal otherCreditorInvest;/** 其他权益工具投资,8369539000 */@JsonProperty("OTHER_EQUITY_INVEST")private BigDecimal otherEquityInvest;/** 长期应收款,10709541000 */@JsonProperty("LONG_RECE")private BigDecimal longRece;/** 可供出售金融资产,10709541000 */@JsonProperty("AVAILABLE_SALE_FINASSET")private BigDecimal availableSaleFinAsset;/** 持有至到期投资,null */@JsonProperty("HOLD_MATURITY_INVEST")private BigDecimal holdMaturityInvest;/** 手续费及佣金支出,null */@JsonProperty("FEE_COMMISSION_EXPENSE")private BigDecimal feeCommissionExpense;// /** 经营活动现金流量净额 */
// @JsonProperty("NET_OPERATE_CASH_FLOW")
// private BigDecimal netOperateCashFlow;
//
// /** 其他收益 */
// @JsonProperty("OTHER_INCOME")
// private BigDecimal otherIncome;
}package com.sankuai.qinling.data.mmp.biz.service.impl;import com.fasterxml.jackson.databind.ObjectMapper;
import com.sankuai.csc.common.tool.JsonUtils;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyApiResponseBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyFinanceDataBo;
import com.sankuai.qinling.data.mmp.biz.converter.EastMoneyFinanceConverter;
import com.sankuai.qinling.data.mmp.biz.service.EastMoneyFinanceDubangService;
import com.sankuai.qinling.data.mmp.biz.service.finance.CoreProfitCashRateCalculator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Service;import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;/*** 东方财富财务数据服务实现类(杜邦分析法)** @author system* @date 2024-12-19*/
@Slf4j
@Service
public class EastMoneyFinanceDubangServiceImpl implements EastMoneyFinanceDubangService {/*** 东方财富API基础URL*/public static final String BASE_URL = "https://datacenter.eastmoney.com/securities/api/data/v1/get";/*** 报告名称(RPT_F10_财务_杜邦)*/public static final String REPORT_NAME = "RPT_F10_FINANCE_DUPONT";/*** 查询字段*/public static final String BASE_COLUMNS = "SECUCODE,SECURITY_CODE,SECURITY_NAME_ABBR,ORG_CODE,ORG_TYPE,REPORT_DATE,REPORT_TYPE,REPORT_DATE_NAME,SECURITY_TYPE_CODE,NOTICE_DATE,UPDATE_DATE,CURRENCY,NETPROFIT,TOTAL_OPERATE_INCOME,TOTAL_ASSETS,TOTAL_LIABILITIES,TOTAL_CURRENT_ASSETS,TOTAL_NONCURRENT_ASSETS,PARENT_NETPROFIT,SALE_NPR,TOTAL_ASSETS_TR,JROA,PARENT_NETPROFIT_RATIO,EQUITY_MULTIPLIER,ROE,DEBT_ASSET_RATIO,TOTAL_INCOME,TOTAL_COST,TOTAL_EXPENSE,MONETARYFUNDS,TRADE_FINASSET,NOTE_RECE,ACCOUNTS_RECE,FINANCE_RECE,OTHER_RECE,INVENTORY,CREDITOR_INVEST,LONG_EQUITY_INVEST,INVEST_REALESTATE,FIXED_ASSET,CIP,USERIGHT_ASSET,INTANGIBLE_ASSET,DEVELOP_EXPENSE,GOODWILL,LONG_PREPAID_EXPENSE,DEFER_TAX_ASSET,INVEST_INCOME,EXCHANGE_INCOME,FAIRVALUE_CHANGE_INCOME,ASSET_DISPOSAL_INCOME,OPERATE_COST,SURRENDER_VALUE,NET_COMPENSATE_EXPENSE,NET_CONTRACT_RESERVE,POLICY_BONUS_EXPENSE,OPERATE_TAX_ADD,INCOME_TAX,ASSET_IMPAIRMENT_INCOME,CREDIT_IMPAIRMENT_INCOME,NONBUSINESS_EXPENSE,FINANCE_EXPENSE,SALE_EXPENSE,MANAGE_EXPENSE,RESEARCH_EXPENSE,INTEREST_NI,FEE_COMMISSION_NI,EARNED_PREMIUM,BUSINESS_MANAGE_EXPENSE,OTHER_CREDITOR_INVEST,OTHER_EQUITY_INVEST,LONG_RECE,AVAILABLE_SALE_FINASSET,HOLD_MATURITY_INVEST,FEE_COMMISSION_EXPENSE";/*** HTTP客户端*/private final CloseableHttpClient httpClient;/*** JSON对象映射器*/private final ObjectMapper objectMapper;public EastMoneyFinanceDubangServiceImpl() {// 配置请求超时时间RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setConnectionRequestTimeout(30000).build();this.httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();this.objectMapper = new ObjectMapper();}@Overridepublic List<EastMoneyFinanceDataBo> getFinanceDataBySecuCode(String secuCode, Integer pageNumber, Integer pageSize) throws Exception {System.out.println("开始获取财务数据, secuCode: " + secuCode + ", pageNumber: " + pageNumber + ", pageSize: " + pageSize);EastMoneyApiResponseBo response = getFinanceApiResponse(secuCode, pageNumber, pageSize);if (response == null || response.getResult() == null || response.getResult().getData() == null) {log.warn("获取财务数据为空, secuCode: {}", secuCode);return Collections.emptyList();}List<EastMoneyFinanceDataBo> dataList = response.getResult().getData();System.out.println("成功获取财务数据, secuCode: " + secuCode + ", 数据条数: " + dataList.size());return dataList;}@Overridepublic EastMoneyApiResponseBo getFinanceApiResponse(String secuCode, Integer pageNumber, Integer pageSize) throws Exception {// 参数校验if (StringUtils.isBlank(secuCode)) {throw new Exception("证券代码不能为空");}if (pageNumber == null || pageNumber < 1) {pageNumber = 1;}if (pageSize == null || pageSize < 1) {pageSize = 20;}try {// 构建请求URLString url = buildRequestUrl(secuCode, pageNumber, pageSize);System.out.println("开始调用东方财富API, url: ");System.out.println(url);// 创建HTTP GET请求HttpGet httpGet = new HttpGet(url);httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36");// 发送请求CloseableHttpResponse response = httpClient.execute(httpGet);try {int statusCode = response.getStatusLine().getStatusCode();System.out.println("东方财富API调用完成, 状态码: " + statusCode);// 检查响应状态if (statusCode != 200) {throw new Exception("API调用失败, 状态码: " + statusCode);}// 获取响应内容HttpEntity entity = response.getEntity();String responseBody = EntityUtils.toString(entity, StandardCharsets.UTF_8);System.out.println("响应长度: " + responseBody.length());System.out.println("API响应内容: " + responseBody);EastMoneyApiResponseBo apiResponse = objectMapper.readValue(responseBody, EastMoneyApiResponseBo.class);// 检查业务响应if (apiResponse == null || !Boolean.TRUE.equals(apiResponse.getSuccess())) {String errorMsg = apiResponse != null ? apiResponse.getMessage() : "未知错误";throw new Exception("API业务调用失败: " + errorMsg);}System.out.println("成功解析API响应, 总记录数: " +(apiResponse.getResult() != null ? apiResponse.getResult().getCount() : 0) +", 总页数: " + (apiResponse.getResult() != null ? apiResponse.getResult().getPages() : 0));return apiResponse;} finally {response.close();}} catch (IOException e) {log.error("调用东方财富API发生IO异常, secuCode: {}, error: {}", secuCode, e.getMessage(), e);throw new IllegalAccessException("网络请求异常: " + e.getMessage());} catch (InterruptedException e) {log.error("调用东方财富API被中断, secuCode: {}, error: {}", secuCode, e.getMessage(), e);Thread.currentThread().interrupt();throw new IllegalAccessException("请求被中断: " + e.getMessage());} catch (Exception e) {log.error("调用东方财富API发生未知异常, secuCode: {}, error: {}", secuCode, e.getMessage(), e);throw new IllegalAccessException("系统异常: " + e.getMessage());}}/*** 构建请求URL** @param secuCode 证券代码* @param pageNumber 页码* @param pageSize 每页大小* @return 完整的请求URL*/private String buildRequestUrl(String secuCode, Integer pageNumber, Integer pageSize) throws IllegalAccessException {try {String codeStr = String.format("\"%s\"", secuCode);// 对整个filter进行URL编码String encodedFilter = URLEncoder.encode(codeStr, String.valueOf(StandardCharsets.UTF_8));// 构建过滤条件String filter = String.format("(SECUCODE=%s)", encodedFilter);String basicColumnEncoder = URLEncoder.encode(BASE_COLUMNS, String.valueOf(StandardCharsets.UTF_8));// 构建完整URLreturn String.format("%s?reportName=%s&columns=%s"eColumns=&filter=%s&pageNumber=%d&pageSize=%d&sortTypes=-1&sortColumns=REPORT_DATE&source=HSF10&client=PC&v=06743187914749531",BASE_URL, REPORT_NAME, basicColumnEncoder, filter, pageNumber, pageSize);} catch (Exception e) {log.error("构建请求URL失败, secuCode: {}, error: {}", secuCode, e.getMessage(), e);throw new IllegalAccessException("构建请求URL失败: " + e.getMessage());}}@Overridepublic List<CoreProfitCashRateCalculator.CompanyIncome> calculateCoreProfitCashRateBySecuCode(String secuCode, Integer pageNumber, Integer reportCount) throws Exception {log.info("开始计算单个公司近{}次报告的核心利润获现率, secuCode: {}", reportCount, secuCode);// 参数校验if (StringUtils.isBlank(secuCode)) {throw new Exception("证券代码不能为空");}if (reportCount == null || reportCount <= 0) {reportCount = 5; // 默认获取最近5次报告}try {// 调用getFinanceDataBySecuCode获取所有的业务报告数据List<EastMoneyFinanceDataBo> financeDataList = getFinanceDataBySecuCode(secuCode, 1, reportCount);if (financeDataList == null || financeDataList.isEmpty()) {log.warn("未获取到财务数据, secuCode: {}", secuCode);return Collections.emptyList();}log.info("成功获取财务数据, secuCode: {}, 数据条数: {}", secuCode, financeDataList.size());// 转为List<CompanyIncome> companyIncomeListList<CoreProfitCashRateCalculator.CompanyIncome> companyIncomeList =EastMoneyFinanceConverter.convertToCompanyIncomeList(financeDataList);if (companyIncomeList.isEmpty()) {log.warn("转换后的CompanyIncome列表为空, secuCode: {}", secuCode);return Collections.emptyList();}log.info("成功转换CompanyIncome对象, secuCode: {}, 转换后数据条数: {}", secuCode, companyIncomeList.size());// 调用calculateCoreProfitCashRate方法进行核心利润获现率计算List<CoreProfitCashRateCalculator.CompanyIncome> results =CoreProfitCashRateCalculator.calculateCoreProfitCashRate(companyIncomeList);log.info("成功计算核心利润获现率, secuCode: {}, 计算结果条数: {}", secuCode, results.size());// 返回List<CompanyIncome> resultsreturn results;} catch (Exception e) {log.error("计算核心利润获现率失败, secuCode: {}, reportCount: {}, error: {}",secuCode, reportCount, e.getMessage(), e);throw new Exception("计算核心利润获现率失败: " + e.getMessage());}}/*** 测试方法** @param args 命令行参数*/public static void main(String[] args) throws UnsupportedEncodingException {EastMoneyFinanceDubangServiceImpl service = new EastMoneyFinanceDubangServiceImpl();try {// 测试参数String secuCode = "002594.SZ";Integer pageNumber = 1;Integer pageSize = 1;System.out.println("开始测试获取财务数据, secuCode: " + secuCode + ", pageNumber: " + pageNumber + ", pageSize: " + pageSize);// 调用方法获取财务数据List<EastMoneyFinanceDataBo> financeDataList = service.getFinanceDataBySecuCode(secuCode, pageNumber, pageSize);System.out.println("财务数据详情");System.out.println(JsonUtils.toJSONString(financeDataList));if (financeDataList != null && !financeDataList.isEmpty()) {System.out.println("成功获取财务数据, 总条数: " + financeDataList.size());// 打印前几条数据作为示例for (int i = 0; i < Math.min(3, financeDataList.size()); i++) {EastMoneyFinanceDataBo data = financeDataList.get(i);System.out.println("第" + (i + 1) + "条数据 - 证券代码: " + data.getSecurityCode() +", 证券名称: " + data.getSecurityNameAbbr() +", 报告日期: " + data.getReportDate() +", 净利润: " + data.getNetProfit());}} else {log.warn("未获取到财务数据");}} catch (Exception e) {log.error("测试获取财务数据失败, error: {}", e.getMessage(), e);}}
}
5、资产负债表、利润表、经营现金流聚合数据
package com.sankuai.qinling.data.mmp.biz.bo;import lombok.Data;/*** 东方财富财务报表聚合数据Bo对象** @author system* @date 2024-12-19*/
@Data
public class EastMoneyFinancialReportBo {/*** 报告日期*/private String reportDate;/*** 证券代码*/private String secuCode;/*** 证券名称简称*/private String securityNameAbbr;/*** 证券简称*/private String securityCode;/*** 公告日期*/private String noticeDate;/*** 资产负债表数据*/private EastMoneyBalanceSheetDataBo balanceSheetData;/*** 利润表数据*/private EastMoneyIncomeStatementDataBo incomeStatementData;/*** 现金流量表数据*/private EastMoneyCashFlowDataBo cashFlowData;
}package com.sankuai.qinling.data.mmp.biz.service.impl;import com.sankuai.csc.common.tool.JsonUtils;
import com.sankuai.csc.common.tool.log.JsonLogUtil;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyBalanceSheetDataBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyCashFlowDataBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyFinancialReportBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyIncomeStatementDataBo;
import com.sankuai.qinling.data.mmp.biz.service.EastMoneyBalanceSheetService;
import com.sankuai.qinling.data.mmp.biz.service.EastMoneyCashFlowService;
import com.sankuai.qinling.data.mmp.biz.service.EastMoneyFinancialReportAggregateService;
import com.sankuai.qinling.data.mmp.biz.service.EastMoneyIncomeStatementService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;/*** 东方财富财务报表聚合服务实现类** @author system* @date 2024-12-19*/
@Service
public class EastMoneyFinancialReportAggregateServiceImpl implements EastMoneyFinancialReportAggregateService {@Overridepublic List<EastMoneyFinancialReportBo> getFinancialReportsBySecuCodeAndReportDates(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) throws Exception {System.out.println("开始聚合获取财务报表数据, secuCode: " + secuCode + ", pageNumber: " + pageNumber +", pageSize: " + pageSize + ", reportDateList: " + JsonLogUtil.createLogObject(reportDateList));// 参数校验if (StringUtils.isBlank(secuCode)) {throw new IllegalArgumentException("证券代码不能为空");}if (pageNumber == null || pageNumber < 1) {pageNumber = 1;}if (pageSize == null || pageSize < 1) {pageSize = 5;}if (reportDateList == null || reportDateList.isEmpty()) {throw new IllegalArgumentException("报告日期列表不能为空");}try {// 并行调用三个接口获取数据List<EastMoneyBalanceSheetDataBo> balanceSheetDataList = getBalanceSheetData(secuCode, pageNumber, pageSize, reportDateList);List<EastMoneyIncomeStatementDataBo> incomeStatementDataList = getIncomeStatementData(secuCode, pageNumber, pageSize, reportDateList);List<EastMoneyCashFlowDataBo> cashFlowDataList = getCashFlowData(secuCode, pageNumber, pageSize, reportDateList);System.out.println("成功获取各财务报表数据, secuCode: " + secuCode + ", 资产负债表条数: " + balanceSheetDataList.size() +", 利润表条数: " + incomeStatementDataList.size() + ", 现金流量表条数: " + cashFlowDataList.size());// 按报告日期分组聚合数据List<EastMoneyFinancialReportBo> aggregatedReports = aggregateFinancialReportsByReportDate(balanceSheetDataList, incomeStatementDataList, cashFlowDataList);System.out.println("成功聚合财务报表数据, secuCode: " + secuCode + ", 聚合后数据条数: " + aggregatedReports.size());return aggregatedReports;} catch (Exception e) {System.err.println("聚合获取财务报表数据发生异常, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("聚合获取财务报表数据失败: " + e.getMessage(), e);}}/*** 获取资产负债表数据** @param secuCode 证券代码* @param pageNumber 页码* @param pageSize 每页大小* @param reportDateList 报告日期列表* @return 资产负债表数据列表*/private List<EastMoneyBalanceSheetDataBo> getBalanceSheetData(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) {try {System.out.println("开始获取资产负债表数据, secuCode: " + secuCode);EastMoneyBalanceSheetServiceImpl financialReportAggregateService = new EastMoneyBalanceSheetServiceImpl();List<EastMoneyBalanceSheetDataBo> dataList = financialReportAggregateService.getBalanceSheetDataBySecuCodeAndReportDates(secuCode, pageNumber, pageSize, reportDateList);System.out.println("成功获取资产负债表数据, secuCode: " + secuCode + ", 数据条数: " + dataList.size());return dataList;} catch (Exception e) {System.err.println("获取资产负债表数据失败, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();return Collections.emptyList();}}/*** 获取利润表数据** @param secuCode 证券代码* @param pageNumber 页码* @param pageSize 每页大小* @param reportDateList 报告日期列表* @return 利润表数据列表*/private List<EastMoneyIncomeStatementDataBo> getIncomeStatementData(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) {try {System.out.println("开始获取利润表数据, secuCode: " + secuCode);EastMoneyIncomeStatementServiceImpl financialReportAggregateService = new EastMoneyIncomeStatementServiceImpl();List<EastMoneyIncomeStatementDataBo> dataList = financialReportAggregateService.getIncomeStatementDataBySecuCodeAndReportDates(secuCode, pageNumber, pageSize, reportDateList);System.out.println("成功获取利润表数据, secuCode: " + secuCode + ", 数据条数: " + dataList.size());return dataList;} catch (Exception e) {System.err.println("获取利润表数据失败, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();return Collections.emptyList();}}/*** 获取现金流量表数据** @param secuCode 证券代码* @param pageNumber 页码* @param pageSize 每页大小* @param reportDateList 报告日期列表* @return 现金流量表数据列表*/private List<EastMoneyCashFlowDataBo> getCashFlowData(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) {try {System.out.println("开始获取现金流量表数据, secuCode: " + secuCode);EastMoneyCashFlowServiceImpl eastMoneyCashFlowService = new EastMoneyCashFlowServiceImpl();List<EastMoneyCashFlowDataBo> dataList = eastMoneyCashFlowService.getCashFlowDataBySecuCodeAndReportDates(secuCode, pageNumber, pageSize, reportDateList);System.out.println("成功获取现金流量表数据, secuCode: " + secuCode + ", 数据条数: " + dataList.size());return dataList;} catch (Exception e) {System.err.println("获取现金流量表数据失败, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();return Collections.emptyList();}}/*** 按报告日期分组聚合财务报表数据** @param balanceSheetDataList 资产负债表数据列表* @param incomeStatementDataList 利润表数据列表* @param cashFlowDataList 现金流量表数据列表* @return 聚合后的财务报表数据列表*/private List<EastMoneyFinancialReportBo> aggregateFinancialReportsByReportDate(List<EastMoneyBalanceSheetDataBo> balanceSheetDataList,List<EastMoneyIncomeStatementDataBo> incomeStatementDataList,List<EastMoneyCashFlowDataBo> cashFlowDataList) {System.out.println("开始按报告日期分组聚合财务报表数据");// 使用LinkedHashMap保持插入顺序Map<String, EastMoneyFinancialReportBo> reportMap = new LinkedHashMap<>();// 处理资产负债表数据if (balanceSheetDataList != null && !balanceSheetDataList.isEmpty()) {for (EastMoneyBalanceSheetDataBo balanceSheetData : balanceSheetDataList) {if (balanceSheetData != null && StringUtils.isNotBlank(balanceSheetData.getReportDate())) {String reportDate = balanceSheetData.getReportDate();EastMoneyFinancialReportBo reportBo = reportMap.computeIfAbsent(reportDate, k -> createFinancialReportBo(balanceSheetData));reportBo.setBalanceSheetData(balanceSheetData);}}}// 处理利润表数据if (incomeStatementDataList != null && !incomeStatementDataList.isEmpty()) {for (EastMoneyIncomeStatementDataBo incomeStatementData : incomeStatementDataList) {if (incomeStatementData != null && StringUtils.isNotBlank(incomeStatementData.getReportDate())) {String reportDate = incomeStatementData.getReportDate();EastMoneyFinancialReportBo reportBo = reportMap.computeIfAbsent(reportDate, k -> createFinancialReportBo(incomeStatementData));reportBo.setIncomeStatementData(incomeStatementData);}}}// 处理现金流量表数据if (cashFlowDataList != null && !cashFlowDataList.isEmpty()) {for (EastMoneyCashFlowDataBo cashFlowData : cashFlowDataList) {if (cashFlowData != null && StringUtils.isNotBlank(cashFlowData.getReportDate())) {String reportDate = cashFlowData.getReportDate();EastMoneyFinancialReportBo reportBo = reportMap.computeIfAbsent(reportDate, k -> createFinancialReportBo(cashFlowData));reportBo.setCashFlowData(cashFlowData);}}}// 转换为列表并按报告日期倒序排序(最新的在前面)List<EastMoneyFinancialReportBo> result = reportMap.values().stream().sorted((a, b) -> {if (a.getReportDate() == null && b.getReportDate() == null) {return 0;}if (a.getReportDate() == null) {return 1;}if (b.getReportDate() == null) {return -1;}return b.getReportDate().compareTo(a.getReportDate());}).collect(Collectors.toList());System.out.println("完成按报告日期分组聚合财务报表数据, 聚合后数据条数: " + result.size());return result;}/*** 根据资产负债表数据创建财务报表Bo对象** @param balanceSheetData 资产负债表数据* @return 财务报表Bo对象*/private EastMoneyFinancialReportBo createFinancialReportBo(EastMoneyBalanceSheetDataBo balanceSheetData) {EastMoneyFinancialReportBo reportBo = new EastMoneyFinancialReportBo();reportBo.setReportDate(balanceSheetData.getReportDate());reportBo.setSecuCode(balanceSheetData.getSecuCode());reportBo.setSecurityNameAbbr(balanceSheetData.getSecurityNameAbbr());reportBo.setSecurityCode(balanceSheetData.getSecurityCode());reportBo.setNoticeDate(balanceSheetData.getNoticeDate());return reportBo;}/*** 根据利润表数据创建财务报表Bo对象** @param incomeStatementData 利润表数据* @return 财务报表Bo对象*/private EastMoneyFinancialReportBo createFinancialReportBo(EastMoneyIncomeStatementDataBo incomeStatementData) {EastMoneyFinancialReportBo reportBo = new EastMoneyFinancialReportBo();reportBo.setReportDate(incomeStatementData.getReportDate());reportBo.setSecuCode(incomeStatementData.getSecuCode());reportBo.setSecurityNameAbbr(incomeStatementData.getSecurityNameAbbr());reportBo.setSecurityCode(incomeStatementData.getSecurityCode());reportBo.setNoticeDate(incomeStatementData.getNoticeDate());return reportBo;}/*** 根据现金流量表数据创建财务报表Bo对象** @param cashFlowData 现金流量表数据* @return 财务报表Bo对象*/private EastMoneyFinancialReportBo createFinancialReportBo(EastMoneyCashFlowDataBo cashFlowData) {EastMoneyFinancialReportBo reportBo = new EastMoneyFinancialReportBo();reportBo.setReportDate(cashFlowData.getReportDate());reportBo.setSecuCode(cashFlowData.getSecuCode());reportBo.setSecurityNameAbbr(cashFlowData.getSecurityNameAbbr());reportBo.setSecurityCode(cashFlowData.getSecurityCode());reportBo.setNoticeDate(cashFlowData.getNoticeDate());return reportBo;}/*** 测试方法** @param args 命令行参数*/public static void main(String[] args) {System.out.println("=== 东方财富财务报表聚合服务测试 ===");System.out.println();// 创建服务实例(模拟)EastMoneyFinancialReportAggregateServiceImpl service = new EastMoneyFinancialReportAggregateServiceImpl();// 测试参数String secuCode = "002594.SZ";Integer pageNumber = 1;Integer pageSize = 5;List<String> reportDateList = Arrays.asList("2025-06-30", "2025-03-31","2024-12-31", "2024-09-30", "2024-06-30");try {// 调用服务方法System.out.println("开始调用财务报表聚合服务...");List<EastMoneyFinancialReportBo> reports = service.getFinancialReportsBySecuCodeAndReportDates(secuCode, pageNumber, pageSize, reportDateList);System.out.println();System.out.println("=== 测试结果 ===");System.out.println("聚合报表数量: ");System.out.println(JsonUtils.toJSONString(reports));for (int i = 0; i < reports.size(); i++) {EastMoneyFinancialReportBo report = reports.get(i);System.out.println();System.out.println("报表 " + (i + 1) + ":");System.out.println(" 报告日期: " + report.getReportDate());System.out.println(" 证券代码: " + report.getSecuCode());System.out.println(" 证券名称: " + report.getSecurityNameAbbr());System.out.println(" 公告日期: " + report.getNoticeDate());System.out.println(" 包含资产负债表: " + (report.getBalanceSheetData() != null ? "是" : "否"));System.out.println(" 包含利润表: " + (report.getIncomeStatementData() != null ? "是" : "否"));System.out.println(" 包含现金流量表: " + (report.getCashFlowData() != null ? "是" : "否"));}System.out.println();System.out.println("=== 测试完成 ===");} catch (Exception e) {System.err.println("测试过程中发生异常: " + e.getMessage());e.printStackTrace();}}
}
6、指标计算程序
package com.sankuai.qinling.data.mmp.biz.bo;import lombok.Data;import java.math.BigDecimal;/*** 财报指标计算结果Bo对象** @author system* @date 2024-12-19*/
@Data
public class FinancialIndicatorBo {/*** 报告日期*/private String reportDate;/*** 证券代码*/private String secuCode;/*** 证券名称简称*/private String securityNameAbbr;/*** 公告日期*/private String noticeDate;// ========== 核心利润相关指标 ==========/*** 营业收入*/private BigDecimal operateIncome;/*** 营业总成本*/private BigDecimal totalOperateCost;/*** 财务费用*/private BigDecimal financeExpense;/*** 营业利润*/private BigDecimal operateProfit;/*** 核心利润 = 营业收入-营业总成本-财务费用*/private BigDecimal coreProfit;/*** 核心利润率 = 核心利润/营业收入*100%*/private BigDecimal coreProfitRate;/*** 核心利润占营业利润比例 = 核心利润/营业利润*100%*/private BigDecimal coreProfitToOperateProfitRatio;// ========== 现金流相关指标 ==========/*** 销售商品和提供劳务收到的现金*/private BigDecimal salesServices;/*** 收现比 = 销售商品和提供劳务收到的现金/营业收入*100%*/private BigDecimal cashReceiptRatio;/*** 经营活动产生的现金流量净额*/private BigDecimal netcashOperate;/*** 归母净利润*/private BigDecimal parentNetprofit;/*** 净现比 = 经营活动产生的现金流量净额/归母净利润*100%*/private BigDecimal netCashRatio;/*** 其他收益*/private BigDecimal otherIncome;/*** 核心利润获现率 = 经营活动产生现金流量净额/(营业收入-营业总成本-财务费用+其他收益)*100%*/private BigDecimal coreProfitCashRatio;/*** 核心利润获现率计算说明*/private String coreProfitCashRatioNote;/*** 构建固定资产、无形资产和其他长期资产支付的现金*/private BigDecimal constructLongAsset;/*** 自由现金流 = 经营活动产生的现金流量金额-构建固定资产、无形资产和其他长期资产支付的现金*/private BigDecimal freeCashFlow;// ========== 负债相关指标 ==========/*** 总资产*/private BigDecimal totalAssets;/*** 短期借款*/private BigDecimal shortLoan;/*** 长期借款*/private BigDecimal longLoan;/*** 一年内到期的非流动负债*/private BigDecimal noncurrentLiab1year;/*** 应付债券*/private BigDecimal bondPayable;/*** 租赁负债*/private BigDecimal leaseLiab;/*** 有息负债总额 = 短期借款+长期借款+一年内到期的非流动负债+应付债券+租赁负债等*/private BigDecimal totalInterestBearingDebt;/*** 应付票据*/private BigDecimal notePayable;/*** 应付账款*/private BigDecimal accountsPayable;/*** 合同负债*/private BigDecimal contractLiab;/*** 应付职工薪酬*/private BigDecimal staffSalaryPayable;/*** 应交税费*/private BigDecimal taxPayable;/*** 其他应付款*/private BigDecimal totalOtherPayable;/*** 其他流动负债*/private BigDecimal otherCurrentLiab;/*** 经营负债 = 应付票据+应付账款+合同负债+应付职工薪酬+应交税费+其他应付款+其他流动负债等*/private BigDecimal totalOperatingDebt;/*** 资产有息负债率 = 有息负债/资产*100%*/private BigDecimal assetInterestBearingDebtRatio;/*** 经营负债率 = 经营负债/资产*100%*/private BigDecimal operatingDebtRatio;// ========== 健康度评价 ==========/*** 核心利润结构健康度评价*/private String coreProfitHealthAssessment;/*** 收现比质量评价*/private String cashReceiptQualityAssessment;/*** 净现比质量评价*/private String netCashQualityAssessment;
}package com.sankuai.qinling.data.mmp.biz.service.impl;import com.sankuai.csc.common.tool.log.JsonLogUtil;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyBalanceSheetDataBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyCashFlowDataBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyFinancialReportBo;
import com.sankuai.qinling.data.mmp.biz.bo.EastMoneyIncomeStatementDataBo;
import com.sankuai.qinling.data.mmp.biz.bo.FinancialIndicatorBo;
import com.sankuai.qinling.data.mmp.biz.service.FinancialIndicatorCalculationService;
import com.sankuai.qinling.data.mmp.biz.service.FinancialReportCacheService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;/*** 财报指标计算服务实现类** @author system* @date 2024-12-19*/
@Slf4j
@Service
public class FinancialIndicatorCalculationServiceImpl implements FinancialIndicatorCalculationService {@Overridepublic List<FinancialIndicatorBo> calculateFinancialIndicators(String secuCode, Integer pageNumber, Integer pageSize, List<String> reportDateList) throws Exception {System.out.println("开始计算财报指标, secuCode: " + secuCode + ", pageNumber: " + pageNumber +", pageSize: " + pageSize + ", reportDateList: " + JsonLogUtil.createLogObject(reportDateList));// 参数校验if (StringUtils.isBlank(secuCode)) {throw new IllegalArgumentException("证券代码不能为空");}if (reportDateList == null || reportDateList.isEmpty()) {throw new IllegalArgumentException("报告日期列表不能为空");}try {// 1. 通过缓存服务获取财务报表数据(优先从缓存获取,缓存未命中时调用聚合服务)FinancialReportCacheServiceImpl financialReportCacheService = new FinancialReportCacheServiceImpl();List<EastMoneyFinancialReportBo> financialReports = financialReportCacheService.getFinancialReportsWithCache(secuCode, pageNumber, pageSize, reportDateList);System.out.println(("成功获取财务报表数据, secuCode:" + secuCode + ", 数据条数: " + financialReports.size()));// 2. 逐个报告期间进行计算List<FinancialIndicatorBo> indicatorList = new ArrayList<>();for (EastMoneyFinancialReportBo financialReport : financialReports) {if (financialReport != null) {FinancialIndicatorBo indicator = calculateSinglePeriodIndicators(financialReport);if (indicator != null) {indicatorList.add(indicator);}}}System.out.println("成功计算财报指标, secuCode: " + secuCode + ", 计算结果条数: " + indicatorList.size());return indicatorList;} catch (Exception e) {System.err.println("计算财报指标发生异常, secuCode: " + secuCode + ", error: " + e.getMessage());e.printStackTrace();throw new RuntimeException("计算财报指标失败: " + e.getMessage(), e);}}@Overridepublic FinancialIndicatorBo calculateSinglePeriodIndicators(EastMoneyFinancialReportBo financialReport) {if (financialReport == null) {System.out.println("财务报表数据为空,跳过计算");return null;}System.out.println("开始计算单个报告期财报指标, reportDate: " + financialReport.getReportDate() +", secuCode: " + financialReport.getSecuCode());try {FinancialIndicatorBo indicator = new FinancialIndicatorBo();// 设置基本信息indicator.setReportDate(financialReport.getReportDate());indicator.setSecuCode(financialReport.getSecuCode());indicator.setSecurityNameAbbr(financialReport.getSecurityNameAbbr());indicator.setNoticeDate(financialReport.getNoticeDate());// 获取各报表数据EastMoneyIncomeStatementDataBo incomeData = financialReport.getIncomeStatementData();EastMoneyCashFlowDataBo cashFlowData = financialReport.getCashFlowData();EastMoneyBalanceSheetDataBo balanceSheetData = financialReport.getBalanceSheetData();// 计算核心利润相关指标calculateCoreProfitIndicators(indicator, incomeData);// 计算现金流相关指标calculateCashFlowIndicators(indicator, incomeData, cashFlowData);// 计算负债相关指标calculateDebtIndicators(indicator, balanceSheetData);// 计算健康度评价calculateHealthAssessments(indicator);System.out.println("成功计算单个报告期财报指标, reportDate: " + financialReport.getReportDate() +", 核心利润: " + indicator.getCoreProfit() + ", 核心利润率: " + indicator.getCoreProfitRate() + "%");return indicator;} catch (Exception e) {System.err.println("计算单个报告期财报指标发生异常, reportDate: " + financialReport.getReportDate() +", error: " + e.getMessage());e.printStackTrace();return null;}}/*** 计算核心利润相关指标** @param indicator 指标对象* @param incomeData 利润表数据*/private void calculateCoreProfitIndicators(FinancialIndicatorBo indicator, EastMoneyIncomeStatementDataBo incomeData) {if (incomeData == null) {System.out.println("利润表数据为空,跳过核心利润指标计算");return;}// 获取基础数据BigDecimal operateIncome = getValueOrZero(incomeData.getOperateIncome());BigDecimal totalOperateCost = getValueOrZero(incomeData.getTotalOperateCost());BigDecimal financeExpense = getValueOrZero(incomeData.getFinanceExpense());BigDecimal operateProfit = getValueOrZero(incomeData.getOperateProfit());// 设置基础数据indicator.setOperateIncome(operateIncome);indicator.setTotalOperateCost(totalOperateCost);indicator.setFinanceExpense(financeExpense);indicator.setOperateProfit(operateProfit);// 1. 核心利润 = 营业收入-营业总成本-财务费用// 注意:根据题目要求,营业利润 = 营业收入-营业总成本-财务费用,这里核心利润实际上就是营业利润的简化计算BigDecimal coreProfit = operateIncome.subtract(totalOperateCost).subtract(financeExpense);indicator.setCoreProfit(coreProfit);// 2. 核心利润率 = 核心利润/营业收入*100%if (operateIncome.compareTo(BigDecimal.ZERO) != 0) {BigDecimal coreProfitRate = coreProfit.divide(operateIncome, 6, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));indicator.setCoreProfitRate(coreProfitRate);}// 核心利润占营业利润比例 = 核心利润/营业利润*100%if (operateProfit.compareTo(BigDecimal.ZERO) != 0) {BigDecimal coreProfitToOperateProfitRatio = coreProfit.divide(operateProfit, 6, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));indicator.setCoreProfitToOperateProfitRatio(coreProfitToOperateProfitRatio);}System.out.println("核心利润指标计算完成: 营业收入=" + operateIncome + ", 营业总成本=" + totalOperateCost +", 财务费用=" + financeExpense + ", 核心利润=" + coreProfit + ", 核心利润率=" + indicator.getCoreProfitRate() + "%");}/*** 计算现金流相关指标** @param indicator 指标对象* @param incomeData 利润表数据* @param cashFlowData 现金流量表数据*/private void calculateCashFlowIndicators(FinancialIndicatorBo indicator, EastMoneyIncomeStatementDataBo incomeData,EastMoneyCashFlowDataBo cashFlowData) {if (cashFlowData == null) {System.out.println("现金流量表数据为空,跳过现金流指标计算");return;}// 获取基础数据BigDecimal salesServices = getValueOrZero(cashFlowData.getSalesServices());BigDecimal netcashOperate = getValueOrZero(cashFlowData.getNetcashOperate());BigDecimal constructLongAsset = getValueOrZero(cashFlowData.getConstructLongAsset());BigDecimal operateIncome = getValueOrZero(indicator.getOperateIncome());// 设置基础数据indicator.setSalesServices(salesServices);indicator.setNetcashOperate(netcashOperate);indicator.setConstructLongAsset(constructLongAsset);// 3. 收现比 = 销售商品和提供劳务收到的现金/营业收入*100%if (operateIncome.compareTo(BigDecimal.ZERO) != 0) {BigDecimal cashReceiptRatio = salesServices.divide(operateIncome, 6, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));indicator.setCashReceiptRatio(cashReceiptRatio);}// 4. 净现比 = 经营活动产生的现金流量净额/归母净利润*100%if (incomeData != null) {BigDecimal parentNetprofit = getValueOrZero(incomeData.getParentNetprofit());indicator.setParentNetprofit(parentNetprofit);if (parentNetprofit.compareTo(BigDecimal.ZERO) != 0) {BigDecimal netCashRatio = netcashOperate.divide(parentNetprofit, 6, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));indicator.setNetCashRatio(netCashRatio);}// 5. 核心利润获现率 = 经营活动产生现金流量净额/(营业收入-营业总成本-财务费用+其他收益)*100%BigDecimal otherIncome = getValueOrZero(incomeData.getOtherIncome());indicator.setOtherIncome(otherIncome);// 计算分母:营业收入-营业总成本-财务费用+其他收益BigDecimal totalOperateCost = getValueOrZero(indicator.getTotalOperateCost());BigDecimal financeExpense = getValueOrZero(indicator.getFinanceExpense());BigDecimal denominator = operateIncome.subtract(totalOperateCost).subtract(financeExpense).add(otherIncome);// 检查分子分母是否同时为负if (netcashOperate.compareTo(BigDecimal.ZERO) < 0 && denominator.compareTo(BigDecimal.ZERO) < 0) {indicator.setCoreProfitCashRatioNote("分子分母同时为负,无法进行有效计算");System.out.println("核心利润获现率计算跳过: 经营现金流净额=" + netcashOperate + ", 分母=" + denominator + " (同时为负)");} else if (denominator.compareTo(BigDecimal.ZERO) != 0) {BigDecimal coreProfitCashRatio = netcashOperate.divide(denominator, 6, RoundingMode.HALF_UP);indicator.setCoreProfitCashRatio(coreProfitCashRatio);indicator.setCoreProfitCashRatioNote("正常计算");} else {indicator.setCoreProfitCashRatioNote("分母为零,无法计算");}}// 6. 自由现金流 = 经营活动产生的现金流量金额-构建固定资产、无形资产和其他长期资产支付的现金BigDecimal freeCashFlow = netcashOperate.subtract(constructLongAsset);indicator.setFreeCashFlow(freeCashFlow);System.out.println("现金流指标计算完成: 销售收现=" + salesServices + ", 经营现金流净额=" + netcashOperate +", 收现比=" + indicator.getCashReceiptRatio() + "%, 净现比=" + indicator.getNetCashRatio() + "%");}/*** 计算负债相关指标** @param indicator 指标对象* @param balanceSheetData 资产负债表数据*/private void calculateDebtIndicators(FinancialIndicatorBo indicator, EastMoneyBalanceSheetDataBo balanceSheetData) {if (balanceSheetData == null) {System.out.println("资产负债表数据为空,跳过负债指标计算");return;}// 获取基础数据BigDecimal totalAssets = getValueOrZero(balanceSheetData.getTotalAssets());BigDecimal shortLoan = getValueOrZero(balanceSheetData.getShortLoan());BigDecimal longLoan = getValueOrZero(balanceSheetData.getLongLoan());BigDecimal noncurrentLiab1year = getValueOrZero(balanceSheetData.getNoncurrentLiab1year());BigDecimal leaseLiab = getValueOrZero(balanceSheetData.getLeaseLiab());// 设置基础数据indicator.setTotalAssets(totalAssets);indicator.setShortLoan(shortLoan);indicator.setLongLoan(longLoan);indicator.setNoncurrentLiab1year(noncurrentLiab1year);indicator.setLeaseLiab(leaseLiab);// 7. 有息负债总额 = 短期借款+长期借款+一年内到期的非流动负债+租赁负债等// 注意:这里简化处理,实际应该还包括应付债券、交易性金融负债等BigDecimal totalInterestBearingDebt = shortLoan.add(longLoan).add(noncurrentLiab1year).add(leaseLiab);indicator.setTotalInterestBearingDebt(totalInterestBearingDebt);// 8. 经营负债 = 应付票据+应付账款+合同负债+应付职工薪酬+应交税费+其他应付款+其他流动负债等BigDecimal notePayable = getValueOrZero(balanceSheetData.getNotePayable());BigDecimal accountsPayable = getValueOrZero(balanceSheetData.getAccountsPayable());BigDecimal contractLiab = getValueOrZero(balanceSheetData.getContractLiab());BigDecimal staffSalaryPayable = getValueOrZero(balanceSheetData.getStaffSalaryPayable());BigDecimal taxPayable = getValueOrZero(balanceSheetData.getTaxPayable());BigDecimal totalOtherPayable = getValueOrZero(balanceSheetData.getTotalOtherPayable());BigDecimal otherCurrentLiab = getValueOrZero(balanceSheetData.getOtherCurrentLiab());// 设置基础数据indicator.setNotePayable(notePayable);indicator.setAccountsPayable(accountsPayable);indicator.setContractLiab(contractLiab);indicator.setStaffSalaryPayable(staffSalaryPayable);indicator.setTaxPayable(taxPayable);indicator.setTotalOtherPayable(totalOtherPayable);indicator.setOtherCurrentLiab(otherCurrentLiab);BigDecimal totalOperatingDebt = notePayable.add(accountsPayable).add(contractLiab).add(staffSalaryPayable).add(taxPayable).add(totalOtherPayable).add(otherCurrentLiab);indicator.setTotalOperatingDebt(totalOperatingDebt);// 9. 资产有息负债率 = 有息负债/资产*100%if (totalAssets.compareTo(BigDecimal.ZERO) != 0) {BigDecimal assetInterestBearingDebtRatio = totalInterestBearingDebt.divide(totalAssets, 6, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));indicator.setAssetInterestBearingDebtRatio(assetInterestBearingDebtRatio);}// 10. 经营负债率 = 经营负债/资产*100%if (totalAssets.compareTo(BigDecimal.ZERO) != 0) {BigDecimal operatingDebtRatio = totalOperatingDebt.divide(totalAssets, 6, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));indicator.setOperatingDebtRatio(operatingDebtRatio);}System.out.println("负债指标计算完成: 总资产=" + totalAssets + ", 有息负债=" + totalInterestBearingDebt +", 经营负债=" + totalOperatingDebt + ", 资产有息负债率=" + indicator.getAssetInterestBearingDebtRatio() + "%");}/*** 计算健康度评价** @param indicator 指标对象*/private void calculateHealthAssessments(FinancialIndicatorBo indicator) {// 核心利润结构健康度评价BigDecimal coreProfitToOperateProfitRatio = indicator.getCoreProfitToOperateProfitRatio();if (coreProfitToOperateProfitRatio != null) {if (coreProfitToOperateProfitRatio.compareTo(new BigDecimal("80")) >= 0) {indicator.setCoreProfitHealthAssessment("结构健康,企业可持续发展能力强");} else {indicator.setCoreProfitHealthAssessment("结构一般,需关注非核心利润占比");}}// 收现比质量评价BigDecimal cashReceiptRatio = indicator.getCashReceiptRatio();if (cashReceiptRatio != null) {if (cashReceiptRatio.compareTo(new BigDecimal("100")) > 0) {indicator.setCashReceiptQualityAssessment("盈利质量较好,不仅当期收入全部收现,还收回以前期间应收账款");} else if (cashReceiptRatio.compareTo(new BigDecimal("100")) == 0) {indicator.setCashReceiptQualityAssessment("盈利质量良好,当期收入全部收现");} else {indicator.setCashReceiptQualityAssessment("盈利质量不高,当期有部分收入没有收现");}}// 净现比质量评价BigDecimal netCashRatio = indicator.getNetCashRatio();if (netCashRatio != null) {if (netCashRatio.compareTo(new BigDecimal("80")) >= 0) {indicator.setNetCashQualityAssessment("盈利质量高,净利润含金量充足");} else if (netCashRatio.compareTo(BigDecimal.ZERO) > 0) {indicator.setNetCashQualityAssessment("盈利质量一般,净利润含金量有待提升");} else {indicator.setNetCashQualityAssessment("盈利质量较差,净利润含金量不足");}}System.out.println("健康度评价完成: 核心利润结构=" + indicator.getCoreProfitHealthAssessment() +", 收现比质量=" + indicator.getCashReceiptQualityAssessment() +", 净现比质量=" + indicator.getNetCashQualityAssessment());}/*** 获取BigDecimal值,如果为null则返回0** @param value 原始值* @return 处理后的值*/private BigDecimal getValueOrZero(BigDecimal value) {return value != null ? value : BigDecimal.ZERO;}/*** 测试方法** @param args 命令行参数*/public static void main(String[] args) {System.out.println("=== 财报指标计算服务测试 ===");System.out.println();// 创建服务实例(模拟)FinancialIndicatorCalculationServiceImpl service = new FinancialIndicatorCalculationServiceImpl();// 测试参数String secuCode = "000423.SZ";Integer pageNumber = 1;Integer pageSize = 10;List<String> reportDateList = Arrays.asList("2025-06-30", "2025-03-31", "2024-12-31", "2024-09-30", "2024-06-30");try {// 调用服务方法System.out.println("开始调用财报指标计算服务...");List<FinancialIndicatorBo> indicators = service.calculateFinancialIndicators(secuCode, pageNumber, pageSize, reportDateList);System.out.println();System.out.println("=== 测试结果 ===");System.out.println("计算指标数量: " + indicators.size());for (int i = 0; i < indicators.size(); i++) {FinancialIndicatorBo indicator = indicators.get(i);System.out.println();System.out.println("指标 " + (i + 1) + ":");System.out.println(" 报告日期: " + indicator.getReportDate());System.out.println(" 证券代码: " + indicator.getSecuCode());System.out.println(" 证券名称: " + indicator.getSecurityNameAbbr());System.out.println(" 营业收入: " + indicator.getOperateIncome());System.out.println(" 核心利润: " + indicator.getCoreProfit());System.out.println(" 核心利润率: " + indicator.getCoreProfitRate() + "%");System.out.println(" 核心利润获现率: " + indicator.getCoreProfitCashRatio());System.out.println(" 核心利润获现率计算情况: " + indicator.getCoreProfitCashRatioNote());System.out.println(" 收现比: " + indicator.getCashReceiptRatio() + "%");System.out.println(" 净现比: " + indicator.getNetCashRatio() + "%");System.out.println(" 自由现金流: " + indicator.getFreeCashFlow());System.out.println(" 资产有息负债率: " + indicator.getAssetInterestBearingDebtRatio() + "%");System.out.println(" 经营负债率: " + indicator.getOperatingDebtRatio() + "%");System.out.println(" 核心利润健康度: " + indicator.getCoreProfitHealthAssessment());System.out.println(" 收现比质量: " + indicator.getCashReceiptQualityAssessment());System.out.println(" 净现比质量: " + indicator.getNetCashQualityAssessment());}System.out.println();System.out.println("=== 测试完成 ===");} catch (Exception e) {System.err.println("测试过程中发生异常: " + e.getMessage());e.printStackTrace();}}
}