wanggang 1 year ago
parent
commit
5323e83555
  1. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs
  2. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs
  3. 262
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs
  4. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs
  5. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs
  6. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs
  7. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs
  8. 263
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs
  9. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs
  10. 264
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs
  11. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  12. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  13. 129
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  14. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs
  15. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs
  16. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  17. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs
  18. 32
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  19. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
  20. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs
  21. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs
  22. 9
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  23. 4023
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718010724_20230718-1.Designer.cs
  24. 163
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718010724_20230718-1.cs
  25. 4023
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718011250_20230718-2.Designer.cs
  26. 17
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718011250_20230718-2.cs
  27. 43
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

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

@ -74,6 +74,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 零件号 /// 零件号
/// </summary> /// </summary>
public string LU { get; set; } public string LU { get; set; }
/// <summary>
/// 物料描述
/// </summary>
public string MaterialDesc { get; set; }
/// <summary> /// <summary>
/// 生产号 /// 生产号
/// </summary> /// </summary>
@ -124,6 +132,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ExporterHeader(DisplayName = "LU")] [ExporterHeader(DisplayName = "LU")]
public string LU { get; set; } public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { get; set; }
[ExporterHeader(DisplayName = "生产码")] [ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; } public string PN { get; set; }
public string KeyCode { get; set; } public string KeyCode { get; set; }

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs

@ -99,6 +99,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string InvGroupNum { get; set; } public string InvGroupNum { get; set; }
[ExporterHeader(DisplayName = "LU")] [ExporterHeader(DisplayName = "LU")]
public string LU { get; set; } public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { get; set; }
[ExporterHeader(DisplayName = "生产码")] [ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; } public string PN { get; set; }

262
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs

@ -0,0 +1,262 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
namespace SettleAccount.Domain.BQ
{
public class BBAC_PD_DTO : EntityDto<Guid>
{
/// <summary>
///期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
/// <summary>
///结算单据
/// </summary>
[Display(Name = "发票分组号")]
public string BillNum { get; set; }
/// <summary>
///关联结算单号
/// </summary>
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; }
/// <summary>
///发票分组号
/// </summary>
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///地点
/// </summary>
[Display(Name = "地点")]
public string Site { get; set; }
}
public class BBAC_PD_EXPORT
{
/// <summary>
///期间
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public int Version { get; set; }
/// <summary>
///结算单据
/// </summary>
[ExporterHeader(DisplayName = "结算单据")]
public string BillNum { get; set; }
/// <summary>
///关联结算单号
/// </summary>
[ExporterHeader(DisplayName = "关联结算单号")]
public string SettleBillNum { get; set; }
/// <summary>
///发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///地点
/// </summary>
[ExporterHeader(DisplayName = "地点")]
public string Site { get; set; }
}
public class BBAC_PD_REQ_DTO : RequestInputBase
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "结算单据")]
public string BillNum { get; set; }
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; }
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
[Display(Name = "地点")]
public string Site { get; set; }
}
public class BBAC_PD_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
///工厂地点
/// </summary>
[Display(Name = "工厂地点")]
public string Site { get; set; }
/// <summary>
/// 版本
/// </summary>
public int Version { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
public string BillNum { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
public string InvGroupNum { get; set; }
/// <summary>
/// 下线日期
/// </summary>
public DateTime SettleDate { get; set; }
/// <summary>
/// 结算分组号
/// </summary>
public string GroupNum { get; set; }
/// <summary>
/// 零件LU
/// </summary>
public string LU { get; set; }
/// <summary>
/// 生产码
/// </summary>
public string PN { get; set; }
/// <summary>
/// 替换零件号
/// </summary>
public string RELU { get; set; }
/// <summary>
/// 替换生产码
/// </summary>
public string REPN { get; set; }
/// <summary>
/// 键值
/// </summary>
public string KeyCode { get; set; }
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { get; set; }
/// <summary>
/// 扩展字段2
/// </summary>
public string Extend2 { get; set; }
/// <summary>
/// 扩展字段3
/// </summary>
public string Extend3 { get; set; }
/// <summary>
/// 扩展字段4
/// </summary>
public string Extend4 { get; set; }
}
public class BBAC_PD_DETAIL_EXP_DTO
{
/// <summary>
///工厂地点
/// </summary>
[ExporterHeader(DisplayName = "工厂地点")]
public string Site { get; set; }
/// <summary>
/// 版本
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public int Version { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string BillNum { get; set; }
/// <summary>
/// 数量
/// </summary>
[ExporterHeader(DisplayName = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 价格
/// </summary>
[ExporterHeader(DisplayName = "单价")]
public decimal Price { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
/// 下线日期
/// </summary>
[ExporterHeader(DisplayName = "下线日期")]
public DateTime SettleDate { get; set; }
/// <summary>
/// 结算分组号
/// </summary>
[ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; }
/// <summary>
/// 零件LU
/// </summary>
[ExporterHeader(DisplayName = "LU")]
public string LU { get; set; }
/// <summary>
/// 生产码
/// </summary>
[ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; }
/// <summary>
/// 替换零件号
/// </summary>
[ExporterHeader(DisplayName = "替换LU")]
public string RELU { get; set; }
/// <summary>
/// 替换生产码
/// </summary>
[ExporterHeader(DisplayName = "替换生产码")]
public string REPN { get; set; }
/// <summary>
/// 键值
/// </summary>
//public string KeyCode { get; set; }
///// <summary>
///// 扩展字段1
///// </summary>
//public string Extend1 { get; set; }
///// <summary>
///// 扩展字段2
///// </summary>
//public string Extend2 { get; set; }
///// <summary>
///// 扩展字段3
///// </summary>
//public string Extend3 { get; set; }
///// <summary>
///// 扩展字段4
///// </summary>
//public string Extend4 { get; set; }
}
public class BBAC_PD_DETAIL_REQ_DTO : RequestInputBase
{
/// <summary>
/// 发票分组号
/// </summary>
public string BillNum { get; set; }
}
}
}

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs

@ -33,6 +33,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "零件号")]
public string LU { get; set; } public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { get; set; }
/// <summary> /// <summary>
/// 生产号 /// 生产号

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs

@ -34,6 +34,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "生产码")] [Display(Name = "生产码")]
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 日顺序号 /// 日顺序号
/// </summary> /// </summary>

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

@ -74,6 +74,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 零件号 /// 零件号
/// </summary> /// </summary>
public string LU { get; set; } public string LU { get; set; }
public string MaterialDesc { get; set; }
/// <summary> /// <summary>
/// 生产号 /// 生产号
/// </summary> /// </summary>
@ -124,6 +129,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ExporterHeader(DisplayName = "LU")] [ExporterHeader(DisplayName = "LU")]
public string LU { get; set; } public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { get; set; }
[ExporterHeader(DisplayName = "生产码")] [ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; } public string PN { get; set; }
public string KeyCode { get; set; } public string KeyCode { get; set; }

7
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs

@ -48,6 +48,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary> /// </summary>
public string LU { get; set; } public string LU { get; set; }
/// <summary> /// <summary>
/// 物料描述
/// </summary>
public string MaterialDesc { get; set; }
/// <summary>
/// 生产号 /// 生产号
/// </summary> /// </summary>
public string PN { get; set; } public string PN { get; set; }
@ -97,6 +101,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ExporterHeader(DisplayName = "LU")] [ExporterHeader(DisplayName = "LU")]
public string LU { get; set; } public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { get; set; }
[ExporterHeader(DisplayName = "生产码")] [ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; } public string PN { get; set; }
public string KeyCode { get; set; } public string KeyCode { get; set; }

263
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs

@ -0,0 +1,263 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Bases;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
public class HBPO_PD_DTO : EntityDto<Guid>
{
/// <summary>
///期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
/// <summary>
///结算单据
/// </summary>
[Display(Name = "发票分组号")]
public string BillNum { get; set; }
/// <summary>
///关联结算单号
/// </summary>
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; }
/// <summary>
///发票分组号
/// </summary>
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///地点
/// </summary>
[Display(Name = "地点")]
public string Site { get; set; }
}
public class HBPO_PD_EXPORT
{
/// <summary>
///期间
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public int Version { get; set; }
/// <summary>
///结算单据
/// </summary>
[ExporterHeader(DisplayName = "结算单据")]
public string BillNum { get; set; }
/// <summary>
///关联结算单号
/// </summary>
[ExporterHeader(DisplayName = "关联结算单号")]
public string SettleBillNum { get; set; }
/// <summary>
///发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///地点
/// </summary>
[ExporterHeader(DisplayName = "地点")]
public string Site { get; set; }
}
public class HBPO_PD_REQ_DTO : RequestInputBase
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "结算单据")]
public string BillNum { get; set; }
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; }
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
[Display(Name = "地点")]
public string Site { get; set; }
}
public class HBPO_PD_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
///工厂地点
/// </summary>
[Display(Name = "工厂地点")]
public string Site { get; set; }
/// <summary>
/// 版本
/// </summary>
public int Version { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
public string BillNum { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
public string InvGroupNum { get; set; }
/// <summary>
/// 下线日期
/// </summary>
public DateTime SettleDate { get; set; }
/// <summary>
/// 结算分组号
/// </summary>
public string GroupNum { get; set; }
/// <summary>
/// 零件LU
/// </summary>
public string LU { get; set; }
/// <summary>
/// 物料描述
/// </summary>
public string MaterialDesc { get; set; }
/// <summary>
/// 生产码
/// </summary>
public string PN { get; set; }
/// <summary>
/// 替换零件号
/// </summary>
public string RELU { get; set; }
/// <summary>
/// 替换生产码
/// </summary>
public string REPN { get; set; }
/// <summary>
/// 键值
/// </summary>
public string KeyCode { get; set; }
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { get; set; }
/// <summary>
/// 扩展字段2
/// </summary>
public string Extend2 { get; set; }
/// <summary>
/// 扩展字段3
/// </summary>
public string Extend3 { get; set; }
/// <summary>
/// 扩展字段4
/// </summary>
public string Extend4 { get; set; }
}
public class HBPO_PD_DETAIL_EXP_DTO
{
/// <summary>
///工厂地点
/// </summary>
[ExporterHeader(DisplayName = "工厂地点")]
public string Site { get; set; }
/// <summary>
/// 版本
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public int Version { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string BillNum { get; set; }
/// <summary>
/// 数量
/// </summary>
[ExporterHeader(DisplayName = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 价格
/// </summary>
[ExporterHeader(DisplayName = "单价")]
public decimal Price { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
/// 下线日期
/// </summary>
[ExporterHeader(DisplayName = "下线日期")]
public DateTime SettleDate { get; set; }
/// <summary>
/// 结算分组号
/// </summary>
[ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; }
/// <summary>
/// 零件LU
/// </summary>
[ExporterHeader(DisplayName = "LU")]
public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc{ get; set; }
/// <summary>
/// 生产码
/// </summary>
[ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; }
/// <summary>
/// 替换零件号
/// </summary>
[ExporterHeader(DisplayName = "替换LU")]
public string RELU { get; set; }
/// <summary>
/// 替换生产码
/// </summary>
[ExporterHeader(DisplayName = "替换生产码")]
public string REPN { get; set; }
/// <summary>
/// 键值
/// </summary>
//public string KeyCode { get; set; }
///// <summary>
///// 扩展字段1
///// </summary>
//public string Extend1 { get; set; }
///// <summary>
///// 扩展字段2
///// </summary>
//public string Extend2 { get; set; }
///// <summary>
///// 扩展字段3
///// </summary>
//public string Extend3 { get; set; }
///// <summary>
///// 扩展字段4
///// </summary>
//public string Extend4 { get; set; }
}
public class HBPO_PD_DETAIL_REQ_DTO : RequestInputBase
{
/// <summary>
/// 发票分组号
/// </summary>
public string BillNum { get; set; }
}
}

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

@ -94,7 +94,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string InvGroupNum { get; set; } public string InvGroupNum { get; set; }
[Display(Name = "发票分组号")] [Display(Name = "发票分组号")]
public string LU { get; set; } public string LU { get; set; }
[Display(Name = "发货单号、交付识别号")] [Display(Name = "")]
public string PN { get; set; } public string PN { get; set; }
[Display(Name = "键值")] [Display(Name = "键值")]
public string KeyCode { get; set; } public string KeyCode { get; set; }

264
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs

@ -0,0 +1,264 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Bases;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
public class PUB_PD_DTO : EntityDto<Guid>
{
/// <summary>
///期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
/// <summary>
///结算单据
/// </summary>
[Display(Name = "发票分组号")]
public string BillNum { get; set; }
/// <summary>
///关联结算单号
/// </summary>
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; }
/// <summary>
///发票分组号
/// </summary>
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///地点
/// </summary>
[Display(Name = "地点")]
public string Site { get; set; }
[Display(Name = "业务类型")]
public EnumBusinessType BusinessType { get; set; }
}
public class PUB_PD_EXPORT
{
/// <summary>
///期间
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public int Version { get; set; }
/// <summary>
///结算单据
/// </summary>
[ExporterHeader(DisplayName = "结算单据")]
public string BillNum { get; set; }
/// <summary>
///关联结算单号
/// </summary>
[ExporterHeader(DisplayName = "关联结算单号")]
public string SettleBillNum { get; set; }
/// <summary>
///发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///地点
/// </summary>
[ExporterHeader(DisplayName = "地点")]
public string Site { get; set; }
}
public class PUB_PD_REQ_DTO : RequestInputBase
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "结算单据")]
public string BillNum { get; set; }
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; }
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
[Display(Name = "地点")]
public string Site { get; set; }
[Display(Name = "业务类型")]
public EnumBusinessType BusinessType { get; set; }
}
public class PUB_PD_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
///工厂地点
/// </summary>
[Display(Name = "工厂地点")]
public string Site { get; set; }
/// <summary>
/// 版本
/// </summary>
public int Version { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
public string BillNum { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
public string InvGroupNum { get; set; }
/// <summary>
/// 下线日期
/// </summary>
public DateTime SettleDate { get; set; }
/// <summary>
/// 结算分组号
/// </summary>
public string GroupNum { get; set; }
/// <summary>
/// 零件LU
/// </summary>
public string LU { get; set; }
/// <summary>
/// 生产码
/// </summary>
public string PN { get; set; }
/// <summary>
/// 替换零件号
/// </summary>
public string RELU { get; set; }
/// <summary>
/// 替换生产码
/// </summary>
public string REPN { get; set; }
/// <summary>
/// 键值
/// </summary>
public string KeyCode { get; set; }
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { get; set; }
/// <summary>
/// 扩展字段2
/// </summary>
public string Extend2 { get; set; }
/// <summary>
/// 扩展字段3
/// </summary>
public string Extend3 { get; set; }
/// <summary>
/// 扩展字段4
/// </summary>
public string Extend4 { get; set; }
}
public class PUB_PD_DETAIL_EXP_DTO
{
/// <summary>
///工厂地点
/// </summary>
[ExporterHeader(DisplayName = "工厂地点")]
public string Site { get; set; }
/// <summary>
/// 版本
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public int Version { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string BillNum { get; set; }
/// <summary>
/// 数量
/// </summary>
[ExporterHeader(DisplayName = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 价格
/// </summary>
[ExporterHeader(DisplayName = "单价")]
public decimal Price { get; set; }
/// <summary>
/// 发票分组号
/// </summary>
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
/// 下线日期
/// </summary>
[ExporterHeader(DisplayName = "下线日期")]
public DateTime SettleDate { get; set; }
/// <summary>
/// 结算分组号
/// </summary>
[ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; }
/// <summary>
/// 零件LU
/// </summary>
[ExporterHeader(DisplayName = "LU")]
public string LU { get; set; }
/// <summary>
/// 生产码
/// </summary>
[ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; }
/// <summary>
/// 替换零件号
/// </summary>
[ExporterHeader(DisplayName = "替换LU")]
public string RELU { get; set; }
/// <summary>
/// 替换生产码
/// </summary>
[ExporterHeader(DisplayName = "替换生产码")]
public string REPN { get; set; }
/// <summary>
/// 键值
/// </summary>
//public string KeyCode { get; set; }
///// <summary>
///// 扩展字段1
///// </summary>
//public string Extend1 { get; set; }
///// <summary>
///// 扩展字段2
///// </summary>
//public string Extend2 { get; set; }
///// <summary>
///// 扩展字段3
///// </summary>
//public string Extend3 { get; set; }
///// <summary>
///// 扩展字段4
///// </summary>
//public string Extend4 { get; set; }
}
public class PUB_PD_DETAIL_REQ_DTO : RequestInputBase
{
/// <summary>
/// 发票分组号
/// </summary>
public string BillNum { get; set; }
}
}

1
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs

@ -54,7 +54,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary> /// </summary>
[Display(Name = "结算日期")] [Display(Name = "结算日期")]
[ImporterHeader(Name = "Pstng Date")] [ImporterHeader(Name = "Pstng Date")]
[Required(ErrorMessage = "{0}不能为空")]
public DateTime SettleDate { set; get; } public DateTime SettleDate { set; get; }
/// <summary> /// <summary>

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

@ -85,10 +85,8 @@ namespace Win.Sfs.SettleAccount.Bases
{ {
IExporter _csv = new CsvExporter(); IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter(); IExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); 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 dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities);
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name; var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null; byte[] result = null;

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

@ -1,12 +1,137 @@
using System; using AutoMapper;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Bases;
using Shouldly;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Bases namespace Win.Sfs.SettleAccount.Bases
{ {
internal class PD_SERVICE public class PD_SERVICE<TEntity, TEntityDto, TEntityDetail, TEntityDetailDto, TRequestMainInput, TRequestDetailInput, TEntityDetailExportDto> : ApplicationService
where TEntity : PD_BASE_MAIN
where TEntityDetail : PD_BASE
where TEntityDto : class, IEntityDto<Guid>, new()
where TEntityDetailDto : class, IEntityDto<Guid>, new()
where TRequestMainInput : RequestInputBase
where TRequestDetailInput : RequestInputBase
where TEntityDetailExportDto : class, new()
{ {
private readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected PD_SERVICE(
INormalEfCoreRepository<TEntity, Guid> repository,
IExcelImportAppService excelImportService,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_excelImportService = excelImportService;
_repository = repository;
_detailRepository = detailRepository;
}
[HttpPost]
//[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);
}
[HttpPost]
//[Route("export")]
public virtual async Task<string> ExportAsync(TRequestDetailInput input)
{
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;
switch (input.FileType)
{
case 0:
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
[HttpPost]
//[Route("generateinvoice")]
public virtual async Task<string> ApprovalPassed(TRequestMainInput input)
{
return ApplicationConsts.SuccessStr;
}
[HttpPost]
//[Route("mainquery")]
public virtual async Task<PagedResultDto<TEntityDto>> MainQueryAsync(TRequestMainInput input)
{
var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<TEntity>, List<TEntityDto>>(entitys);
return new PagedResultDto<TEntityDto>(totalCount, dtos);
}
[HttpPost]
public virtual async Task<string> RejectAsync(TRequestMainInput input)
{
return ApplicationConsts.SuccessStr;
}
} }
} }

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

@ -1,17 +1,27 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using SettleAccount.Domain.BQ;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/bbac_pd_service")] [Route("api/settleaccount/bbac_pd_service")]
public class BBAC_PD_SERVICE : ApplicationService public class BBAC_PD_SERVICE : PD_SERVICE<BBAC_PD, BBAC_PD_DTO,
BBAC_PD_DETAIL, BBAC_PD_DETAIL_DTO, BBAC_PD_REQ_DTO,
BBAC_PD_DETAIL_REQ_DTO, BBAC_PD_DETAIL_EXP_DTO>
{ {
protected BBAC_PD_SERVICE(INormalEfCoreRepository<BBAC_PD, Guid> repository, IExcelImportAppService excelImportService, INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> detailRepository) : base(repository, excelImportService, detailRepository)
{
}
} }
} }

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

@ -1,17 +1,28 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using SettleAccount.Domain.BQ;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/hbpo_pd_service")] [Route("api/settleaccount/hbpo_pd_service")]
public class HBPO_PD_SERVICE : ApplicationService public class HBPO_PD_SERVICE : PD_SERVICE<HBPO_PD, HBPO_PD_DTO,
HBPO_PD_DETAIL, HBPO_PD_DETAIL_DTO, HBPO_PD_REQ_DTO,
HBPO_PD_DETAIL_REQ_DTO, HBPO_PD_DETAIL_EXP_DTO>
{ {
protected HBPO_PD_SERVICE(INormalEfCoreRepository<HBPO_PD, Guid> repository, IExcelImportAppService excelImportService, INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> detailRepository) : base(repository, excelImportService, detailRepository)
{
}
} }
} }

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

