mahao 1 year ago
parent
commit
6e8e53dd6c
  1. 42
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  2. 28
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  3. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  4. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs
  5. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  6. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  7. 141
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  8. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  9. 120
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  10. 140
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  11. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  12. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs
  13. 788
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  14. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs
  15. 31
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs
  16. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs
  17. 30
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  18. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs
  19. 31
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

42
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs

@ -8,6 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.Shared.Constant;
using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
@ -85,42 +86,45 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ExporterHeader(DisplayName = "未税金额")]
public decimal Amt { get; set; }
/// <summary>
///税额
/// </summary>
[ExporterHeader(DisplayName = "税额")]
public decimal Tax { get; set; }
/// <summary>
///税后金额
/// </summary>
[ExporterHeader(DisplayName = "税后金额")]
public decimal TaxAmt { get; set; }
/// <summary>
///发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///开票Excel文件
/// </summary>
[ExporterHeader(DisplayName = "开票Excel文件")]
public string FileName { get; set; }
/// <summary>
///业务类别
/// </summary>
[ExporterHeader(DisplayName = "业务类别")]
public EnumBusinessType BusinessType { get; set; }
}
public class INVOICE_GRP_IMP_DTO
{
/// <summary>
///实际纸质发票号
/// </summary>
[ImporterHeader(Name = "实际纸质发票号")]
[ImporterHeader(Name = "实际纸质发票号", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")]
[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RealnvBillNum { get; set; }
/// <summary>
///系统生成发票号
///实际纸质发票号
/// </summary>
[ImporterHeader(Name = "系统生成发票号")]
[ImporterHeader(Name = "系统生成发票号", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")]
[MaxLength(200, ErrorMessage = "{0}最多输入{1}个字符")]
public string InvbillNum { get; set; }
/// <summary>
///税额
/// </summary>
[ImporterHeader(Name = "税额", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")]
public decimal Tax { get; set; }
}

28
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs

@ -14,9 +14,11 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.LinqAsync;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
@ -45,9 +47,9 @@ namespace Win.Sfs.SettleAccount.Bases
protected readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _sRepository;
protected readonly INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> _mRepository;
protected readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
protected readonly HBPO_CAN_SA_MNG _pubMng;
protected readonly HBPO_CAN_SA_MNG _hbpoMng;
protected readonly BBAC_CAN_SA_MNG _bbacMng;
protected readonly PUB_CAN_SA_MNG _hbpoMng;
protected readonly PUB_CAN_SA_MNG _pubMng;
protected readonly INV_MNG _invMng;
@ -60,9 +62,9 @@ namespace Win.Sfs.SettleAccount.Bases
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
IExcelImportAppService excelImportService,
HBPO_CAN_SA_MNG pubMng,
HBPO_CAN_SA_MNG hbpoMng,
BBAC_CAN_SA_MNG bbacMng,
PUB_CAN_SA_MNG hbpoMng,
PUB_CAN_SA_MNG pubMng,
INV_MNG invMng
//INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
@ -103,7 +105,12 @@ namespace Win.Sfs.SettleAccount.Bases
{
}
/// <summary>
/// 审核通过
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> GenerateInvoice(INVOICE_GRP_REQ_DTO input)
{
@ -117,7 +124,8 @@ namespace Win.Sfs.SettleAccount.Bases
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> ReissueInvoice(INVOICE_GRP_REQ_DTO input)
[HttpPost]
public virtual async Task<string> ReissueInvoice(string input)
{
// await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核);
@ -206,15 +214,12 @@ namespace Win.Sfs.SettleAccount.Bases
public virtual async Task<string> RejectAsync(INVOICE_GRP_REQ_DTO input)
{
await _invMng.Reject(input.InvGroupNum);
return ApplicationConsts.SuccessStr;
}
[HttpPost]
public virtual async Task<string> ReceivedAsync(INVOICE_GRP_REQ_DTO input)
{
@ -299,8 +304,8 @@ namespace Win.Sfs.SettleAccount.Bases
}
return null;
}
/// <summary>
/// hbpo、jit、备件等
/// </summary>
@ -345,7 +350,6 @@ namespace Win.Sfs.SettleAccount.Bases
select d;
var left = from d in dto1s
join p in inner on new { d.LU, d.PN } equals new { p.LU, p.PN }
into temp
from tm in temp.DefaultIfEmpty()//校验错误项
where tm == null

13
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs

@ -40,12 +40,6 @@ using static Win.Sfs.SettleAccount.SettleAccountPermissions;
namespace Win.Sfs.SettleAccount.Bases
{
public abstract class CAN_SA_SERVICE<TEntity, TEntityDto, TEntityDetail, TEntityDetailDto, TRequestMainInput, TRequestDetailInput, TEntityDetailExportDto> : BASE_SERVICE
where TEntity : SA_CAN_BASE_MAIN
where TEntityDetail:SA_CAN_BASE
@ -144,8 +138,10 @@ namespace Win.Sfs.SettleAccount.Bases
//[Route("generateinvoice")]
public virtual async Task<string> GenerateInvoice(TRequestMainInput input)
{
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 查询主表
/// </summary>
@ -205,14 +201,11 @@ namespace Win.Sfs.SettleAccount.Bases
select d;
var left = from d in dto1s
join p in inner on new { d.LU, d.PN } equals new { p.LU, p.PN }
into temp
from tm in temp.DefaultIfEmpty()//校验错误项
where tm == null
select d;
List<ERR_EXP_DTO> errorList = new List<ERR_EXP_DTO> ();
string name = string.Empty;
string keyname = string.Empty;
switch (p_businessType)
@ -245,9 +238,7 @@ namespace Win.Sfs.SettleAccount.Bases
name = "备件";
keyname = "交付识别号";
break;
}
foreach (var error in left)
{
errorList.Add(new ERR_EXP_DTO() { ItemCode = error.LU, CustomCode = $"{name}", Message = $"LU:{error.LU}{keyname}:{error.PN},下线日期:{error.SettleDate}没有对应区间销售价格表!" });

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs

@ -60,12 +60,10 @@ namespace Win.Sfs.SettleAccount.Bases
//[Route("detailquery")]
public virtual async Task<PagedResultDto<TEntityDetailDto>> DetailQueryAsync(TRequestDetailInput input)
{
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailDto>>(entitys);
return new PagedResultDto<TEntityDetailDto>(totalCount, dtos);
}
/// <summary>
/// 导出
@ -78,10 +76,8 @@ namespace Win.Sfs.SettleAccount.Bases
{
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailExportDto>>(entities);
var classDisplayName = typeof(TEntityDetailExportDto).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(TEntityDetailExportDto).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null;

24
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -1,7 +1,8 @@
using DocumentFormat.OpenXml.Bibliography;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using SettleAccount.Domain.BQ;
using System;
@ -23,7 +24,6 @@ using Win.Sfs.SettleAccount.Entities.BQ.Temp;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
@ -33,7 +33,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
[Route("api/settleaccount/[controller]/[action]")]
public class BBAC_BA_SERVICE : BA_SERVICE
{
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
public BBAC_BA_SERVICE(IExcelImportAppService excelImportService,
@ -55,8 +54,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
_adjRepository = adjRepository;
_priceRepository = priceRepository;
}
/// <summary>
@ -64,15 +61,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> ReissueInvoice(string p_invbillnum)
public override async Task<string> ReissueInvoice(string p_invbillnum)
{
var mappingList= await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
if (mappingList != null && mappingList.Count() > 0)
{
var version=int.Parse(DateTime.Now.ToString("yyyymm"));
var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组
var inv= await GetInvoiceGroupByInvBillNum(p_invbillnum);
var settle =await _bbacMng.GetMainAsync(inv.InvGroupNum);
if(settle==null)
{
throw new BusinessException("8989", $"选择发票:{p_invbillnum}对应的可结算单不在请检查!");
}
version=settle.Version;
if (inv != null)
{
if (inv.InvoiceState == InvoiceBillState.)
@ -109,13 +114,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
//var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList();
//var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var priceList = _priceRepository.ToList();//价格单
var errorList =await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType);
if (errorList.Count() > 0)
{
return await ExportErrorReportAsync(errorList);
}
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
@ -141,7 +147,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)
{
if (p_invbillnum.Substring(0, 1) == "INV")//一次开票重开
if (p_invbillnum.Substring(0, 3) == "INV")//一次开票重开
{
await ReissueFirstInvoice(dtos, version, p_invbillnum);
}

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

@ -93,7 +93,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
//var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList();
var notQuery = _notRepository.Where(p => groupNumList.Contains(p.InvGroupNum)).ToList();//不能结算
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var priceList = _priceRepository.ToList();//价格单
var errorList = await CheckInvoiceGenerationRules(entitys, priceList,main.BusinessType);//校验生成规则
@ -102,6 +102,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
return await ExportErrorReportAsync(errorList);
}
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime

141
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs

@ -1,17 +1,24 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using System;
using System.Collections.Generic;
using System.Linq;
using System.LinqAsync;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers;
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.Temp;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
@ -20,8 +27,138 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
[Route("api/settleaccount/[controller]/[action]")]
public class HBPO_BA_SERVICE : BA_SERVICE
{
public HBPO_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, BBAC_CAN_SA_MNG pubMng, HBPO_CAN_SA_MNG bbacMng, PUB_CAN_SA_MNG hbpoMng, INV_MNG invMng) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, pubMng, bbacMng, hbpoMng, invMng)
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
public HBPO_BA_SERVICE(
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
BBAC_CAN_SA_MNG pubMng,
HBPO_CAN_SA_MNG bbacMng,
PUB_CAN_SA_MNG hbpoMng,
INV_MNG invMng,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository,
INormalEfCoreRepository<PriceList, Guid> priceRepository
) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, pubMng, bbacMng, hbpoMng, invMng)
{
_adjRepository = adjRepository;
_priceRepository = priceRepository;
}
/// <summary>
/// 发票重开
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<string> ReissueInvoice(string p_invbillnum)
{
var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
if (mappingList != null && mappingList.Count() > 0)
{
var version = int.Parse(DateTime.Now.ToString("yyyymm"));
var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组
var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum);
var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum);
if (settle == null)
{
throw new BusinessException("8989", $"选择发票:{p_invbillnum}对应的可结算单不在请检查!");
}
version = settle.Version;
if (inv != null)
{
if (inv.InvoiceState == InvoiceBillState.)
{
throw new BusinessException("8989", $"选择发票:{p_invbillnum}状态为报废状态不能重开!");
}
var hbpolist = await _hbpoMng.GetContainsAsync(inv.InvbillNum, gList);//结算分组对应结算零件
var adjlist = await _adjRepository.Where(p => p.InvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
if (adjlist != null && adjlist.Count() > 0)
{
foreach (var itm in adjlist)
{
hbpolist.Add(new HBPO_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: itm.Price,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum
));
}
}
var entitys = hbpolist;//合并库存调整单和就发票可结算明细数据
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
//var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList();
//var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
var priceList = _priceRepository.ToList();//价格单
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType);
if (errorList.Count() > 0)
{
return await ExportErrorReportAsync(errorList);
}
// var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in entitys
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL
{
SettleBillNum = d.SettleBillNum,
Site = d.Site,
Version = d.Version,
Price = p.Price,
BillNum = d.BillNum,
SettleDate = d.SettleDate,
InvGroupNum = d.InvGroupNum,
LU = d.LU,
// MaterialDesc = d.MaterialDesc,
PN = d.PN,
Qty = d.Qty,
GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n",
BeginDate = p.BeginTime,
EndDate = p.EndTime
};
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)
{
if (p_invbillnum.Substring(0, 3) == "INV")//一次开票重开
{
await ReissueFirstInvoice(dtos, version, p_invbillnum);
}
else//二次开票
{
await ReissueSecInvoice(dtos, version, p_invbillnum);
}
}
}
else
{
throw new BusinessException("8989", $"不存发票号为:{p_invbillnum}发票");
}
}
else
{
throw new BusinessException("8989", $"不存发票号:{p_invbillnum}对应的结算分组号");
}
return ApplicationConsts.SuccessStr;
}
}
}

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs

@ -86,13 +86,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var entitys = await _hbpoMng.GetDetalListAsync(input.BillNum);
var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
var notQuery = _notRepository.Where(p => groupNumList.Contains(p.InvGroupNum)).ToList();
var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var priceList = _priceRepository.ToList();//价格单
var errorList=await CheckInvoiceGenerationRules(entitys, priceList,main.BusinessType);//校验生成规则
if (errorList.Count() > 0)
{
return await ExportErrorReportAsync(errorList);
}
var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime

120
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -1,8 +1,13 @@
using DocumentFormat.OpenXml.Bibliography;
using DocumentFormat.OpenXml.Drawing.Diagrams;
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NPOI.HPSF;
using SettleAccount.Domain.BQ;
using Shouldly;
using System;
@ -14,17 +19,21 @@ using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class INVOICE_SERVICE:ApplicationService
public class INVOICE_SERVICE : BASE_SERVICE
{
private readonly INormalEfCoreRepository<INVOICE_GRP, Guid> _repository;
private readonly INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> _wRepository;
@ -34,22 +43,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private readonly BBAC_CAN_SA_MNG _bbacMng;
private readonly HBPO_CAN_SA_MNG _hbpoMng;
private readonly INV_MNG _invMng;
//private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected INVOICE_SERVICE(
public INVOICE_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
IExcelImportAppService excelImportService,
PUB_CAN_SA_MNG pubMng,
BBAC_CAN_SA_MNG bbacMng,
HBPO_CAN_SA_MNG hbpoMng,
INV_MNG invMng
)
) : base(excelImportService, snowflakeIdGenerator, commonManager)
{
_excelImportService = excelImportService;
_repository = repository;
_wRepository = wRepository;
_mRepository = mRepository;
@ -59,14 +66,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_hbpoMng = hbpoMng;
_invMng = invMng;
}
[HttpPost]
public virtual async Task<string> ApprovalPassed(INVOICE_GRP_REQ_DTO input)
{
var inv=_repository.Where(p=>p.InvGroupNum == input.InvGroupNum).FirstOrDefault();
var inv = _repository.Where(p => p.InvGroupNum == input.InvGroupNum).FirstOrDefault();
await _invMng.SetForwardState(inv, SettleBillState.);
return ApplicationConsts.SuccessStr;
}
@ -131,11 +136,53 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
);
return _fileName;
}
/// <summary>
/// 导出发票组明细
/// </summary>
/// <param name="input">查询条件</param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> ExportDetailAsync(INVOICE_GRP_REQ_DTO input)
{
IExporter _csv = new CsvExporter();
ExcelExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities);
var invdetail= await DetailQueryAsync(input);
var m = invdetail.INVOICE_MAP_GROUP;
var not=invdetail.INVOICE_NOT_SETTLE;
var detail =invdetail.INVOICE_WAIT_DETAIL;
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
var result = _excel.Append(dtoDetails,"发票表").SeparateBySheet()
.Append(m, "发票和结算分组关系")
.SeparateBySheet()
.Append(not, "对应未结结算分组")
.SeparateBySheet()
.Append(detail, "发票明细")
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result.Result
}
);
return _fileName;
}
[HttpPost]
public virtual async Task<string> RejectAsync(INVOICE_GRP_REQ_DTO input)
{
bool state = await _invMng.Reject(input.InvGroupNum);
if (state==true)
if (state == true)
{
switch (input.BusinessType)
{
@ -143,6 +190,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
await _pubMng.SetNewState(input.InvGroupNum);
break;
case EnumBusinessType.ZhiGongJianBBAC:
await _pubMng.SetNewState(input.InvGroupNum);
break;
case EnumBusinessType.ZhiGongJianHBPO:
await _pubMng.SetNewState(input.InvGroupNum);
break;
@ -159,21 +208,50 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
return string.Empty;
}
/// <summary>
/// 同步QAD
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> Sync_QAD(INVOICE_GRP_REQ_DTO input)
{
return string.Empty;
}
/// <summary>
/// 导入发票
/// </summary>
/// <param name="files"></param>
/// <param name="branchId"></param>
/// <returns></returns>
[HttpPost]
[DisableRequestSizeLimit]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<INVOICE_GRP_IMP_DTO>(files, _excelImportService);
var ls = ObjectMapper.Map<List<INVOICE_GRP_IMP_DTO>, List<INVOICE_GRP>>(result);
var namelist = ls.Select(p => p.InvbillNum).Distinct();
var invlist = _repository.Where(p => namelist.Contains(p.InvbillNum)).ToList();
var invdetail = _wRepository.Where(p => namelist.Contains(p.InvbillNum)).ToList();
var first = ls.FirstOrDefault();
foreach (var inv in invlist)
{
var newinv = ls.Where(p => p.InvbillNum == inv.InvbillNum).FirstOrDefault();
inv.Tax = newinv.Tax;
inv.TaxAmt = Math.Round(inv.Amt * newinv.Tax, 2);
inv.RealnvBillNum = newinv.RealnvBillNum;
}
foreach (var detail in invdetail)
{
detail.Extend1 = Math.Round(detail.Amt * first.Tax, 2).ToString();
}
await _repository.DbContext.BulkUpdateAsync(invlist);
await _repository.DbContext.BulkUpdateAsync(invdetail);
return ApplicationConsts.SuccessStr;
}
}
}

