Browse Source

[CI SKIP]

master
学 赵 1 year ago
parent
commit
1479c6c34d
  1. 138
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs

138
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs

@ -101,79 +101,79 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) });
} }
List<CustomCondition> customConditionList = new List<CustomCondition>(); //List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "BillNum", Value = invbillNum }); //customConditionList.Add(new CustomCondition() { Name = "BillNum", Value = invbillNum });
customConditionList.Add(new CustomCondition() { Name = "BussinessType", Value = main.BusinessType.ToString() }); //customConditionList.Add(new CustomCondition() { Name = "BussinessType", Value = main.BusinessType.ToString() });
//main.State = SettleBillState.发票生成中;
await _bbacMng.SetWaitingState(invbillNum); //await _bbacMng.SetWaitingState(invbillNum);
var _taskid = await _service.ExportEnqueueAsync("生成发票任务", ExportExtentsion.Excel, string.Empty, string.Empty, CurrentUser, typeof(GenerateJisInvoiceService), customConditionList, (rs) => //var _taskid = await _service.ExportEnqueueAsync("生成发票任务", ExportExtentsion.Excel, string.Empty, string.Empty, CurrentUser, typeof(GenerateJisInvoiceService), customConditionList, (rs) =>
{ //{
}).ConfigureAwait(false); //}).ConfigureAwait(false);
//if (await _bbacMng.SetForwardState(main, SettleBillState.已开票).ConfigureAwait(false)) if (await _bbacMng.SetForwardState(main, SettleBillState.).ConfigureAwait(false))
//{ {
// var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
// var notQuery = await _notRepository.Where(p => p.SettleBillNum == main.SettleBillNum).ToListAsync().ConfigureAwait(false); var notQuery = await _notRepository.Where(p => p.SettleBillNum == main.SettleBillNum).ToListAsync().ConfigureAwait(false);
// var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys); var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
// var q = from d in dto1s var q = from d in dto1s
// join p in priceList on d.LU equals p.LU join p in priceList on d.LU equals p.LU
// where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == main.Site where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == main.Site
// select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
// { {
// SettleBillNum = d.SettleBillNum, SettleBillNum = d.SettleBillNum,
// Site = d.Site, Site = d.Site,
// Version = d.Version, Version = d.Version,
// Price = p.Price, Price = p.Price,
// BillNum = d.BillNum, BillNum = d.BillNum,
// SettleDate = d.SettleDate, SettleDate = d.SettleDate,
// InvGroupNum = d.InvGroupNum, InvGroupNum = d.InvGroupNum,
// LU = d.LU, LU = d.LU,
// MaterialDesc = d.MaterialDesc, MaterialDesc = d.MaterialDesc,
// PN = d.PN, PN = d.PN,
// Qty = d.Qty, Qty = d.Qty,
// GroupNum = d.GroupNum, GroupNum = d.GroupNum,
// Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
// ContractDocID = d.ContractDocID, ContractDocID = d.ContractDocID,
// BeginDate = p.BeginTime, BeginDate = p.BeginTime,
// EndDate = p.EndTime, EndDate = p.EndTime,
// PartCode = d.PartCode PartCode = d.PartCode
// }; };
// var dtos = q.ToList(); var dtos = q.ToList();
// if (dtos != null && dtos.Count > 0) if (dtos != null && dtos.Count > 0)
// { {
// if (invbillNum.Substring(0, 1) == "C")//一次开票 if (invbillNum.Substring(0, 1) == "C")//一次开票
// { {
// var notlist = notQuery.Select(p => new TEMP_NOT_SA_DETAIL var notlist = notQuery.Select(p => new TEMP_NOT_SA_DETAIL
// { {
// KeyCode = p.KeyCode, KeyCode = p.KeyCode,
// Version = p.Version, Version = p.Version,
// SettleBillNum = p.SettleBillNum, SettleBillNum = p.SettleBillNum,
// LU = p.LU, LU = p.LU,
// PN = p.PN, PN = p.PN,
// Site = p.Site, Site = p.Site,
// Qty = p.Qty, Qty = p.Qty,
// Price = p.Price, Price = p.Price,
// BusinessType = p.BusinessType, BusinessType = p.BusinessType,
// IsReturn = "", IsReturn = "",
// InvGroupNum = p.InvGroupNum, InvGroupNum = p.InvGroupNum,
// SettleDate = p.SettleDate, SettleDate = p.SettleDate,
// GroupNum = p.GroupNum, GroupNum = p.GroupNum,
// ContractDocID = string.Empty, ContractDocID = string.Empty,
// PartCode = p.PartCode PartCode = p.PartCode
// }).ToList();//不能结算 }).ToList();//不能结算
// await FirstInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false); await FirstInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false);
// } }
// else//二次开票 else//二次开票
// { {
// await SecInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false); await SecInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false);
// } }
// } }
//} }
} }
else else
{ {

Loading…
Cancel
Save