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

提交代码

parent a1522a16
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Mall.AOP.CustomerAttribute;
using Mall.Common; using Mall.Common;
using Mall.Common.API; using Mall.Common.API;
using Mall.Common.Plugin; using Mall.Common.Plugin;
...@@ -236,23 +237,24 @@ namespace Mall.Module.Finance ...@@ -236,23 +237,24 @@ namespace Mall.Module.Finance
#region 财务记录 #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; bool flag = false;
var trans = financeRecordRepository.DbTransaction;
try try
{ {
int recordId = 0; int recordId = 0;
if (model.ID == 0) if (model.ID == 0)
{ {
recordId = financeRecordRepository.Insert(model, trans); recordId = financeRecordRepository.Insert(model);
flag = recordId > 0; flag = recordId > 0;
if (model.RecordDetailList != null && model.RecordDetailList.Any()) if (model.RecordDetailList != null && model.RecordDetailList.Any())
{ {
model.RecordDetailList.ForEach(x => x.RecordId = recordId); model.RecordDetailList.ForEach(x => x.RecordId = recordId);
model.RecordDetailList.ForEach(x => x.FinanceId = model.FinanceId); model.RecordDetailList.ForEach(x => x.FinanceId = model.FinanceId);
financeRecordDetailRepository.InsertBatch(model.RecordDetailList, trans); financeRecordDetailRepository.InsertBatch(model.RecordDetailList);
} }
foreach (var item in model.RecordDetailList) foreach (var item in model.RecordDetailList)
...@@ -293,15 +295,13 @@ namespace Mall.Module.Finance ...@@ -293,15 +295,13 @@ namespace Mall.Module.Finance
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
} }
}; };
goods_OrderDetailRepository.Update(keyValues, whereHelpers, trans); goods_OrderDetailRepository.Update(keyValues, whereHelpers);
} }
} }
financeRecordRepository.DBSession.Commit();
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.Write(ex, "SetFinanceRecord"); LogHelper.Write(ex, "SetFinanceRecord");
financeRecordRepository.DBSession.Rollback("SetFinanceRecord");
return false; return false;
} }
return flag; return flag;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Mall.AOP;
using Mall.Common; using Mall.Common;
using Mall.Common.API; using Mall.Common.API;
using Mall.Common.Plugin; using Mall.Common.Plugin;
...@@ -36,7 +37,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -36,7 +37,7 @@ namespace Mall.WebApi.Controllers.User
/// <summary> /// <summary>
/// 财务 /// 财务
/// </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