140
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -1,17 +1,23 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using System;
using System.Collections.Generic;
using System.Linq;
using System.LinqAsync;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Temp;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
@ -20,8 +26,138 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
[Route("api/settleaccount/[controller]/[action]")]
public class PUB_BA_SERVICE : BA_SERVICE
{
public PUB_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, BBAC_CAN_SA_MNG pubMng, HBPO_CAN_SA_MNG bbacMng, PUB_CAN_SA_MNG hbpoMng, INV_MNG invMng) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, pubMng, bbacMng, hbpoMng, invMng)
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
public PUB_BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
BBAC_CAN_SA_MNG pubMng,
HBPO_CAN_SA_MNG bbacMng,
PUB_CAN_SA_MNG hbpoMng,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository,
INormalEfCoreRepository<PriceList, Guid> priceRepository,
INV_MNG invMng) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, pubMng, bbacMng, hbpoMng, invMng)
{
_adjRepository = adjRepository;
_priceRepository = priceRepository;
}
// <summary>
/// 发票重开
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<string> ReissueInvoice(string p_invbillnum)
{
var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
if (mappingList != null && mappingList.Count() > 0)
{
var version = int.Parse(DateTime.Now.ToString("yyyymm"));
var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组
var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum);
var settle = await _pubMng.GetMainAsync(inv.InvGroupNum);
if (settle == null)
{
throw new BusinessException("8989", $"选择发票:{p_invbillnum}对应的可结算单不在请检查!");
}
version = settle.Version;
if (inv != null)
{
if (inv.InvoiceState == InvoiceBillState.)
{
throw new BusinessException("8989", $"选择发票:{p_invbillnum}状态为报废状态不能重开!");
}
var hbpolist = await _pubMng.GetContainsAsync(inv.InvbillNum, gList);//结算分组对应结算零件
var adjlist = await _adjRepository.Where(p => p.InvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
if (adjlist != null && adjlist.Count() > 0)
{
foreach (var itm in adjlist)
{
hbpolist.Add(new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: itm.Price,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum
));
}
}
var entitys = hbpolist;//合并库存调整单和就发票可结算明细数据
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
//var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList();
//var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
var priceList = _priceRepository.ToList();//价格单
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType);
if (errorList.Count() > 0)
{
return await ExportErrorReportAsync(errorList);
}
// var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in entitys
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL
{
SettleBillNum = d.SettleBillNum,
Site = d.Site,
Version = d.Version,
Price = p.Price,
BillNum = d.BillNum,
SettleDate = d.SettleDate,
InvGroupNum = d.InvGroupNum,
LU = d.LU,
// MaterialDesc = d.MaterialDesc,
PN = d.PN,
Qty = d.Qty,
GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n",
BeginDate = p.BeginTime,
EndDate = p.EndTime
};
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)
{
if (p_invbillnum.Substring(0, 3) == "INV")//一次开票重开
{
await ReissueFirstInvoice(dtos, version, p_invbillnum);
}
else//二次开票
{
await ReissueSecInvoice(dtos, version, p_invbillnum);
}
}
}
else
{
throw new BusinessException("8989", $"不存发票号为:{p_invbillnum}发票");
}
}
else
{
throw new BusinessException("8989", $"不存发票号:{p_invbillnum}对应的结算分组号");
}
return ApplicationConsts.SuccessStr;
}
}
}

