diff --git a/Rating/Credit/CreditImpl.py b/Rating/Credit/CreditImpl.py index 0e48726..cff7c17 100644 --- a/Rating/Credit/CreditImpl.py +++ b/Rating/Credit/CreditImpl.py @@ -178,7 +178,7 @@ class CreditRating(CreditInputData, CreditUtils): def balance(): """资产负债表""" balance_sheet = BalanceSheet() - balance_sheet.report_date = None + balance_sheet.report_date = '2022-01-01' balance_sheet.accounts_receivable = None balance_sheet.stock = None balance_sheet.total_current_assets = None @@ -194,7 +194,7 @@ class CreditRating(CreditInputData, CreditUtils): def income(): """利润表""" income_sheet = IncomeSheet() - income_sheet.report_date = None + income_sheet.report_date = '2022-01-01' income_sheet.operating_income = None income_sheet.operating_cost = None income_sheet.total_profit = None @@ -204,7 +204,7 @@ class CreditRating(CreditInputData, CreditUtils): def appendix(): """补充数据表""" appendix_sheet = AppendixDataSheet() - appendix_sheet.report_date = None + appendix_sheet.report_date = '2022-01-01' appendix_sheet.rd_expenses = None appendix_sheet.interest_disbursement = None appendix_sheet.interest_expense = None diff --git a/Rating/Credit/CreditObj.py b/Rating/Credit/CreditObj.py index 60a7d9d..0dc2426 100644 --- a/Rating/Credit/CreditObj.py +++ b/Rating/Credit/CreditObj.py @@ -1,5 +1,5 @@ from Utils.ObjUtil import SpecObject -from Utils.ValidateUtil import ValidateAttr +from Utils.ValidateUtil import ValidateAttr, Validate class RatingRecord(SpecObject): @@ -12,7 +12,7 @@ class RatingRecord(SpecObject): status = ValidateAttr(field='status', type=str, in_list=["进行", "完成"]) result = ValidateAttr(field='result', type=str, in_list=["AAA", "AA+", "AA", "AA-", "A+", "A", "A-", "BBB+", "BBB", "BBB-", "BB+", "BB", - "BB-", "B+", "B", "B-", "CCC", "CC"], default=None) + "BB-", "B+", "B", "B-", "CCC", "CC", None], default=None) report_fid = ValidateAttr(field='report_fid', type=str, default=None) certificate_fid = ValidateAttr(field='certificate_fid', type=str, default=None) begin_time = ValidateAttr(field='begin_time', type=str) @@ -39,7 +39,7 @@ class RatingRecord(SpecObject): class BalanceSheet(SpecObject): """资产负债表""" - report_date = ValidateAttr(field='report_date', default=None, length=10, type=str) + report_date = ValidateAttr(field='report_date', default=None, func=Validate.date_format, type=str) accounts_receivable = ValidateAttr(field='accounts_receivable', default=None, type=float) stock = ValidateAttr(field='stock', type=float, default=None) total_current_assets = ValidateAttr(field='total_current_assets', default=None, type=float) @@ -68,7 +68,7 @@ class BalanceSheet(SpecObject): class IncomeSheet(SpecObject): """利润表""" - report_date = ValidateAttr(field='report_date', default=None, length=10, type=str) + report_date = ValidateAttr(field='report_date', default=None, func=Validate.date_format, type=str) operating_income = ValidateAttr(field='operating_income', default=None, type=float) operating_cost = ValidateAttr(field='operating_cost', default=None, type=float) total_profit = ValidateAttr(field='total_profit', default=None, type=float) @@ -85,7 +85,7 @@ class IncomeSheet(SpecObject): class AppendixDataSheet(SpecObject): """补充数据表""" - report_date = ValidateAttr(field='report_date', default=None, length=10, type=str) + report_date = ValidateAttr(field='report_date', default=None, func=Validate.date_format, type=str) rd_expenses = ValidateAttr(field='rd_expenses', default=None, type=float) interest_disbursement = ValidateAttr(field='interest_disbursement', default=None, type=float) interest_expense = ValidateAttr(field='interest_expense', default=None, type=float)