|
|
@ -38,8 +38,6 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
|
|
|
|
public PendingDeductionService( |
|
|
|
SettleAccountDbContext dbcontext, |
|
|
|
|
|
|
|
|
|
|
|
IEmailSender emailSender |
|
|
|
) |
|
|
|
{ |
|
|
@ -55,19 +53,11 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; |
|
|
|
var isout = property.Where(p => p.Name == "IsOut").FirstOrDefault().Value; |
|
|
|
var email = string.Empty; |
|
|
|
|
|
|
|
// property.Where(p => p.Name == "CurrentUserEmail").FirstOrDefault().Value;
|
|
|
|
var list = billList.Split(","); |
|
|
|
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") |
|
|
|
{ |
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
return id.ToString(); |
|
|
|
} |
|
|
|
//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()); |
|
|
|
} |
|
|
|
var _first = p_ls.FirstOrDefault(); |
|
|
|
|
|
|
|
bool issucess = true; |
|
|
|
|
|
|
|
using (var transaction = _dbcontext.Database.BeginTransaction()) |
|
|
|
{ |
|
|
|
try |
|
|
@ -296,16 +288,21 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
_dbcontext.BulkUpdate(hbpoList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// _emailSender.SendAsync(e)
|
|
|
|
|
|
|
|
// 提交事务
|
|
|
|
transaction.Commit(); |
|
|
|
} |
|
|
|
catch (Exception) |
|
|
|
{ |
|
|
|
issucess = false; |
|
|
|
// 回滚事务
|
|
|
|
transaction.Rollback(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (issucess = false) |
|
|
|
{ |
|
|
|
|
|
|
|
var billList = p_ls.Select(p => p.BillNum).Distinct().ToList(); |
|
|
|
var pdList = _dbcontext.Set<PUB_PD>().Where(p => billList.Contains(p.BillNum)).ToList(); |
|
|
|
if (pdList.Count > 0) |
|
|
@ -359,10 +356,6 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
} |
|
|
|
_dbcontext.BulkUpdate(hbpoList); |
|
|
|
} |
|
|
|
// 回滚事务
|
|
|
|
transaction.Rollback(); |
|
|
|
throw; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|