17
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs

@ -71,31 +71,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
var entitys = await _pubMng.GetDetalListAsync(input.BillNum);
var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
var dto1s = ObjectMapper.Map<List<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys);
List<PriceList> priceList=new List<PriceList>();
List<PriceList> priceList = new List<PriceList>();
if (main.BusinessType == EnumBusinessType.BeiJian)
{
var priceListbj = _pricebjRepository.ToList();//价格单
foreach (var itm in priceListbj)
{
priceList.Add(new PriceList() {LU=itm.LU,BeginTime=itm.BeginDate,EndTime=itm.EndDate });
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price });
}
}
else
{
priceList = _priceRepository.ToList();//价格单
}
var errorList = await CheckInvoiceGenerationRules(entitys, priceList,main.BusinessType);//校验生成规则
if (errorList.Count() > 0)
{
return await ExportErrorReportAsync(errorList);
}
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则
if (errorList.Count() > 0)
{
return await ExportErrorReportAsync(errorList);
}
var dto1s = ObjectMapper.Map<List<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
@ -114,7 +109,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Qty = d.Qty,
GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID="no",
ContractDocID = "no",
BeginDate = p.BeginTime,
EndDate = p.EndTime
};
@ -124,7 +119,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
if (input.BillNum.Substring(0, 1) == "C")//一次开票
{
await FirstInvoice(dtos,new List<TEMP_NOT_SA_DETAIL>(), main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
await FirstInvoice(dtos, new List<TEMP_NOT_SA_DETAIL>(), main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
}
else//二次开票
{

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs

@ -44,7 +44,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public override async Task<string> GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input)
{
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
_pubNotMng.GenerateSettlementOrder(entitys);
return ApplicationConsts.SuccessStr;

788
code/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -1,4 +1,4 @@
using Magicodes.ExporterAndImporter.Excel;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
@ -77,255 +77,255 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
_service = service;
}
#region 派格大众看板-备件结算报表
//#region 派格大众看板-备件结算报表
/// <summary>
/// 大众准时化结算门板价格差异比对报表
/// </summary>
/// <param name="materialCode">客户物料号</param>
/// <param name="version">版本</param>
/// <param name="customerCode"></param>
/// <param name="sapCode">厂内物料号</param>
/// <param name="estimateTypeDesc">物料组</param>
/// <returns></returns>
[HttpPost]
[Route("SettleDoorPanel")]
[DisableRequestSizeLimit]
public async Task<string> SettleDoorPanel(
BaseRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(input.Version) ? string.Empty : input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(input.MaterialCode) ? string.Empty : input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(input.Begin) ? string.Empty : input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(input.End) ? string.Empty : input.End });
customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(input.Cp7Begin) ? string.Empty : input.Cp7Begin });
customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(input.Cp7End) ? string.Empty : input.Cp7End });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("准时化结算门板价格差异比对报表", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(SettleDoorPanelExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// 有条码看板结算核对
/// </summary>
/// <param name="kanBan">看板号</param>
/// <param name="sapMaterialCode">厂内零件号</param>
/// <param name="version">版本</param>
/// <param name="customerCode"></param>
/// <param name="customerPartCode">客户物料号</param>
/// <param name="estimateTypeDesc">物料组(车型)</param>
/// <param name="state"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <returns></returns>
[HttpPost]
[Route("SettleKanBan-WithCode")]
[DisableRequestSizeLimit]
public async Task<string> SettledKanBanWithCode(BaseKanbanReqestDto input)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = input.CustomerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerPartCode", Value = input.CustomerPartCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = input.State ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "EstimateTypeDesc", Value = input.EstimateTypeDesc ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.KanBan ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = input.SapMaterialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End ?? string.Empty });
var _taskid = await _service.ExportEnqueueAsync("看板结算输出", ExportExtentsion.Excel,input.Version ,string.Empty,CurrentUser, typeof(SettleKBWithCodeExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
[HttpPost]
[Route("SettleKanBan-WithOutCode")]
[DisableRequestSizeLimit]
///// <summary>
///// 大众准时化结算门板价格差异比对报表
///// </summary>
///// <param name="materialCode">客户物料号</param>
///// <param name="version">版本</param>
///// <param name="customerCode"></param>
///// <param name="sapCode">厂内物料号</param>
///// <param name="estimateTypeDesc">物料组</param>
///// <returns></returns>
//[HttpPost]
//[Route("SettleDoorPanel")]
//[DisableRequestSizeLimit]
public async Task<string> SettledKanBanWithOutCode(BaseKanbanReqestDto input)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = input.CustomerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerPartCode", Value = input.CustomerPartCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = input.State ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "EstimateTypeDesc", Value = input.EstimateTypeDesc ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.KanBan ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = input.SapMaterialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End ?? string.Empty });
var _taskid = await _service.ExportEnqueueAsync("无条码看板结算输出", ExportExtentsion.Excel, input.Version,string.Empty, CurrentUser, typeof(SettleKBWithOutCodeExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
#region 大众备件0-90天和90天以上输出
//public async Task<string> SettleDoorPanel(
// BaseRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(input.Version) ? string.Empty : input.Version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(input.MaterialCode) ? string.Empty : input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(input.Begin) ? string.Empty : input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(input.End) ? string.Empty : input.End });
// customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(input.Cp7Begin) ? string.Empty : input.Cp7Begin });
// customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(input.Cp7End) ? string.Empty : input.Cp7End });
// customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
// customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// var _taskid = await _service.ExportEnqueueAsync("准时化结算门板价格差异比对报表", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(SettleDoorPanelExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
///// 有条码看板结算核对
///// </summary>
///// <param name="kanBan">看板号</param>
///// <param name="sapMaterialCode">厂内零件号</param>
///// <param name="version">版本</param>
///// <param name="customerCode"></param>
///// <param name="customerPartCode">客户物料号</param>
///// <param name="estimateTypeDesc">物料组(车型)</param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpPost]
//[Route("SettleKanBan-WithCode")]
//[DisableRequestSizeLimit]
/// <summary>
/// 大众备件数据调整结算输出
/// </summary>
/// <param name="purchaseOrderNo"></param>
/// <param name="sapCode"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <param name="matialCode"></param>
/// <param name="state"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <returns></returns>
[HttpGet]
[Route("SettleSparePart90Export")]
[DisableRequestSizeLimit]
//public async Task<string> SettledKanBanWithCode(BaseKanbanReqestDto input)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = input.CustomerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerPartCode", Value = input.CustomerPartCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = input.State ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "EstimateTypeDesc", Value = input.EstimateTypeDesc ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.KanBan ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = input.SapMaterialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End ?? string.Empty });
// var _taskid = await _service.ExportEnqueueAsync("看板结算输出", ExportExtentsion.Excel,input.Version ,string.Empty,CurrentUser, typeof(SettleKBWithCodeExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
public async Task<string> SettledSparePart90(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
string state, DateTime begin, DateTime end)
{
//[HttpPost]
//[Route("SettleKanBan-WithOutCode")]
//[DisableRequestSizeLimit]
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
//public async Task<string> SettledKanBanWithOutCode(BaseKanbanReqestDto input)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = input.CustomerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerPartCode", Value = input.CustomerPartCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = input.State ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "EstimateTypeDesc", Value = input.EstimateTypeDesc ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.KanBan ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = input.SapMaterialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End ?? string.Empty });
// var _taskid = await _service.ExportEnqueueAsync("无条码看板结算输出", ExportExtentsion.Excel, input.Version,string.Empty, CurrentUser, typeof(SettleKBWithOutCodeExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
//#region 大众备件0-90天和90天以上输出
var _taskid = await _service.ExportEnqueueAsync("大众备件数据调整结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePart90ExportService), customConditionList, (rs) =>
{
///// <summary>
///// 大众备件数据调整结算输出
///// </summary>
///// <param name="purchaseOrderNo"></param>
///// <param name="sapCode"></param>
///// <param name="version"></param>
///// <param name="customerCode"></param>
///// <param name="factory"></param>
///// <param name="matialCode"></param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpGet]
//[Route("SettleSparePart90Export")]
//[DisableRequestSizeLimit]
});
return _taskid;
}
//public async Task<string> SettledSparePart90(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
// string state, DateTime begin, DateTime end)
//{
/// <summary>
/// 大众备件输出(包括带订货单号和无订单号)
/// </summary>
/// <param name="purchaseOrderNo">采购订单号</param>
/// <param name="sapCode">厂内物料号</param>
/// <param name="version">版本</param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <param name="matialCode">物料代码</param>
/// <param name="state"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <returns></returns>
[HttpGet]
[Route("SettleSparePartExport")]
[DisableRequestSizeLimit]
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("大众备件数据调整结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePart90ExportService), customConditionList, (rs) =>
// {
public async Task<string> SettledSparePart(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
string state, DateTime begin, DateTime end)
{
// });
// return _taskid;
//}
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
///// <summary>
///// 大众备件输出(包括带订货单号和无订单号)
///// </summary>
///// <param name="purchaseOrderNo">采购订单号</param>
///// <param name="sapCode">厂内物料号</param>
///// <param name="version">版本</param>
///// <param name="customerCode"></param>
///// <param name="factory"></param>
///// <param name="matialCode">物料代码</param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpGet]
//[Route("SettleSparePartExport")]
//[DisableRequestSizeLimit]
var _taskid = await _service.ExportEnqueueAsync("大众备件结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
{
//public async Task<string> SettledSparePart(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
// string state, DateTime begin, DateTime end)
//{
});
return _taskid;
}
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("大众备件结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
// {
/// <summary>
/// 大众备件未结明细
/// </summary>
/// <param name="purchaseOrderNo"></param>
/// <param name="sapCode"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <param name="matialCode"></param>
/// <param name="state"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <returns></returns>
[HttpGet]
[Route("UnSettleSparePartExport")]
[DisableRequestSizeLimit]
// });
// return _taskid;
//}
public async Task<string> UnSettledSparePart(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
string state, DateTime begin, DateTime end)
{
///// <summary>
///// 大众备件未结明细
///// </summary>
///// <param name="purchaseOrderNo"></param>
///// <param name="sapCode"></param>
///// <param name="version"></param>
///// <param name="customerCode"></param>
///// <param name="factory"></param>
///// <param name="matialCode"></param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpGet]
//[Route("UnSettleSparePartExport")]
//[DisableRequestSizeLimit]
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
//public async Task<string> UnSettledSparePart(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
// string state, DateTime begin, DateTime end)
//{
var _taskid = await _service.ExportEnqueueAsync("大众备件未结输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleUnSparePartExportService), customConditionList, (rs) =>
{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("大众备件未结输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleUnSparePartExportService), customConditionList, (rs) =>
// {
});
return _taskid;
}
#endregion
/// <summary>
/// 无订单备件结算输出
/// </summary>
/// <param name="purchaseOrderNo">采购订单号</param>
/// <param name="sapCode">厂内物料号</param>
/// <param name="version">版本</param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <param name="matialCode">物料代码</param>
/// <param name="state"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <returns></returns>
[HttpGet]
[Route("SettleSparePartExportExtend")]
[DisableRequestSizeLimit]
// });
// return _taskid;
//}
//#endregion
///// <summary>
///// 无订单备件结算输出
///// </summary>
///// <param name="purchaseOrderNo">采购订单号</param>
///// <param name="sapCode">厂内物料号</param>
///// <param name="version">版本</param>
///// <param name="customerCode"></param>
///// <param name="factory"></param>
///// <param name="matialCode">物料代码</param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpGet]
//[Route("SettleSparePartExportExtend")]
//[DisableRequestSizeLimit]
public async Task<string> SettledSparePartExtend(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
string state, DateTime begin, DateTime end)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
var _taskid = await _service.ExportEnqueueAsync("无订单备件结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
{
//public async Task<string> SettledSparePartExtend(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
// string state, DateTime begin, DateTime end)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("无订单备件结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
// {
});
return _taskid;
}
#endregion
// });
// return _taskid;
//}
//#endregion
[HttpGet]
[Route("SharePartUnSettledExport")]
@ -692,189 +692,189 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
// return _taskid;
//}
#region 红旗、一汽轿车的输出报表
//#region 红旗、一汽轿车的输出报表
/// <summary>
///红旗工厂核对明细
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQHSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
[UnitOfWork(false)]
public async Task<string> HQHSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
///// <summary>
/////红旗工厂核对明细
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("HQHSettledDetailDiffExportService")]
//[DisableRequestSizeLimit]
//[UnitOfWork(false)]
//public async Task<string> HQHSettledDetailDiffExportServiceMake(
// HQKanbanRequestDto input
// )
//{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("红旗工厂核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
// customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// var _taskid = await _service.ExportEnqueueAsync("红旗工厂核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHSettledDetailDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
/// <summary>
///红旗工厂未结明细
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQHUnSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQHUnSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion });
var _taskid = await _service.ExportEnqueueAsync("红旗工厂未结明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHUnSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
///// <summary>
/////红旗工厂未结明细
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("HQHUnSettledDetailDiffExportService")]
//[DisableRequestSizeLimit]
//public async Task<string> HQHUnSettledDetailDiffExportServiceMake(
// HQKanbanRequestDto input
// )
//{
/// <summary>
///红旗未结核对
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQFactoryUnSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQFactoryUnSettledDetailDiffExportService(
HQKanbanRequestDto input
)
{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
// customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion });
// var _taskid = await _service.ExportEnqueueAsync("红旗工厂未结明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHUnSettledDetailDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion });
var _taskid = await _service.ExportEnqueueAsync("红旗未结核对", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFactoryUnSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
///// <summary>
/////红旗未结核对
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("HQFactoryUnSettledDetailDiffExportService")]
//[DisableRequestSizeLimit]
//public async Task<string> HQFactoryUnSettledDetailDiffExportService(
// HQKanbanRequestDto input
// )
//{
/// <summary>
/// 红旗工厂备件明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQHSharePartSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQHSharePartSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
// customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion });
// var _taskid = await _service.ExportEnqueueAsync("红旗未结核对", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFactoryUnSettledDetailDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("H平台备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
///// <summary>
///// 红旗工厂备件明细
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpPost]
//[Route("HQHSharePartSettledDetailDiffExportService")]
//[DisableRequestSizeLimit]
//public async Task<string> HQHSharePartSettledDetailDiffExportServiceMake(
// HQKanbanRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
// customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// var _taskid = await _service.ExportEnqueueAsync("H平台备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
[HttpPost]
[Route("FisUpdateExportService")]
[DisableRequestSizeLimit]
[UnitOfWork(isTransactional: false)]
public async Task<string> FisUpdateExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
var _taskid = await _service.ExportEnqueueAsync("Fis发货数据更新状态", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(FisUpdateExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
//[HttpPost]
//[Route("FisUpdateExportService")]
//[DisableRequestSizeLimit]
//[UnitOfWork(isTransactional: false)]
//public async Task<string> FisUpdateExportServiceMake(
// HQKanbanRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// var _taskid = await _service.ExportEnqueueAsync("Fis发货数据更新状态", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(FisUpdateExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
/// <summary>
/// 结算未结寄售核对表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("UnSettledSum-Make")]
[DisableRequestSizeLimit]
[UnitOfWork(false)]
public async Task<string> UnSettledSumServiceMake(
///// <summary>
///// 结算未结寄售核对表
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("UnSettledSum-Make")]
//[DisableRequestSizeLimit]
//[UnitOfWork(false)]
//public async Task<string> UnSettledSumServiceMake(
BaseRequestDto input
// BaseRequestDto input
)
{
// )
//{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = !string.IsNullOrEmpty(input.Version) ? input.Version : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = !string.IsNullOrEmpty(input.MaterialCode) ? input.MaterialCode : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = !string.IsNullOrEmpty(input.MaterialGroup) ? input.MaterialGroup : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Begin", Value = string.IsNullOrEmpty(input.Begin) ? string.Empty : input.Begin });
customConditionList.Add(new CustomCondition() { Name = "End", Value = string.IsNullOrEmpty(input.End) ? string.Empty : input.End });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("结算未结寄售核对表", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(UnSettledSumService), customConditionList, (rs) =>
{
});
return _taskid;
}
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = !string.IsNullOrEmpty(input.Version) ? input.Version : string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = !string.IsNullOrEmpty(input.MaterialCode) ? input.MaterialCode : string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = !string.IsNullOrEmpty(input.MaterialGroup) ? input.MaterialGroup : string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "Begin", Value = string.IsNullOrEmpty(input.Begin) ? string.Empty : input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "End", Value = string.IsNullOrEmpty(input.End) ? string.Empty : input.End });
// customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
// customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// var _taskid = await _service.ExportEnqueueAsync("结算未结寄售核对表", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(UnSettledSumService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
#endregion
//#endregion
}
}

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs

@ -67,7 +67,7 @@ public class BBAC_NOT_SA_DETAIL:SA_NOT_BASE
/// 对应字段MovementType,996正常,997为退货
/// </summary>
[Display(Name = "是否退货")]
public string IsReturn { get; set; } = null!;
public bool IsReturn { get; set; } =false;
//[Display(Name = "发票分组号")]
//public string InvGroupNum { get; set; } = null!;
@ -92,7 +92,7 @@ public class BBAC_NOT_SA_DETAIL:SA_NOT_BASE
}
public BBAC_NOT_SA_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, string isReturn, string invGroupNum, DateTime settleDate, string groupNum,string contractDocID)
public BBAC_NOT_SA_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, bool isReturn, string invGroupNum, DateTime settleDate, string groupNum,string contractDocID)
{
Id = guid;

31
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs

@ -53,18 +53,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var _entityList = new List<BBAC_CAN_SA_DETAIL>();
foreach (var itm in p_list)
{
var _detailEntity = new BBAC_CAN_SA_DETAIL();
{
_detailEntity.SettleBillNum = itm.SettleBillNum;
_detailEntity.BillNum = billNumber;
_detailEntity.InvGroupNum = billNumber;
_detailEntity.LU = itm.LU;
_detailEntity.PN = itm.PN;
_detailEntity.GroupNum = itm.GroupNum;
_detailEntity.KeyCode = itm.KeyCode;
_detailEntity.Price = itm.Price;
_detailEntity.Version = itm.Version;
};
var _detailEntity = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: billNumber,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: itm.Price,
category: itm.BusinessType,
isReturn: itm.IsReturn,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: billNumber,
contactid: itm.ContractDocID
);
_entityList.Add(_detailEntity);
}
await _repository.DbContext.BulkDeleteAsync(p_list);

