|
|
@ -31,52 +31,51 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
_dbcontext = dbcontext; |
|
|
|
|
|
|
|
} |
|
|
|
[UnitOfWork(false)] |
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|
|
|
{ |
|
|
|
|
|
|
|
var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; |
|
|
|
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 == "库位"); |
|
|
|
if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian") |
|
|
|
[UnitOfWork(false)] |
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|
|
|
{ |
|
|
|
var jisdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
|
|
|
|
if (jisdetail != null && jisdetail.Count() > 0) |
|
|
|
|
|
|
|
var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; |
|
|
|
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 == "库位"); |
|
|
|
if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian") |
|
|
|
{ |
|
|
|
foreach (var itm in jisdetail) |
|
|
|
var jisdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
|
|
|
|
if (jisdetail != null && jisdetail.Count() > 0) |
|
|
|
{ |
|
|
|
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; |
|
|
|
} |
|
|
|
else |
|
|
|
foreach (var itm in jisdetail) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; |
|
|
|
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; |
|
|
|
} |
|
|
|
} |
|
|
|
Sync(jisdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); |
|
|
|
} |
|
|
|
Sync(jisdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); |
|
|
|
} |
|
|
|
var mdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件
|
|
|
|
if (mdetail != null && mdetail.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in jisdetail) |
|
|
|
var mdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件
|
|
|
|
if (mdetail != null && mdetail.Count() > 0) |
|
|
|
{ |
|
|
|
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
foreach (var itm in jisdetail) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; |
|
|
|
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; |
|
|
|
} |
|
|
|
} |
|
|
|
Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); |
|
|
|
} |
|
|
|
Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); |
|
|
|
} |
|
|
|
|
|
|
|
var detailist1 = _dbcontext.Set<PUB_PD_DETAIL>().Where(p => list.Contains(p.BillNum)).ToList(); |
|
|
|
|
|
|
|
if (detailist1.Count > 0) |
|
|
@ -151,9 +150,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
} |
|
|
|
Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return id.ToString(); |
|
|
|
} |
|
|
|
//public List<T> GetPagedData<T>(List<T> dataList, int pageNumber, int pageSize)
|
|
|
|