Commit 329471cf authored by 吴春's avatar 吴春

提交代码

parent a1522a16
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Mall.AOP.CustomerAttribute;
using Mall.Common;
using Mall.Common.API;
using Mall.Common.Plugin;
......@@ -236,23 +237,24 @@ namespace Mall.Module.Finance
#region 财务记录
public bool SetFinanceRecord(RB_Finance_Record_Extend model, List<Model.Extend.Product.RB_Goods_OrderDetail_Extend> list )
[TransactionCallHandler]
public virtual bool SetFinanceRecord(RB_Finance_Record_Extend model, List<Model.Extend.Product.RB_Goods_OrderDetail_Extend> list )
{
bool flag = false;
var trans = financeRecordRepository.DbTransaction;
try
{
int recordId = 0;
if (model.ID == 0)
{
recordId = financeRecordRepository.Insert(model, trans);
recordId = financeRecordRepository.Insert(model);
flag = recordId > 0;
if (model.RecordDetailList != null && model.RecordDetailList.Any())
{
model.RecordDetailList.ForEach(x => x.RecordId = recordId);
model.RecordDetailList.ForEach(x => x.FinanceId = model.FinanceId);
financeRecordDetailRepository.InsertBatch(model.RecordDetailList, trans);
financeRecordDetailRepository.InsertBatch(model.RecordDetailList);
}
foreach (var item in model.RecordDetailList)
......@@ -293,15 +295,13 @@ namespace Mall.Module.Finance
OperatorEnum=OperatorEnum.Equal
}
};
goods_OrderDetailRepository.Update(keyValues, whereHelpers, trans);
goods_OrderDetailRepository.Update(keyValues, whereHelpers);
}
}
financeRecordRepository.DBSession.Commit();
}
catch (Exception ex)
{
LogHelper.Write(ex, "SetFinanceRecord");
financeRecordRepository.DBSession.Rollback("SetFinanceRecord");
return false;
}
return flag;
......
......@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Mall.AOP;
using Mall.Common;
using Mall.Common.API;
using Mall.Common.Plugin;
......@@ -36,7 +37,7 @@ namespace Mall.WebApi.Controllers.User
/// <summary>
/// 财务
/// </summary>
private readonly FinanceModule financeModule = new FinanceModule();
private readonly FinanceModule financeModule = AOPHelper.CreateAOPObject<FinanceModule>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment