|
@ -38,8 +38,6 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
|
|
|
|
|
public PendingDeductionService( |
|
|
public PendingDeductionService( |
|
|
SettleAccountDbContext dbcontext, |
|
|
SettleAccountDbContext dbcontext, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IEmailSender emailSender |
|
|
IEmailSender emailSender |
|
|
) |
|
|
) |
|
|
{ |
|
|
{ |
|
@ -55,19 +53,11 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; |
|
|
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; |
|
|
var isout = property.Where(p => p.Name == "IsOut").FirstOrDefault().Value; |
|
|
var isout = property.Where(p => p.Name == "IsOut").FirstOrDefault().Value; |
|
|
var email = string.Empty; |
|
|
var email = string.Empty; |
|
|
|
|
|
|
|
|
// property.Where(p => p.Name == "CurrentUserEmail").FirstOrDefault().Value;
|
|
|
// property.Where(p => p.Name == "CurrentUserEmail").FirstOrDefault().Value;
|
|
|
var list = billList.Split(","); |
|
|
var list = billList.Split(","); |
|
|
var projectList = _dbcontext.Set<CodeSetting>().Where(p => p.Project == "库位"); |
|
|
var projectList = _dbcontext.Set<CodeSetting>().Where(p => p.Project == "库位"); |
|
|
|
|
|
|
|
|
//JisBBAC
|
|
|
|
|
|
//JisHBPO
|
|
|
|
|
|
//ZhiGongJianBBAC
|
|
|
|
|
|
//ZhiGongJianHBPO
|
|
|
|
|
|
//MaiDanJianBBAC
|
|
|
|
|
|
//MaiDanJianHBPO
|
|
|
|
|
|
//BeiJian
|
|
|
|
|
|
//YinDuJian
|
|
|
|
|
|
if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian") |
|
|
if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian") |
|
|
{ |
|
|
{ |
|
|
var jisdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
|
|
|
var jisdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
|
|
@ -178,7 +168,6 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
} |
|
|
} |
|
|
Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); |
|
|
Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return id.ToString(); |
|
|
return id.ToString(); |
|
|
} |
|
|
} |
|
|
//public List<T> GetPagedData<T>(List<T> dataList, int pageNumber, int pageSize)
|
|
|
//public List<T> GetPagedData<T>(List<T> dataList, int pageNumber, int pageSize)
|
|
@ -227,6 +216,9 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
itm.SetId(GuidGenerator.Create()); |
|
|
itm.SetId(GuidGenerator.Create()); |
|
|
} |
|
|
} |
|
|
var _first = p_ls.FirstOrDefault(); |
|
|
var _first = p_ls.FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
|
|
bool issucess = true; |
|
|
|
|
|
|
|
|
using (var transaction = _dbcontext.Database.BeginTransaction()) |
|
|
using (var transaction = _dbcontext.Database.BeginTransaction()) |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
@ -296,16 +288,21 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
_dbcontext.BulkUpdate(hbpoList); |
|
|
_dbcontext.BulkUpdate(hbpoList); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// _emailSender.SendAsync(e)
|
|
|
// _emailSender.SendAsync(e)
|
|
|
|
|
|
|
|
|
// 提交事务
|
|
|
// 提交事务
|
|
|
transaction.Commit(); |
|
|
transaction.Commit(); |
|
|
} |
|
|
} |
|
|
catch (Exception) |
|
|
catch (Exception) |
|
|
{ |
|
|
{ |
|
|
|
|
|
issucess = false; |
|
|
|
|
|
// 回滚事务
|
|
|
|
|
|
transaction.Rollback(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (issucess = false) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
var billList = p_ls.Select(p => p.BillNum).Distinct().ToList(); |
|
|
var billList = p_ls.Select(p => p.BillNum).Distinct().ToList(); |
|
|
var pdList = _dbcontext.Set<PUB_PD>().Where(p => billList.Contains(p.BillNum)).ToList(); |
|
|
var pdList = _dbcontext.Set<PUB_PD>().Where(p => billList.Contains(p.BillNum)).ToList(); |
|
|
if (pdList.Count > 0) |
|
|
if (pdList.Count > 0) |
|
@ -359,10 +356,6 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
} |
|
|
} |
|
|
_dbcontext.BulkUpdate(hbpoList); |
|
|
_dbcontext.BulkUpdate(hbpoList); |
|
|
} |
|
|
} |
|
|
// 回滚事务
|
|
|
|
|
|
transaction.Rollback(); |
|
|
|
|
|
throw; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|