mahao 1 year ago
parent
commit
cd5cc75e48
  1. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs
  3. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs
  4. 92
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs
  5. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  6. 34
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  7. 23
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  8. 36
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs
  9. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs
  10. 35
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs
  11. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  12. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs
  13. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs
  14. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs

2
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs

@ -32,7 +32,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///状态 ///状态
/// </summary> /// </summary>
[Display(Name = "状态")] [Display(Name = "状态")]
public string State { get; set; } public EnumBusinessType State { get; set; }
/// <summary> /// <summary>
///明细记录行数 ///明细记录行数
/// </summary> /// </summary>

2
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs

@ -32,7 +32,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///状态 ///状态
/// </summary> /// </summary>
[Display(Name = "状态")] [Display(Name = "状态")]
public string State { get; set; } public EnumBusinessType State { get; set; }
/// <summary> /// <summary>
///明细记录行数 ///明细记录行数
/// </summary> /// </summary>

5
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs

@ -39,6 +39,11 @@ public class PUB_ADJ_DETAIL_DTO : EntityDto<Guid>
public decimal Qty { get; set; } public decimal Qty { get; set; }
[Display(Name = "结算分组")] [Display(Name = "结算分组")]
public string GroupNum { get; set; } public string GroupNum { get; set; }
[Display(Name = "键值")]
public string KeyCode { get; set; }
} }
public class PUB_ADJ_DETAIL_EXP_DTO public class PUB_ADJ_DETAIL_EXP_DTO
{ {

92
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs

@ -1,8 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using DocumentFormat.OpenXml.Bibliography;
using DocumentFormat.OpenXml.Office2010.Excel; using DocumentFormat.OpenXml.Office2010.Excel;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
@ -19,6 +21,7 @@ using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Temp;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
@ -36,6 +39,10 @@ public class ADJ_SERVICE : BASE_SERVICE
protected readonly BaseDomainService _baseDomainService; protected readonly BaseDomainService _baseDomainService;
protected readonly INormalEfCoreRepository<INVOICE_GRP, Guid> _invRepository; protected readonly INormalEfCoreRepository<INVOICE_GRP, Guid> _invRepository;
protected readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relRepository; protected readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relRepository;
protected readonly INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> _bbacRepository;
protected readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _pubRepository;
protected readonly INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> _hbpoRepository;
public ADJ_SERVICE( public ADJ_SERVICE(
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> repository, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> repository,
@ -44,7 +51,10 @@ public class ADJ_SERVICE : BASE_SERVICE
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager, ICommonManager commonManager,
INormalEfCoreRepository<INVOICE_GRP, Guid> invRepository, INormalEfCoreRepository<INVOICE_GRP, Guid> invRepository,
INormalEfCoreRepository<MaterialRelationship, Guid> relRepository INormalEfCoreRepository<MaterialRelationship, Guid> relRepository,
INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> bbacRepository,
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> hbpoRepository
) )
: base(excelImportService, snowflakeIdGenerator, commonManager) : base(excelImportService, snowflakeIdGenerator, commonManager)
@ -53,6 +63,9 @@ public class ADJ_SERVICE : BASE_SERVICE
_invRepository = invRepository; _invRepository = invRepository;
_repository = repository; _repository = repository;
_baseDomainService = baseDomainService; _baseDomainService = baseDomainService;
_bbacRepository = bbacRepository;
_pubRepository = pubRepository;
_hbpoRepository= hbpoRepository;
} }
/// <summary> /// <summary>
///查询明细 ///查询明细
@ -171,7 +184,84 @@ public class ADJ_SERVICE : BASE_SERVICE
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
public async Task<string> CheckImport(List<PUB_ADJ_DETAIL_DTO> p_list) public async Task<string> CheckImport(List<PUB_ADJ_DETAIL_DTO> p_list)
{ {
if (p_list.Count == 0)
{
throw new UserFriendlyException($"导入数据为空");
}
foreach (var itm in p_list)
{
itm.KeyCode = itm.PN + itm.LU.Replace(" ", "").Trim();
}
var pnlist=p_list.Select(p => p.PN).Distinct();
var keylist = p_list.Select(p => p.KeyCode).Distinct();
List<ERR_EXP_DTO> errorList = new List<ERR_EXP_DTO>(); List<ERR_EXP_DTO> errorList = new List<ERR_EXP_DTO>();
var first=p_list.FirstOrDefault();
if (first != null)
{
var inv = _invRepository.Where(p => p.InvbillNum == first.InvBillNum).FirstOrDefault();
string keyname = string.Empty;
List<PUB_ADJ_DETAIL> adjlist = new List<PUB_ADJ_DETAIL>();
switch (inv.BusinessType)
{
case EnumBusinessType.MaiDanJianHBPO:
break;
case EnumBusinessType.MaiDanJianBBAC:
break;
case EnumBusinessType.ZhiGongJianBBAC:
var errors1 = _pubRepository.Where(p => pnlist.Contains(p.PN));
foreach (var p in errors1)
{
errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在{p.PN}数据,不能导入调整表" });
}
break;
case EnumBusinessType.ZhiGongJianHBPO:
var errors2 = _pubRepository.Where(p => pnlist.Contains(p.PN));
foreach (var p in errors2)
{
errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在发货单{p.PN}数据,不能导入调整表" });
}
break;
case EnumBusinessType.BeiJian:
var errors3 = _pubRepository.Where(p => pnlist.Contains(p.PN));
foreach (var p in errors3)
{
errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在交付识别号{p.PN}数据,不能导入调整表" });
}
break;
case EnumBusinessType.JisBBAC:
var errors4 = _bbacRepository.Where(p => keylist.Contains(p.KeyCode));
foreach (var p in errors4)
{
errorList.Add(new ERR_EXP_DTO() {Message=$"不能结算数据中存在生产码{p.PN}结算零件{p.PartCode},不能导入调整表" });
}
break;
case EnumBusinessType.JisHBPO:
var errors5=_hbpoRepository.Where(p => keylist.Contains(p.KeyCode));
foreach (var p in errors5)
{
errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在生产码{p.PN}结算零件{p.PartCode},不能导入调整表" });
}
break;
case EnumBusinessType.YinDuJian:
var errors6=_pubRepository.Where(p => pnlist.Contains(p.PN));
foreach (var p in errors6)
{
errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在发货单{p.PN}数据,不能导入调整表" });
}
break;
}
}
//ExportImporter _exportImporter = new ExportImporter(); //ExportImporter _exportImporter = new ExportImporter();
//var result = await _exportImporter.UploadExcelImport<PUB_ADJ_DETAIL_IMP_DTO>(files, _excelImportService); //var result = await _exportImporter.UploadExcelImport<PUB_ADJ_DETAIL_IMP_DTO>(files, _excelImportService);
//if (result.Count == 0) //if (result.Count == 0)

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

@ -150,9 +150,12 @@ namespace Win.Sfs.SettleAccount.Bases
var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w); var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w);
var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s); var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s);
var adjs = await _adjRepository.GetListByFilterAsync(input.Filters);
var adjdtos = ObjectMapper.Map<List<PUB_ADJ_DETAIL>, List<PUB_ADJ_DETAIL_DTO>>(adjs);
entity.INVOICE_NOT_SETTLE = sdtos; entity.INVOICE_NOT_SETTLE = sdtos;
entity.INVOICE_WAIT_DETAIL = wdtos; entity.INVOICE_WAIT_DETAIL = wdtos;
entity.INVOICE_MAP_GROUP = mdtos; entity.INVOICE_MAP_GROUP = mdtos;
entity.ADJ_DETAIL = adjdtos;
return entity; return entity;
} }
/// <summary> /// <summary>

