mahao 1 year ago
parent
commit
ccbfc5c970
  1. 44
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs
  2. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  3. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

44
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs

@ -61,45 +61,53 @@ public class HBPO_SA_DETAIL_IMPORT_DTO
/// 结算日期
/// </summary>
[Display(Name = "结算日期")]
[ImporterHeader(Name = "ReceiveDate", Format = "yyyy/MM/dd")]
[ImporterHeader(Name = "ReceiveDate", Format = "yyyy/MM/dd HH:mm:ss")]
public DateTime SettleDate { set; get; }
/// <summary>
/// 零件
/// 结算分组
/// </summary>
[Display(Name = "零件号")]
[Display(Name = "DeliveryNode")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "PartNumber")]
public string LU { get; set; }
[ImporterHeader(Name = "DeliveryNode")]
public string GroupNum { get; set; }
/// <summary>
/// 生产号
/// 到货日期
/// </summary>
[Display(Name = "生产号")]
[ImporterHeader(Name = "productionNumber")]
[Display(Name = "DeliveryDate")]
[Required(ErrorMessage = "{0}不能为空")]
public string PN { get; set; }
[ImporterHeader(Name = "DeliveryDate", Format = "MM/yyyy/dd HH:mm:ss")]
public DateTime? DeliveryDate { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "PartNumber")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "PartNumber")]
public string LU { get; set; }
/// <summary>
/// 数量
/// </summary>
[Display(Name = "数量")]
[Display(Name = "结算数量")]
[ImporterHeader(Name = "Qty")]
public decimal Qty { get; set; }
/// <summary>
/// 结算分组号
/// 工厂地点
/// </summary>
[Display(Name = "结算分组号")]
[ImporterHeader(Name = "DeliveryNode")]
[Display(Name = "filename")]
[Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; }
[ImporterHeader(Name = "filename")]
public string Site { get; set; }
/// <summary>
/// 工厂地点
/// 生产号
/// </summary>
[Display(Name = "工厂地点")]
[ImporterHeader(Name = "filename")]
[Display(Name = "productionNumber")]
[Required(ErrorMessage = "{0}不能为空")]
public string Site { get; set; }
[ImporterHeader(Name = "productionNumber")]
public string PN { get; set; }
}

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -22,6 +22,8 @@ using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using OfficeOpenXml;
using OfficeOpenXml.Core;
namespace Win.Sfs.SettleAccount.Entities.BQ;
@ -143,6 +145,8 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
var result = await _exportImporter.UploadExcelImport<HBPO_SA_DETAIL_IMPORT_DTO>(files, _excelImportService);
var importPubSaDetails = ObjectMapper.Map<List<HBPO_SA_DETAIL_IMPORT_DTO>, List<HBPO_SA_DETAIL>>(result);
return "";
//结算分组号
var hbpoSaGroupNums = importPubSaDetails.Select(t => t.GroupNum).Distinct();
@ -208,7 +212,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
});
#endregion
#region 入库数据赋值
//结算明细
hbpoSaDetails = importPubSaDetails;
@ -243,7 +246,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
{
hbpoNotSaDetails.ForEach(hbpoNotSaDetail =>
{
hbpoNotSaDetail.InvGroupNum = hbpoCanSaBillNum;
hbpoNotSaDetail.BusinessType = businessType;
});
@ -310,19 +312,19 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
//删除
await _hbpoSaRepository.DeleteAsync(hbpoSaDelEntity);
if (hbpoSaDetailDelEntitys != null)
if (hbpoSaDetailDelEntitys.Any())
{
await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetailDelEntitys);
}
if (hbpoCanSaDelEntitys != null)
if (hbpoCanSaDelEntitys.Any())
{
await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSaDelEntitys);
}
if (hbpoCanSaDetailDelEntitys != null)
if (hbpoCanSaDetailDelEntitys.Any())
{
await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetailDelEntitys);
}
if (hbpoNotSaDetailDelEntitys != null)
if (hbpoNotSaDetailDelEntitys.Any())
{
await _hbpoNotSaDetailRepository.DeleteManyAsync(hbpoNotSaDetailDelEntitys);
}

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -140,7 +140,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//不可结算
List<PUB_NOT_SA_DETAIL> pubNotSaDetailDelEntitys;
pubSaDelEntity = await _repository.FindAsync(id);
if (pubSaDelEntity == null) return;
//结算单据
@ -160,19 +159,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//删除
await _repository.DeleteAsync(pubSaDelEntity);
if (pubSaDetailDelEntitys != null)
if (pubSaDetailDelEntitys.Any())
{
await _pubSaDetailRepository.DeleteManyAsync(pubSaDetailDelEntitys);
}
if (pubCanSaDelEntitys != null)
if (pubCanSaDelEntitys.Any())
{
await _pubCanSaRepository.DeleteManyAsync(pubCanSaDelEntitys);
}
if (pubCanSaDetailDelEntitys != null)
if (pubCanSaDetailDelEntitys.Any())
{
await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetailDelEntitys);
}
if (pubNotSaDetailDelEntitys != null)
if (pubNotSaDetailDelEntitys.Any())
{
await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetailDelEntitys);
}
@ -321,7 +320,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
pubNotSaDetails.ForEach(pubNotSaDetail =>
{
pubNotSaDetail.InvGroupNum = pubCanSaBillNum;
pubNotSaDetail.BusinessType = businessType;
});

Loading…
Cancel
Save