|
|
@ -25,6 +25,7 @@ using Win.Sfs.SettleAccount.Constant; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Managers; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
|
|
|
using Win.Sfs.SettleAccount.Entities.Prices; |
|
|
|
using Win.Sfs.SettleAccount.Entities.TaskJobs; |
|
|
|
using Win.Sfs.SettleAccount.ExportReports; |
|
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
@ -73,6 +74,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
IExporter _excel = new ExcelExporter(); |
|
|
|
var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dtoDetails = ObjectMapper.Map<List<BBAC_NOT_SA_DETAIL>, List<BBAC_NOT_SA_DETAIL_EXP_DTO>>(entities); |
|
|
|
|
|
|
|
var inner = from d in entities |
|
|
@ -148,7 +162,45 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
input.Filters.Remove(first); |
|
|
|
} |
|
|
|
|
|
|
|
//_detailRepository.DbContext.Set<BBAC_NOT_SA_DETAIL>().Where(p=>p.)
|
|
|
|
var _dbcontext = await _detailRepository.GetDbContextAsync().ConfigureAwait(false); |
|
|
|
var pricelist = _dbcontext.Set<PriceList>().Where(p => p.ClientCode == "1040" && p.IsCancel == false).ToList(); |
|
|
|
var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); |
|
|
|
|
|
|
|
var query = from d in entities |
|
|
|
join p in pricelist |
|
|
|
on d.LU equals p.LU |
|
|
|
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == "1040" |
|
|
|
select new |
|
|
|
{ |
|
|
|
a = |
|
|
|
new BBAC_CAN_SA_DETAIL() |
|
|
|
{ |
|
|
|
ContractDocID = d.ContractDocID, |
|
|
|
IsMaiDan = d.IsMaiDan, |
|
|
|
Version = d.Version, |
|
|
|
KeyCode = d.KeyCode, |
|
|
|
Site = "1040", |
|
|
|
BusinessType = d.BusinessType, |
|
|
|
ErpLoc = d.ErpLoc, |
|
|
|
CreationTime = d.CreationTime, |
|
|
|
GroupNum = d.GroupNum, |
|
|
|
InvGroupNum = d.InvGroupNum, |
|
|
|
LU = d.LU, |
|
|
|
PN = d.PN, |
|
|
|
SettleBillNum = d.SettleBillNum, |
|
|
|
Price = p.Price, |
|
|
|
SettleDate = d.SettleDate, |
|
|
|
RealPartCode = d.RealPartCode, |
|
|
|
PartCode = d.PartCode, |
|
|
|
Qty = d.Qty |
|
|
|
}, |
|
|
|
b = d |
|
|
|
}; |
|
|
|
var bbac_can_list = query.Select(p => p.a).ToList(); |
|
|
|
var bbac_not_list = query.Select(p => p.b).ToList(); |
|
|
|
if (bbac_can_list.Count > 0) |
|
|
|
{ |
|
|
|
|
|
|
|
var flag = await _bbacNotMng.IsCompleted().ConfigureAwait(false); |
|
|
|
if (flag == false) |
|
|
|
{ |
|
|
@ -165,6 +217,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
} |
|
|
|
return new JsonResult(new { Code = 200, Message = "正在生成" }); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return new JsonResult(new { Code = 400, Message = "筛选的数据都没有价格!" }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|