34
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs

@ -47,9 +47,9 @@ namespace Win.Sfs.SettleAccount.Bases
where TRequestDetailInput : RequestInputBase where TRequestDetailInput : RequestInputBase
where TEntityDetailExportDto : class, new() where TEntityDetailExportDto : class, new()
{ {
private readonly VmiAppService _vimservice; protected readonly VmiAppService _vimservice;
private readonly INormalEfCoreRepository<TEntity, Guid> _repository; protected readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository; protected readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
public PD_SERVICE( public PD_SERVICE(
@ -125,33 +125,9 @@ namespace Win.Sfs.SettleAccount.Bases
//[Route("generateinvoice")] //[Route("generateinvoice")]
public virtual async Task<string> ApprovalPassed(List<string> p_list) public virtual async Task<string> ApprovalPassed(List<string> p_list)
{ {
//_repository.Where(p => p_list.Contains(p.BillNum)); //_repository.Where(p => p_list.Contains(p.BillNum));
var detailist=_detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
await _vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime=itm.CreationTime,
ChangedTime=DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType= Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty=itm.Qty,
ChangedType=VmiType.Out,
SubBillType=EnumDeliverSubBillType.BBAC,
BillType=EnumDeliverBjBmpBillType.JIS件,
PartCode=itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode=itm.LU,
VinCode=itm.PN,
OrderNum=itm.GroupNum,
ErpToLoc="C0001"
}) ;
}
}
//public VmiLog() //public VmiLog()
//{ //{

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

@ -81,7 +81,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
throw new UserFriendlyException($"选择发票:{p_invbillnum}对应的可结算单不在请检查!"); throw new UserFriendlyException($"选择发票:{p_invbillnum}对应的可结算单不在请检查!");
} }
version = settle.Version; version = settle.Version;
if (inv != null) if (inv != null)
{ {
@ -191,8 +190,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <returns></returns> /// <returns></returns>
public virtual async Task<string> ReissueInvoiceExtend(List<PUB_ADJ_DETAIL_DTO> p_list) public virtual async Task<string> ReissueInvoiceExtend(List<PUB_ADJ_DETAIL_DTO> p_list)
{ {
var adjlist = ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(p_list); var adjlist = ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(p_list);
if (adjlist == null && adjlist.Count == 0) if (adjlist == null && adjlist.Count == 0)
{ {
@ -200,19 +197,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
var first = p_list.FirstOrDefault(); var first = p_list.FirstOrDefault();
var invbillnum = first.InvBillNum; var invbillnum = first.InvBillNum;
//var mappingList= await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
//if (mappingList != null && mappingList.Count() > 0)
//{
var version=int.Parse(DateTime.Now.ToString("yyyymm")); var version=int.Parse(DateTime.Now.ToString("yyyymm"));
//var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组
var inv= await GetInvoiceGroupByInvBillNum(invbillnum); var inv= await GetInvoiceGroupByInvBillNum(invbillnum);
var settle =await _bbacMng.GetMainAsync(inv.InvGroupNum); var settle =await _bbacMng.GetMainAsync(inv.InvGroupNum);
if(settle==null) if(settle==null)
{ {
throw new UserFriendlyException( $"选择发票:{invbillnum}对应的可结算单不在请检查!"); throw new UserFriendlyException( $"选择发票:{invbillnum}对应的可结算单不粗拿在在请检查!");
} }
version=settle.Version; version=settle.Version;
@ -226,8 +220,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
throw new UserFriendlyException( $"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!"); throw new UserFriendlyException( $"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!");
} }
var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//发票对应结算零件
var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件
// var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 // var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
if (adjlist != null && adjlist.Count() > 0) if (adjlist != null && adjlist.Count() > 0)
{ {
@ -427,16 +420,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 if (invbillnum.Substring(0, 3) == "INV")//一次开票重开
{ {
var entities=await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); var entities=await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum);
ls= ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities);
ls= ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities);
} }
else//二次开票 else//二次开票
{ {
var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum);
ls=ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities); ls=ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities);
} }
} }
} }

36
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs

@ -11,7 +11,10 @@ using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
@ -28,5 +31,38 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public BBAC_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<BBAC_PD, Guid> repository, VmiAppService vimservice, INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository) public BBAC_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<BBAC_PD, Guid> repository, VmiAppService vimservice, INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository)
{ {
} }
public override async Task<string> ApprovalPassed(List<string> p_list)
{
var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
await _vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
});
}
}
return ApplicationConsts.SuccessStr;
}
} }
} }

39
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs

@ -15,8 +15,11 @@ using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
@ -61,5 +64,41 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public HBPO_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<HBPO_PD, Guid> repository, VmiAppService vimservice, INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository) public HBPO_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<HBPO_PD, Guid> repository, VmiAppService vimservice, INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository)
{ {
} }
public override async Task<string> ApprovalPassed(List<string> p_list)
{
var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
await _vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
});
}
}
return ApplicationConsts.SuccessStr;
}
} }
} }

35
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs

@ -11,8 +11,11 @@ using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
@ -25,6 +28,38 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
public PUB_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_PD, Guid> repository, VmiAppService vimservice, INormalEfCoreRepository<PUB_PD_DETAIL, Guid> detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository) public PUB_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_PD, Guid> repository, VmiAppService vimservice, INormalEfCoreRepository<PUB_PD_DETAIL, Guid> detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository)
{ {
}
public override async Task<string> ApprovalPassed(List<string> p_list)
{
var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
await _vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
});
}
}
return ApplicationConsts.SuccessStr;
} }
} }
} }

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

@ -575,7 +575,7 @@ namespace SettleAccount.Bases
/// </summary> /// </summary>
public int Version { set; get; } public int Version { set; get; }
/// <summary> /// <summary>
/// 结算单号 /// 发票单号
/// </summary> /// </summary>
public string BillNum { set; get; } public string BillNum { set; get; }
/// <summary> /// <summary>

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

@ -54,7 +54,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
foreach (var itm in priceErrors) foreach (var itm in priceErrors)
{ {
errors.Add($"发货单号或交付识别号零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据"); errors.Add($"生产号{itm.PN}零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据");
} }
} }
if (errors.Count > 0) if (errors.Count > 0)
@ -63,8 +63,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var billNumber = OrderNumberGenerator.GenerateOrderNumber("N");
var _entity = new BBAC_CAN_SA(); var _entity = new BBAC_CAN_SA();
_entity.BillNum = billNumber; _entity.BillNum = billNumber;

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs

@ -55,9 +55,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
foreach (var itm in priceErrors) foreach (var itm in priceErrors)
{ {
errors.Add($"发货单号或交付识别号零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据"); errors.Add($"生产号{itm.PN}零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据");
} }
} }
var ls=p_list.Select(p => p.Site.Substring(0, 3)).Distinct().ToList();
if(ls.Count>1)
{
errors.Add($"生成结算数据有多个地点数据{string.Join(",",ls)}");
}
if (errors.Count > 0) if (errors.Count > 0)
{ {
return errors; return errors;

3
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs

@ -778,7 +778,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
adjdetails.Add(detail); adjdetails.Add(detail);
} }
} }
var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID })
.Select(itm => new .Select(itm => new
{ {
@ -1244,8 +1243,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
inv.InvoiceState = InvoiceBillState.; inv.InvoiceState = InvoiceBillState.;
switch (inv.BusinessType) switch (inv.BusinessType)
{ {
case EnumBusinessType.MaiDanJianHBPO: case EnumBusinessType.MaiDanJianHBPO:

Loading…
Cancel
Save