马昊 2 years 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> /// </summary>
[Display(Name = "结算日期")] [Display(Name = "结算日期")]
[ImporterHeader(Name = "ReceiveDate", Format = "yyyy/MM/dd")] [ImporterHeader(Name = "ReceiveDate", Format = "yyyy/MM/dd HH:mm:ss")]
public DateTime SettleDate { set; get; } public DateTime SettleDate { set; get; }
/// <summary> /// <summary>
/// 零件 /// 结算分组
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "DeliveryNode")]
[Required(ErrorMessage = "{0}不能为空")] [Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "PartNumber")] [ImporterHeader(Name = "DeliveryNode")]
public string LU { get; set; } public string GroupNum { get; set; }
/// <summary> /// <summary>
/// 生产号 /// 到货日期
/// </summary> /// </summary>
[Display(Name = "生产号")] [Display(Name = "DeliveryDate")]
[ImporterHeader(Name = "productionNumber")]
[Required(ErrorMessage = "{0}不能为空")] [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>
/// 数量 /// 数量
/// </summary> /// </summary>
[Display(Name = "数量")] [Display(Name = "结算数量")]
[ImporterHeader(Name = "Qty")] [ImporterHeader(Name = "Qty")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary> /// <summary>
/// 结算分组号 /// 工厂地点
/// </summary> /// </summary>
[Display(Name = "结算分组号")] [Display(Name = "filename")]
[ImporterHeader(Name = "DeliveryNode")]
[Required(ErrorMessage = "{0}不能为空")] [Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; } [ImporterHeader(Name = "filename")]
public string Site { get; set; }
/// <summary> /// <summary>
/// 工厂地点 /// 生产号
/// </summary> /// </summary>
[Display(Name = "工厂地点")] [Display(Name = "productionNumber")]
[ImporterHeader(Name = "filename")]
[Required(ErrorMessage = "{0}不能为空")] [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.Constant;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
using OfficeOpenXml;
using OfficeOpenXml.Core;
namespace Win.Sfs.SettleAccount.Entities.BQ; 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 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); var importPubSaDetails = ObjectMapper.Map<List<HBPO_SA_DETAIL_IMPORT_DTO>, List<HBPO_SA_DETAIL>>(result);
return "";
//结算分组号 //结算分组号
var hbpoSaGroupNums = importPubSaDetails.Select(t => t.GroupNum).Distinct(); var hbpoSaGroupNums = importPubSaDetails.Select(t => t.GroupNum).Distinct();
@ -208,7 +212,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
}); });
#endregion #endregion
#region 入库数据赋值 #region 入库数据赋值
//结算明细 //结算明细
hbpoSaDetails = importPubSaDetails; hbpoSaDetails = importPubSaDetails;
@ -243,7 +246,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
{ {
hbpoNotSaDetails.ForEach(hbpoNotSaDetail => hbpoNotSaDetails.ForEach(hbpoNotSaDetail =>
{ {
hbpoNotSaDetail.InvGroupNum = hbpoCanSaBillNum;
hbpoNotSaDetail.BusinessType = businessType; hbpoNotSaDetail.BusinessType = businessType;
}); });
@ -310,19 +312,19 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
//删除 //删除
await _hbpoSaRepository.DeleteAsync(hbpoSaDelEntity); await _hbpoSaRepository.DeleteAsync(hbpoSaDelEntity);
if (hbpoSaDetailDelEntitys != null) if (hbpoSaDetailDelEntitys.Any())
{ {
await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetailDelEntitys); await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetailDelEntitys);
} }
if (hbpoCanSaDelEntitys != null) if (hbpoCanSaDelEntitys.Any())
{ {
await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSaDelEntitys); await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSaDelEntitys);
} }
if (hbpoCanSaDetailDelEntitys != null) if (hbpoCanSaDetailDelEntitys.Any())
{ {
await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetailDelEntitys); await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetailDelEntitys);
} }
if (hbpoNotSaDetailDelEntitys != null) if (hbpoNotSaDetailDelEntitys.Any())
{ {
await _hbpoNotSaDetailRepository.DeleteManyAsync(hbpoNotSaDetailDelEntitys); 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; List<PUB_NOT_SA_DETAIL> pubNotSaDetailDelEntitys;
pubSaDelEntity = await _repository.FindAsync(id); pubSaDelEntity = await _repository.FindAsync(id);
if (pubSaDelEntity == null) return; if (pubSaDelEntity == null) return;
//结算单据 //结算单据
@ -160,19 +159,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//删除 //删除
await _repository.DeleteAsync(pubSaDelEntity); await _repository.DeleteAsync(pubSaDelEntity);
if (pubSaDetailDelEntitys != null) if (pubSaDetailDelEntitys.Any())
{ {
await _pubSaDetailRepository.DeleteManyAsync(pubSaDetailDelEntitys); await _pubSaDetailRepository.DeleteManyAsync(pubSaDetailDelEntitys);
} }
if (pubCanSaDelEntitys != null) if (pubCanSaDelEntitys.Any())
{ {
await _pubCanSaRepository.DeleteManyAsync(pubCanSaDelEntitys); await _pubCanSaRepository.DeleteManyAsync(pubCanSaDelEntitys);
} }
if (pubCanSaDetailDelEntitys != null) if (pubCanSaDetailDelEntitys.Any())
{ {
await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetailDelEntitys); await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetailDelEntitys);
} }
if (pubNotSaDetailDelEntitys != null) if (pubNotSaDetailDelEntitys.Any())
{ {
await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetailDelEntitys); await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetailDelEntitys);
} }
@ -321,7 +320,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
pubNotSaDetails.ForEach(pubNotSaDetail => pubNotSaDetails.ForEach(pubNotSaDetail =>
{ {
pubNotSaDetail.InvGroupNum = pubCanSaBillNum;
pubNotSaDetail.BusinessType = businessType; pubNotSaDetail.BusinessType = businessType;
}); });

Loading…
Cancel
Save