#EQD-6605 国联民生-确认书编号规则调整(不基于甲方乙方判定)
feat: 国联民生收益互换按簿记分类生成交易编号 簿记账户新增“簿记分类”字段,支持代客、融券,新增账户默认代客,历史账户统一初始化为代客 簿记账户分类设为必填,列表、编辑及详情页面同步展示 修改已被交易引用的簿记账户分类时增加二次确认,并提示关联交易数量 国联民生收益互换交易编号不再根据甲乙方判断,改为根据簿记账户分类生成 代客使用数字序号,融券使用字母序号,分别从已有同客户同日编号的最大序号继续递增 保留手工交易编号优先逻辑,标准格式的手工编号参与后续最大序号计算 生成候选编号后检查完整交易编号是否已存在,存在则继续递增 新增簿记分类编号格式、最大序号计算及数字字母序列隔离专项单测
This commit is contained in:
@@ -35,6 +35,26 @@ namespace YLErp.Modules.BasicDataModule
|
||||
return DataCacheManager.GetAssetUnitDataSource().AsQueryable().FirstOrDefault(n => n.id == id);
|
||||
}
|
||||
|
||||
public int GetBookCategoryReferencedTradeCount(AssetUnit req)
|
||||
{
|
||||
if (req == null || req.id == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var currentBookCategory = DbContext.assetunit
|
||||
.Where(x => x.id == req.id)
|
||||
.Select(x => x.BookCategory)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (currentBookCategory == req.BookCategory)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DbContext.trade.Count(x => x.AssetId == req.id);
|
||||
}
|
||||
|
||||
public AssetUnit SaveAssetUnit(AssetUnit req)
|
||||
{
|
||||
if (req is null)
|
||||
@@ -47,6 +67,12 @@ namespace YLErp.Modules.BasicDataModule
|
||||
throw new ServiceException("簿记账户名称 必须填写");
|
||||
}
|
||||
|
||||
if (req.BookCategory != AssetUnit.BookCategoryAgency &&
|
||||
req.BookCategory != AssetUnit.BookCategorySecuritiesLending)
|
||||
{
|
||||
throw new ServiceException("簿记分类 必须填写");
|
||||
}
|
||||
|
||||
AssetUnit dbModel;
|
||||
|
||||
if (DbContext.assetunit.Any(x => x.id != req.id && x.Name == req.Name))
|
||||
@@ -137,6 +163,7 @@ namespace YLErp.Modules.BasicDataModule
|
||||
id = a.id,
|
||||
GroupId = a.GroupId,
|
||||
BaseCurrency = a.BaseCurrency,
|
||||
BookCategory = a.BookCategory,
|
||||
InitialMoney = a.InitialMoney,
|
||||
Name = a.Name,
|
||||
OptDate = a.OptDate,
|
||||
@@ -320,6 +347,7 @@ namespace YLErp.Modules.BasicDataModule
|
||||
id = a.id,
|
||||
GroupId = a.GroupId,
|
||||
BaseCurrency = a.BaseCurrency,
|
||||
BookCategory = a.BookCategory,
|
||||
InitialMoney = a.InitialMoney,
|
||||
Name = a.Name,
|
||||
OptDate = a.OptDate,
|
||||
|
||||
Reference in New Issue
Block a user