从山证v2.3.0拷贝

This commit is contained in:
吴方海
2024-05-09 14:06:26 +08:00
parent 566ff33259
commit f9d8a256a6
4471 changed files with 1203456 additions and 9 deletions
@@ -0,0 +1,52 @@
using Newtonsoft.Json;
using YLErp.BLL.EodSettlement;
namespace YLErp.Modules.EodModule.QueryModule
{
[TestClass]
public class TestEodTradePositionApiService
{
[TestMethod]
public void TestInfoAll()
{
var req = new EodSettleInfoRequest
{
ValueDate = new DateTime(2022, 1, 4)
};
var context = new EodSettleInfoQueryContext(OptUserInfo.SystemUser);
var positionResult = new EodTradePositionApiService(context).GetEodPositions(req);
var closeResult = new EodCloseInfoQueryService(context).GetEodCloseInfoList(req.ValueDate);
var clientIds = context.GetClientIds();
var balanceResult = ClientBalanceUtility.GetClientBanlances(
clientIdList: clientIds,
startDate: DateTime.MinValue,
endDate: req.ValueDate,
IsGetOuterMarginGap: false,
IsClientBalanceGap: false,
ParentFlag: false,
clientDataSource: context);
var result = new
{
positionResult.OptionPositions,
positionResult.SwapPositions,
positionResult.ForwardPositions,
CloseInfos = closeResult,
AccountInfos = balanceResult
};
//var result = new { d = 1.2222222255555555555 };
var serializeSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
serializeSettings.Converters ??= new List<JsonConverter>();
serializeSettings.Converters.Add(new DoubleJsonWriteConverter(2, 8));
var json = JsonConvert.SerializeObject(result, serializeSettings);
Assert.IsNotNull(json);
}
}
}