10
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs

@ -253,7 +253,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync();
}
/// <summary>
/// 获取发票对应结算分组所有零件
/// </summary>
/// <param name="billNum"></param>
/// <returns></returns>
public virtual async Task<List<HBPO_CAN_SA_DETAIL>> GetContainsAsync(string p_canSettleBillNum, List<string> p_list)
{
return await _detailRepository.Where(p => p.InvGroupNum == p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync();
}

30
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -265,6 +265,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <summary>
/// 客户已收票
/// </summary>
@ -497,10 +501,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
}
}
//if (_ls != null && _ls.Count > 0)
//{
// foreach (var p_entity in _ls)
@ -522,28 +522,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
// await _repository.DbContext.BulkDeleteAsync(notList);
// await _repository.DbContext.BulkDeleteAsync(detailList);
// //await _repository.DbContext.BulkUpdateAsync(canList);
// }
// if (p_entity.State == InvoiceBillState.已扣减)
// {
// }
// }
//}
//else
//{
//}
return true;
}
/// <summary>
/// hbpo、jit、备件等
@ -572,6 +561,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty),
Price = p.Key.Price,
ContractDocID = p.Key.ContractDocID,
BeginDate = p.Key.BeginDate,
EndDate = p.Key.EndDate
}).ToList();//汇总记录不出现重复值
@ -629,7 +619,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
ContractDocID = itm.ContractDocID,
EndDate = itm.EndDate
};
groups1 = query.ToList();
}
}
@ -669,6 +658,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
}
decimal amt = detailList.Sum(k => k.Amt);
decimal txtAmt = Math.Round(detailList.Sum(k => k.Amt), 2);
var contractList = ls.Select(p => p.ContractDocID).Distinct();
var _groupList = dtos.Where(p => contractList.Contains(p.ContractDocID)).GroupBy(p => new { p.GroupNum })
.Select(p => new { GroupNum = p.Key.GroupNum, Amt = p.Sum(itm => itm.Amt) }).Distinct();
@ -790,6 +780,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
var key = itm.Key;//发票票号
var ls = itm.Value;//结算分组号列表
//if(businessType==EnumBusinessType.JisBBAC)
//{
//}
var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID })
.Select(itm => new
{
@ -902,7 +896,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
}
/// <summary>
///
/// 重开一次开票
/// </summary>
/// <param name="dtos"></param>
/// <param name="p_OldInvBillNum"></param>
@ -931,7 +925,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return false;
}
/// <summary>
///
/// 重开二次开票
/// </summary>
/// <param name="dtos"></param>
/// <param name="p_OldInvBillNum"></param>