@ -64,8 +64,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
[HttpPost] [HttpPost]
public virtual async Task<string> ApprovalPassed(INVOICE_GRP_REQ_DTO input) public virtual async Task<string> ApprovalPassed(INVOICE_GRP_REQ_DTO input)
{ {
return string.Empty;
return string.Empty;
} }
[HttpPost] [HttpPost]

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

@ -1,17 +1,28 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using SettleAccount.Domain.BQ;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/pub_pd_service")] [Route("api/settleaccount/pub_pd_service")]
public class PUB_PD_SERVICE : ApplicationService public class PUB_PD_SERVICE : PD_SERVICE<PUB_PD, PUB_PD_DTO,
PUB_PD_DETAIL, PUB_PD_DETAIL_DTO, PUB_PD_REQ_DTO,
PUB_PD_DETAIL_REQ_DTO, PUB_PD_DETAIL_EXP_DTO>
{ {
protected PUB_PD_SERVICE(INormalEfCoreRepository<PUB_PD, Guid> repository, IExcelImportAppService excelImportService, INormalEfCoreRepository<PUB_PD_DETAIL, Guid> detailRepository) : base(repository, excelImportService, detailRepository)
{
}
} }
} }

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

@ -80,10 +80,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary> /// </summary>
public PUB_SA_SERVICE(INormalEfCoreRepository<PUB_SA, Guid> repository, public PUB_SA_SERVICE(INormalEfCoreRepository<PUB_SA, Guid> repository,
INormalEfCoreRepository<PUB_SA_DETAIL, Guid> pubSaDetailRepository, INormalEfCoreRepository<PUB_SA_DETAIL, Guid> pubSaDetailRepository,
INormalEfCoreRepository<PriceList, Guid> priceListRepository,
INormalEfCoreRepository<PUB_CAN_SA, Guid> pubCanSaRepository, INormalEfCoreRepository<PUB_CAN_SA, Guid> pubCanSaRepository,
INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> pubCanSaDetailRepository, INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> pubCanSaDetailRepository,
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> pubNotSaDetailRepository, INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> pubNotSaDetailRepository,
INormalEfCoreRepository<PriceList, Guid> priceListRepository,
INormalEfCoreRepository<MaterialRelationship, Guid> materialRelationshipRepository,
INormalEfCoreRepository<TB_RePartsRelationship, Guid> tbRePartsRelationshipRepository,
IDistributedCache<PUB_SA> cache, IDistributedCache<PUB_SA> cache,
IExcelImportAppService excelImportService, IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
@ -96,6 +98,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_pubCanSaDetailRepository = pubCanSaDetailRepository; _pubCanSaDetailRepository = pubCanSaDetailRepository;
_pubNotSaDetailRepository = pubNotSaDetailRepository; _pubNotSaDetailRepository = pubNotSaDetailRepository;
_priceListRepository = priceListRepository; _priceListRepository = priceListRepository;
_materialRelationshipRepository = materialRelationshipRepository;
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
} }
#region 直供件 #region 直供件
@ -137,6 +141,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var pubCanSaDetails = new List<PUB_CAN_SA_DETAIL>(); var pubCanSaDetails = new List<PUB_CAN_SA_DETAIL>();
//不可结算明细 //不可结算明细
var pubNotSaDetails = new List<PUB_NOT_SA_DETAIL>(); var pubNotSaDetails = new List<PUB_NOT_SA_DETAIL>();
//客户零件关系
var materialRelationships = new List<MaterialRelationship>();
#region 导入数据转换、数据校验 #region 导入数据转换、数据校验
@ -189,10 +195,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
importPubSaDetail.Price = priceListEntity?.Price ?? 0; importPubSaDetail.Price = priceListEntity?.Price ?? 0;
}); });
////导入的零件号集合 //导入的零件号集合
//var importPubSaLUs = importPubSaDetails.Select(t => t.LU).Distinct(); var importPubSaLUs = importPubSaDetails.Select(t => t.LU).Distinct();
//_materialRelationshipRepository.GetListAsync(t => t.) var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode));
var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
/*
* ()
*
* 6-
*/
var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
noExistSettleMaterialCodes.ForEach(t =>
{
var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t);
materialRelationships.Add(materialRelationship);
});
#endregion #endregion
@ -211,7 +230,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
pubNotSaDetails = ObjectMapper.Map<List<PUB_SA_DETAIL>, List<PUB_NOT_SA_DETAIL>>(pubSaDetailsNotCanSes); pubNotSaDetails = ObjectMapper.Map<List<PUB_SA_DETAIL>, List<PUB_NOT_SA_DETAIL>>(pubSaDetailsNotCanSes);
#endregion #endregion
#region 添加入库 #region 添加入库
await _repository.InsertAsync(pubSa); await _repository.InsertAsync(pubSa);
await _pubSaDetailRepository.InsertManyAsync(importPubSaDetails); await _pubSaDetailRepository.InsertManyAsync(importPubSaDetails);
@ -237,6 +255,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails); await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails);
} }
if (materialRelationships.Count > 0)
{
await _materialRelationshipRepository.InsertManyAsync(materialRelationships);
}
#endregion #endregion
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs

@ -73,6 +73,10 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty)); checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
} }
} }
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
foreach (var itm in _ls) foreach (var itm in _ls)
{ {
var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode); var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode);
@ -86,10 +90,6 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
await _repository.InsertAsync(itm); await _repository.InsertAsync(itm);
} }
} }
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;
} }

12
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs

@ -52,7 +52,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList();
foreach(TEntity p_entiy in ls) foreach (TEntity p_entiy in ls)
{ {
switch (p_entiy.State) switch (p_entiy.State)
@ -109,15 +109,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
public virtual async Task<bool> SetNewState(TEntity p_entiy) public virtual async Task<bool> SetNewState(TEntity p_entiy)
{ {
p_entiy.State = SettleBillState.; await SetNewState(p_entiy.BillNum);
await _repository.UpdateAsync(p_entiy);
return true; return await SetNewState(p_entiy.BillNum);
} }
public virtual async Task<bool> SetNewState(string billNUm) public virtual async Task<bool> SetNewState(string billNUm)
{ {
var ls=_repository.Where(p => p.InvGroupNum == billNUm).ToList(); var ls = _repository.Where(p => p.InvGroupNum == billNUm).ToList();
foreach (var l in ls) foreach (var l in ls)
{ {
l.State = SettleBillState.; l.State = SettleBillState.;
@ -127,8 +127,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return true; return true;
} }
} }
} }

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs

@ -96,5 +96,12 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
ShipMaterailCode = shipMaterailCode; ShipMaterailCode = shipMaterailCode;
AppraisalCategory = appraisalCategory; AppraisalCategory = appraisalCategory;
} }
public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode) : base(id)
{
ErpMaterialCode = erpMaterialCode;
MaterialDesc = materialDesc;
SettleMaterialCode = settlMaterialCode;
}
} }
} }

9
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -280,19 +280,10 @@ namespace Win.Sfs.SettleAccount
{ {
b.ToTable($"{options.TablePrefix}_relationship", options.Schema); b.ToTable($"{options.TablePrefix}_relationship", options.Schema);
b.ConfigureByConvention(); b.ConfigureByConvention();
//b.Property(x => x.SettleMaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.MaterialProperty).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.ShipMaterailCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.ErpMaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); b.Property(x => x.ErpMaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.ErpMaterialCode }); b.HasIndex(x => new { x.ErpMaterialCode });
b.HasIndex(x => new { x.ErpMaterialCode }).IsUnique().HasFilter(IsDeletedFilter); b.HasIndex(x => new { x.ErpMaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
}); });
} }

4023
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718010724_20230718-1.Designer.cs

File diff suppressed because it is too large

163
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718010724_20230718-1.cs

@ -0,0 +1,163 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202307181 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Site",
table: "Set_BBAC_CAN_SA");
migrationBuilder.AlterColumn<string>(
name: "MaterialProperty",
table: "Set_relationship",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36);
migrationBuilder.AddColumn<string>(
name: "Extend1",
table: "Set_PUB_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend2",
table: "Set_PUB_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend3",
table: "Set_PUB_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend4",
table: "Set_PUB_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend1",
table: "Set_HBPO_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend2",
table: "Set_HBPO_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend3",
table: "Set_HBPO_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend4",
table: "Set_HBPO_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend1",
table: "Set_BBAC_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend2",
table: "Set_BBAC_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend3",
table: "Set_BBAC_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend4",
table: "Set_BBAC_PD_DETAIL",
type: "nvarchar(max)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Extend1",
table: "Set_PUB_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend2",
table: "Set_PUB_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend3",
table: "Set_PUB_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend4",
table: "Set_PUB_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend1",
table: "Set_HBPO_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend2",
table: "Set_HBPO_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend3",
table: "Set_HBPO_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend4",
table: "Set_HBPO_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend1",
table: "Set_BBAC_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend2",
table: "Set_BBAC_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend3",
table: "Set_BBAC_PD_DETAIL");
migrationBuilder.DropColumn(
name: "Extend4",
table: "Set_BBAC_PD_DETAIL");
migrationBuilder.AlterColumn<string>(
name: "MaterialProperty",
table: "Set_relationship",
type: "nvarchar(36)",
maxLength: 36,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "Site",
table: "Set_BBAC_CAN_SA",
type: "nvarchar(max)",
nullable: true);
}
}
}

4023
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718011250_20230718-2.Designer.cs

File diff suppressed because it is too large

17
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718011250_20230718-2.cs

@ -0,0 +1,17 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202307182 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

43
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -79,9 +79,6 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("Site")
.HasColumnType("nvarchar(max)");
b.Property<int>("State") b.Property<int>("State")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("int"); .HasColumnType("int");
@ -328,6 +325,18 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<string>("Extend1")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend2")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend3")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend4")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)") .HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties");
@ -1258,6 +1267,18 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<string>("Extend1")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend2")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend3")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend4")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)") .HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties");
@ -2668,6 +2689,18 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<string>("Extend1")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend2")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend3")
.HasColumnType("nvarchar(max)");
b.Property<string>("Extend4")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)") .HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties");
@ -3963,9 +3996,7 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("MaterialProperty") b.Property<string>("MaterialProperty")
.IsRequired() .HasColumnType("nvarchar(max)");
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");

Loading…
Cancel
Save