13
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs

@ -219,10 +219,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var entity= await GetMainAsync(billNum);
if (entity != null )
{
entity.State = SettleBillState.;
await _repository.UpdateAsync(entity);
return true;
}
@ -247,7 +244,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync();
}
/// <summary>
/// 获取发票对应结算分组所有零件
/// </summary>
/// <param name="billNum"></param>
/// <returns></returns>
public virtual async Task<List<PUB_CAN_SA_DETAIL>> GetContainsAsync(string p_canSettleBillNum, List<string> p_list)
{
return await _detailRepository.Where(p => p.InvGroupNum == p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync();
}

31
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

@ -55,18 +55,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var _entityList = new List<PUB_CAN_SA_DETAIL>();
foreach (var itm in p_list)
{
var _detailEntity = new PUB_CAN_SA_DETAIL();
{
_detailEntity.SettleBillNum = itm.SettleBillNum;
_detailEntity.BillNum = billNumber;
_detailEntity.InvGroupNum = billNumber;
_detailEntity.LU = itm.LU;
_detailEntity.PN = itm.PN;
_detailEntity.GroupNum = itm.GroupNum;
_detailEntity.KeyCode = itm.KeyCode;
_detailEntity.Price = itm.Price;
_detailEntity.Version = itm.Version;
};
var _detailEntity = new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: billNumber,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: itm.Price,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: billNumber
);
_entityList.Add(_detailEntity);
}
await _notRepository.DbContext.BulkDeleteAsync(p_list);

Loading…
Cancel
Save