Administrator 3 years ago
parent
commit
68b314317f
  1. 449
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs
  2. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-KanBan/WMSKanBanAppService.cs
  3. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-SparePart/WMSSparePartAppService.cs
  4. 10
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  5. 261
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-KanBan/WMSKanBanSettle.cs
  6. 371
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-SparePart/WMSSparePart.cs
  7. 62
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  8. 47
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs
  9. 35
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs

449
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs

@ -5303,6 +5303,92 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_PriceList");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListBJ", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("BeginDate")
.HasColumnType("datetime2");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid>("ParentId")
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<int>("Type")
.HasColumnType("int");
b.Property<string>("Version")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_PriceListBJ");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersion", b =>
{
b.Property<Guid>("Id")
@ -5379,6 +5465,82 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_PriceListVersion");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersionBJ", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("Factory")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Period")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Year")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.ToTable("Set_PriceListVersionBJ");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecMatch.SecMatchBase", b =>
{
b.Property<Guid>("Id")
@ -8487,6 +8649,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("OutPutQty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ParentMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
@ -8888,6 +9053,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("OutPutQty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ParentMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
@ -8923,7 +9091,7 @@ namespace Win.Sfs.SettleAccount.Migrations
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_WmsHQMSharePartOutPutDetial");
b.ToTable("Set_WmsHQHSharePartOutPutDetial");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanOutPut", b =>
@ -9200,6 +9368,132 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_WmsHQMSharePartOutPut");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartOutPutDetial", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend1")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Extend2")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("InPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("MaterialDesc")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialGroup")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderBillNum")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("OutPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("OutPutQty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ParentMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<decimal>("StockQty")
.HasColumnType("decimal(18,2)");
b.Property<Guid>("TaskId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("WmsBillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("Set_WmsHQMSharePartOutPutDetial");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPut", b =>
{
b.Property<Guid>("Id")
@ -9803,10 +10097,6 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Batch")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
@ -9838,21 +10128,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("Factory")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Flag")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
@ -9877,19 +10156,10 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<Guid>("ParentId")
.HasColumnType("uniqueidentifier");
b.Property<string>("PartType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Period")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Relation")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@ -9897,27 +10167,11 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("SettleDate")
.HasColumnType("datetime2");
b.Property<DateTime>("SettleInputDate")
.HasColumnType("datetime2");
b.Property<string>("State")
.HasColumnType("nvarchar(max)");
b.Property<string>("SupplierCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Version")
.HasColumnType("nvarchar(450)");
b.Property<string>("WMSActualGoodsDate")
.HasColumnType("nvarchar(max)");
b.Property<string>("WMSDeliverGoodsState")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("WMSActualGoodsDate")
.HasColumnType("datetime2");
b.Property<string>("WMSDeliveryNote")
.HasColumnType("nvarchar(max)");
@ -9925,18 +10179,8 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<decimal>("WMSDeliveryQty")
.HasColumnType("decimal(18,2)");
b.Property<string>("WMSKanBanState")
.HasColumnType("nvarchar(max)");
b.Property<string>("Year")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Version", "Kanban", "MaterialCode")
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_WMSKanBanSettle");
});
@ -10029,17 +10273,6 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("AccountNum")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<decimal>("AmountNoTax")
.HasColumnType("decimal(18,2)");
b.Property<string>("BatchNo")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
@ -10065,41 +10298,13 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("DeliveryLineNum")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DeliveryOrderNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend")
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("Factory")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("FactoryName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("GermanInvoiceNo")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<decimal>("InvoicedQty")
.HasColumnType("decimal(18,2)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
@ -10114,9 +10319,8 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("LineNumber")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("MainFactory")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialCode")
.IsRequired()
@ -10124,32 +10328,14 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(150)");
b.Property<string>("MaterialDesc")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("Period")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("MaterialGroup")
.HasColumnType("nvarchar(max)");
b.Property<string>("PurchaseOrderNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("PurchaseOrderNoItem")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("PurchaseOrderNoText")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<decimal>("PurchasePriceNoTax")
.HasColumnType("decimal(18,2)");
b.Property<string>("PurchaseType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("nvarchar(max)");
b.Property<decimal>("ReceiptQty")
.HasColumnType("decimal(18,2)");
@ -10157,42 +10343,21 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("SpareDate")
.HasColumnType("datetime2");
b.Property<string>("TaxCode")
b.Property<string>("SapCode")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("TaxRate")
.HasColumnType("decimal(18,2)");
b.Property<string>("Unit")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("SpareDate")
.HasColumnType("datetime2");
b.Property<string>("Version")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("WMSDeliverGoodsState")
.HasColumnType("nvarchar(max)");
b.Property<string>("WMSDeliveryNote")
.HasColumnType("nvarchar(max)");
b.Property<string>("WMSSparePartState")
.HasColumnType("nvarchar(max)");
b.Property<string>("Year")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.HasKey("Id");
b.HasIndex("Version", "PurchaseOrderNo", "MaterialCode")
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_WMSSparePart");
});

3
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-KanBan/WMSKanBanAppService.cs

@ -104,7 +104,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan
_bomList.Add(new WMSKanBanVersion(_id, branchId, year, period, version, customerCode));
foreach (var itm in entityList)
{
itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id);
//itm.SetValue(GuidGenerator.Create(), year, period, version);
itm.SetValue(GuidGenerator.Create(), version);
}
if (checkList.Count > 0)
{

4
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-SparePart/WMSSparePartAppService.cs

@ -91,12 +91,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart
await _query.BatchDeleteAsync();
//插入数据前检验
var checkList = new List<ErrorExportDto>();
var _group = entityList.GroupBy(x => new { x.LineNumber, x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), LineNumber = p.Key.LineNumber, MaterialCode = p.Key.MaterialCode });
var _group = entityList.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode });
foreach (var itm in _group)
{
if (string.IsNullOrEmpty(itm.MaterialCode))
{
checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的行号为{0}的物料代码为空,请检查!", itm.LineNumber), string.Empty));
checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的行号为{0}的物料代码为空,请检查!", itm.MaterialCode), string.Empty));
}
}
var _id = GuidGenerator.Create();

10
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -385,11 +385,11 @@ namespace Win.Sfs.SettleAccount
{
CreateMap<WMSKanBanSettle, WMSVWKanBanDto>().ReverseMap();
CreateMap<WMSKanBanSettle, WMSVWKanBanRequestDto>().ReverseMap();
CreateMap<WMSVWKanBanImportDto, WMSKanBanSettle>()
.ForMember(dest => dest.SettleInputDate,
opt => opt.MapFrom(src => DateTime.ParseExact(src.SettleInputDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture)))
.ForMember(dest => dest.SettleDate,
opt => opt.MapFrom(src => DateTime.ParseExact(src.SettleDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture)));
//CreateMap<WMSVWKanBanImportDto, WMSKanBanSettle>()
// .ForMember(dest => dest.SettleInputDate,
// opt => opt.MapFrom(src => DateTime.ParseExact(src.SettleInputDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture)))
// .ForMember(dest => dest.SettleDate,
// opt => opt.MapFrom(src => DateTime.ParseExact(src.SettleDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture)));
CreateMap<WMSKanBanSettle, WMSVWKanBanExportDto>().ReverseMap();
}

261
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-KanBan/WMSKanBanSettle.cs

@ -9,16 +9,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan
{
public class WMSKanBanSettle : FullAuditedAggregateRootBase<Guid>, ISettleAccountEntityBase
{
/// <summary>
///年度
/// </summary>
public string Year { get; protected set; }
/// <summary>
/// 期间
/// </summary>
public string Period { set; get; }
public Guid Id { set; get; }
/// <summary>
/// 版本
/// </summary>
@ -34,10 +25,6 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan
public string Relation { set; get; }
/// <summary>
/// 工厂
/// </summary>
public string Factory { set; get; }
/// <summary>
/// 零件号
/// </summary>
public string MaterialCode { set; get; }
@ -45,41 +32,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan
/// 零件类型
/// </summary>
public string PartType { set; get; }
/// <summary>
/// 供应商编码
/// </summary>
public string SupplierCode { set; get; }
/// <summary>
/// R3入库时间
/// </summary>
public DateTime SettleInputDate { set; get; }
/// <summary>
/// 批次
/// </summary>
public string Batch { set; get; }
/// <summary>
/// 入库结算标识
/// </summary>
public string Flag { set; get; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { set; get; }
/// <summary>
/// R3结算时间
/// </summary>
public DateTime SettleDate { set; get; }
/// <summary>
/// 结算状态
/// </summary>
public string State { set; get; }
/// <summary>
/// WMS交货单
@ -89,85 +42,43 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan
/// <summary>
/// WMS实际发货日期
/// </summary>
public string WMSActualGoodsDate { set; get; }
public DateTime WMSActualGoodsDate { set; get; }
/// <summary>
/// WMS交货数量
/// </summary>
public decimal WMSDeliveryQty { set; get; }
/// <summary>
/// WMS发货状态
/// </summary>
public string WMSDeliverGoodsState { set; get; }
/// <summary>
/// 看板结算状态
/// </summary>
public string WMSKanBanState { set; get; }
/// <summary>
/// 出库单号
/// </summary>
public string DeliveryOrderNo { set; get; }
/// <summary>
/// 备注
/// </summary>
public string Extend { set; get; }
public Guid ParentId { get; protected set; }
public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId)
public void SetValue(Guid guid, string version)
{
Period = peroid;
Year = year;
Id = guid;
Version = version;
BranchId = branchId;
ParentId = parentId;
}
public WMSKanBanSettle()
{ }
public WMSKanBanSettle(
Guid id,
Guid branchId,
string year,
string version,
string kanban,
string relation,
string factory,
string materialCode,
string partType,
DateTime settleInputDate,
string supplierCode,
decimal qty,
string batch,
string flag,
DateTime settleDate,
string state,
Guid parentId,
//DateTime creationTime,
Guid guid) : base(id)
{
BranchId = branchId;
Year = year;
Version = version;
Kanban = kanban;
Relation = relation;
Factory = factory;
MaterialCode = materialCode;
PartType = partType;
SettleInputDate = settleInputDate;
SupplierCode = supplierCode;
Qty = qty;
Batch = batch;
Flag = flag;
SettleDate = settleDate;
State = state;
ParentId = parentId;
//CreationTime = creationTime;
CreatorId = guid;
}
@ -176,4 +87,168 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan
}
//public class WMSKanBanSettle : FullAuditedAggregateRootBase<Guid>, ISettleAccountEntityBase
//{
// /// <summary>
// ///年度
// /// </summary>
// public string Year { get; protected set; }
// /// <summary>
// /// 期间
// /// </summary>
// public string Period { set; get; }
// /// <summary>
// /// 版本
// /// </summary>
// public string Version { set; get; }
// /// <summary>
// /// 看板条码号
// /// </summary>
// public string Kanban { set; get; }
// /// <summary>
// /// 入库关联号
// /// </summary>
// public string Relation { set; get; }
// /// <summary>
// /// 工厂
// /// </summary>
// public string Factory { set; get; }
// /// <summary>
// /// 零件号
// /// </summary>
// public string MaterialCode { set; get; }
// /// <summary>
// /// 零件类型
// /// </summary>
// public string PartType { set; get; }
// /// <summary>
// /// 供应商编码
// /// </summary>
// public string SupplierCode { set; get; }
// /// <summary>
// /// R3入库时间
// /// </summary>
// public DateTime SettleInputDate { set; get; }
// /// <summary>
// /// 批次
// /// </summary>
// public string Batch { set; get; }
// /// <summary>
// /// 入库结算标识
// /// </summary>
// public string Flag { set; get; }
// /// <summary>
// /// 数量
// /// </summary>
// public decimal Qty { set; get; }
// /// <summary>
// /// R3结算时间
// /// </summary>
// public DateTime SettleDate { set; get; }
// /// <summary>
// /// 结算状态
// /// </summary>
// public string State { set; get; }
// /// <summary>
// /// WMS交货单
// /// </summary>
// public string WMSDeliveryNote { set; get; }
// /// <summary>
// /// WMS实际发货日期
// /// </summary>
// public string WMSActualGoodsDate { set; get; }
// /// <summary>
// /// WMS交货数量
// /// </summary>
// public decimal WMSDeliveryQty { set; get; }
// /// <summary>
// /// WMS发货状态
// /// </summary>
// public string WMSDeliverGoodsState { set; get; }
// /// <summary>
// /// 看板结算状态
// /// </summary>
// public string WMSKanBanState { set; get; }
// /// <summary>
// /// 出库单号
// /// </summary>
// public string DeliveryOrderNo { set; get; }
// /// <summary>
// /// 备注
// /// </summary>
// public string Extend { set; get; }
// public void SetValue(Guid guid, string year, string peroid, string version)
// {
// Period = peroid;
// Year = year;
// Id = guid;
// Version = version;
// }
// public WMSKanBanSettle()
// { }
// public WMSKanBanSettle(
// Guid id,
// Guid branchId,
// string year,
// string version,
// string kanban,
// string relation,
// string factory,
// string materialCode,
// string partType,
// DateTime settleInputDate,
// string supplierCode,
// decimal qty,
// string batch,
// string flag,
// DateTime settleDate,
// string state,
// //DateTime creationTime,
// Guid guid) : base(id)
// {
// BranchId = branchId;
// Year = year;
// Version = version;
// Kanban = kanban;
// Relation = relation;
// Factory = factory;
// MaterialCode = materialCode;
// PartType = partType;
// SettleInputDate = settleInputDate;
// SupplierCode = supplierCode;
// Qty = qty;
// Batch = batch;
// Flag = flag;
// SettleDate = settleDate;
// State = state;
// //CreationTime = creationTime;
// CreatorId = guid;
// }
//}
}

371
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-SparePart/WMSSparePart.cs

@ -15,8 +15,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart
public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version)
{
Period = peroid;
Year = year;
//Period = peroid;
//Year = year;
Id = guid;
Version = version;
BranchId = branchId;
@ -29,187 +29,280 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart
) : base(Id)
{
Year = year;
Period = period;
Version = version;
LineNumber = lineNumber;
PurchaseType = purchaseType;
PurchaseOrderNo = purchaseOrderNo;
PurchaseOrderNoItem = purchaseOrderNoItem;
PurchaseOrderNoText = purchaseOrderNoText;
ReceiptQty = receiptQty;
InvoicedQty = invoicedQty;
AmountNoTax = amountNoTax;
PurchasePriceNoTax = purchasePriceNoTax;
AccountNum = accountNum;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
SpareDate = spareDate;
DeliveryOrderNo = deliveryOrderNo;
DeliveryLineNum = deliveryLineNum;
BatchNo = batchNo;
Unit = unit;
TaxRate = taxRate;
TaxCode = taxCode;
Factory = factory;
}
//行号 采购类型 采购订单号 采购订单行项目 采购订单文本 收货数量 开票数量 不含税金额 采购价格不含税
//科目号 物料代码 物料描述 日期 交货单号 交货行号 批次号 单位 税率 税码
//德国发票号 AP_REQUISITION_MIMRS.GERMANY_INVOCE_AMOUNT 借贷 PO币种 工厂 工厂名称 BM 单号
/// <summary>
///年
/// </summary>
[Display(Name = "年")]
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
[Display(Name = "交货日期")]
public string Period { set; get; }
/// <summary>
/// 版本号
/// </summary>
[Display(Name = "版本号")]
public string Version { set; get; }
/// <summary>
/// 行号
/// </summary>
[Display(Name = "行号")]
public string LineNumber { set; get; }
/// <summary>
/// 采购类型
/// SAP物料号
/// </summary>
[Display(Name = "采购类型")]
public string PurchaseType { get; set; }
[Display(Name = "SAP物料号")]
public string SapCode { get; set; }
/// <summary>
/// 采购订单号
/// </summary>
[Display(Name = "采购订单号")]
public string PurchaseOrderNo { get; set; }
/// <summary>
/// 采购订单行项目
/// </summary>
[Display(Name = "采购订单行项目")]
public string PurchaseOrderNoItem { get; set; }
/// <summary>
/// 采购订单文本
/// </summary>
[Display(Name = "采购订单文本")]
public string PurchaseOrderNoText { get; set; }
/// <summary>
/// 收货数量
/// </summary>
[Display(Name = "发货数量")]
public decimal ReceiptQty { get; set; }
/// <summary>
/// 开票数量
/// 主机厂
/// </summary>
[Display(Name = "开票数量")]
public decimal InvoicedQty { get; set; }
/// <summary>
/// 不含税金额
/// </summary>
[Display(Name = "不含税金额")]
public decimal AmountNoTax { get; set; }
/// <summary>
/// 采购价格不含税
/// </summary>
[Display(Name = "采购价格不含税")]
public decimal PurchasePriceNoTax { get; set; }
[Display(Name = "主机厂")]
public string MainFactory { get; set; }
/// <summary>
/// 科目号
/// 车型
/// </summary>
[Display(Name = "科目号")]
public string AccountNum { get; set; }
[Display(Name = "车型")]
public string MaterialGroup { get; set; }
/// <summary>
/// 物料代码
/// 物料代码-零件号
/// </summary>
[Display(Name = "物料代码")]
public string MaterialCode { get; set; }
/// <summary>
/// 物料描述
/// 物料描述-存货名称
/// </summary>
[Display(Name = "物料描述")]
public string MaterialDesc { get; set; }
/// <summary>
/// 日期
/// </summary>
[Display(Name = "订单日期")]
public DateTime SpareDate { get; set; }
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
public string DeliveryOrderNo { get; set; }
/// <summary>
/// 交货行号
/// </summary>
[Display(Name = "交货行号")]
public string DeliveryLineNum { get; set; }
/// <summary>
/// 批次号
/// </summary>
[Display(Name = "批次号")]
public string BatchNo { get; set; }
/// <summary>
/// 单位
/// </summary>
[Display(Name = "单位")]
public string Unit { get; set; }
/// <summary>
/// 税率
/// </summary>
[Display(Name = "税率")]
public decimal TaxRate { get; set; }
/// <summary>
/// 税码
/// </summary>
[Display(Name = "税码")]
public string TaxCode { get; set; }
/// <summary>
/// 德国发票号
/// </summary>
[Display(Name = "德国发票号")]
public string GermanInvoiceNo { get; set; }
/// <summary>
/// 工厂
/// </summary>
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
/// 工厂名称
/// 发货数量
/// </summary>
[Display(Name = "工厂名称")]
public string FactoryName { get; set; }
[Display(Name = "发货数量")]
public decimal ReceiptQty { get; set; }
/// <summary>
/// 备注
/// 订单号
/// </summary>
[Display(Name = "备注")]
public string Extend { set; get; }
[Display(Name = "订单号")]
public string PurchaseOrderNo { get; set; }
/// <summary>
/// WMS采购订单号
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
public string WMSDeliveryNote { set; get; }
/// <summary>
/// WMS发货状态
/// 交货日期
/// </summary>
public string WMSDeliverGoodsState { set; get; }
[Display(Name = "交货日期")]
public DateTime SpareDate { get; set; }
/// <summary>
/// 看板结算状态
/// </summary>
public string WMSSparePartState { set; get; }
}
//public class WMSSparePart : FullAuditedAggregateRootBase<Guid>, ISettleAccountEntityBase
//{
// public WMSSparePart()
// { }
// public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version)
// {
// Period = peroid;
// Year = year;
// Id = guid;
// Version = version;
// BranchId = branchId;
// }
// public WMSSparePart(Guid Id, string year, string period, string version, string lineNumber,
// string purchaseType, string purchaseOrderNo, string purchaseOrderNoItem, string purchaseOrderNoText,
// decimal receiptQty, decimal invoicedQty, decimal amountNoTax, decimal purchasePriceNoTax,
// string accountNum, string materialCode, string materialDesc, DateTime spareDate, string deliveryOrderNo,
// string deliveryLineNum, string batchNo, string unit, decimal taxRate, string taxCode, string factory
}
// ) : base(Id)
// {
// Year = year;
// Period = period;
// Version = version;
// LineNumber = lineNumber;
// PurchaseType = purchaseType;
// PurchaseOrderNo = purchaseOrderNo;
// PurchaseOrderNoItem = purchaseOrderNoItem;
// PurchaseOrderNoText = purchaseOrderNoText;
// ReceiptQty = receiptQty;
// InvoicedQty = invoicedQty;
// AmountNoTax = amountNoTax;
// PurchasePriceNoTax = purchasePriceNoTax;
// AccountNum = accountNum;
// MaterialCode = materialCode;
// MaterialDesc = materialDesc;
// SpareDate = spareDate;
// DeliveryOrderNo = deliveryOrderNo;
// DeliveryLineNum = deliveryLineNum;
// BatchNo = batchNo;
// Unit = unit;
// TaxRate = taxRate;
// TaxCode = taxCode;
// Factory = factory;
// }
// //行号 采购类型 采购订单号 采购订单行项目 采购订单文本 收货数量 开票数量 不含税金额 采购价格不含税
// //科目号 物料代码 物料描述 日期 交货单号 交货行号 批次号 单位 税率 税码
// //德国发票号 AP_REQUISITION_MIMRS.GERMANY_INVOCE_AMOUNT 借贷 PO币种 工厂 工厂名称 BM 单号
// /// <summary>
// ///年
// /// </summary>
// [Display(Name = "年")]
// public string Year { get; set; }
// /// <summary>
// /// 期间
// /// </summary>
// [Display(Name = "交货日期")]
// public string Period { set; get; }
// /// <summary>
// /// 版本号
// /// </summary>
// [Display(Name = "版本号")]
// public string Version { set; get; }
// /// <summary>
// /// 行号
// /// </summary>
// [Display(Name = "行号")]
// public string LineNumber { set; get; }
// /// <summary>
// /// 采购类型
// /// </summary>
// [Display(Name = "采购类型")]
// public string PurchaseType { get; set; }
// /// <summary>
// /// 采购订单号
// /// </summary>
// [Display(Name = "采购订单号")]
// public string PurchaseOrderNo { get; set; }
// /// <summary>
// /// 采购订单行项目
// /// </summary>
// [Display(Name = "采购订单行项目")]
// public string PurchaseOrderNoItem { get; set; }
// /// <summary>
// /// 采购订单文本
// /// </summary>
// [Display(Name = "采购订单文本")]
// public string PurchaseOrderNoText { get; set; }
// /// <summary>
// /// 收货数量
// /// </summary>
// [Display(Name = "发货数量")]
// public decimal ReceiptQty { get; set; }
// /// <summary>
// /// 开票数量
// /// </summary>
// [Display(Name = "开票数量")]
// public decimal InvoicedQty { get; set; }
// /// <summary>
// /// 不含税金额
// /// </summary>
// [Display(Name = "不含税金额")]
// public decimal AmountNoTax { get; set; }
// /// <summary>
// /// 采购价格不含税
// /// </summary>
// [Display(Name = "采购价格不含税")]
// public decimal PurchasePriceNoTax { get; set; }
// /// <summary>
// /// 科目号
// /// </summary>
// [Display(Name = "科目号")]
// public string AccountNum { get; set; }
// /// <summary>
// /// 物料代码
// /// </summary>
// [Display(Name = "物料代码")]
// public string MaterialCode { get; set; }
// /// <summary>
// /// 物料描述
// /// </summary>
// [Display(Name = "物料描述")]
// public string MaterialDesc { get; set; }
// /// <summary>
// /// 日期
// /// </summary>
// [Display(Name = "订单日期")]
// public DateTime SpareDate { get; set; }
// /// <summary>
// /// 交货单号
// /// </summary>
// [Display(Name = "交货单号")]
// public string DeliveryOrderNo { get; set; }
// /// <summary>
// /// 交货行号
// /// </summary>
// [Display(Name = "交货行号")]
// public string DeliveryLineNum { get; set; }
// /// <summary>
// /// 批次号
// /// </summary>
// [Display(Name = "批次号")]
// public string BatchNo { get; set; }
// /// <summary>
// /// 单位
// /// </summary>
// [Display(Name = "单位")]
// public string Unit { get; set; }
// /// <summary>
// /// 税率
// /// </summary>
// [Display(Name = "税率")]
// public decimal TaxRate { get; set; }
// /// <summary>
// /// 税码
// /// </summary>
// [Display(Name = "税码")]
// public string TaxCode { get; set; }
// /// <summary>
// /// 德国发票号
// /// </summary>
// [Display(Name = "德国发票号")]
// public string GermanInvoiceNo { get; set; }
// /// <summary>
// /// 工厂
// /// </summary>
// [Display(Name = "工厂")]
// public string Factory { get; set; }
// /// <summary>
// /// 工厂名称
// /// </summary>
// [Display(Name = "工厂名称")]
// public string FactoryName { get; set; }
// /// <summary>
// /// 备注
// /// </summary>
// [Display(Name = "备注")]
// public string Extend { set; get; }
// /// <summary>
// /// WMS采购订单号
// /// </summary>
// public string WMSDeliveryNote { set; get; }
// /// <summary>
// /// WMS发货状态
// /// </summary>
// public string WMSDeliverGoodsState { set; get; }
// /// <summary>
// /// 看板结算状态
// /// </summary>
// public string WMSSparePartState { set; get; }
//}
}

62
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -866,37 +866,37 @@ namespace Win.Sfs.SettleAccount
b.ToTable($"{options.TablePrefix}_WMSSparePart", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Year).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Period).HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.Year).HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.Period).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.LineNumber).HasMaxLength(50);
b.Property(x => x.PurchaseType).HasMaxLength(50);
b.Property(x => x.PurchaseOrderNo).IsRequired().HasMaxLength(50);
b.Property(x => x.PurchaseOrderNoItem).HasMaxLength(50);
b.Property(x => x.PurchaseOrderNoText).HasMaxLength(50);
//b.Property(x => x.LineNumber).HasMaxLength(50);
//b.Property(x => x.PurchaseType).HasMaxLength(50);
//b.Property(x => x.PurchaseOrderNo).IsRequired().HasMaxLength(50);
//b.Property(x => x.PurchaseOrderNoItem).HasMaxLength(50);
//b.Property(x => x.PurchaseOrderNoText).HasMaxLength(50);
b.Property(x => x.ReceiptQty).IsRequired();
b.Property(x => x.InvoicedQty).IsRequired();
b.Property(x => x.AmountNoTax).IsRequired();
b.Property(x => x.PurchasePriceNoTax).IsRequired();
//b.Property(x => x.InvoicedQty).IsRequired();
//b.Property(x => x.AmountNoTax).IsRequired();
//b.Property(x => x.PurchasePriceNoTax).IsRequired();
b.Property(x => x.AccountNum).HasMaxLength(50);
//b.Property(x => x.AccountNum).HasMaxLength(50);
b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150);
b.Property(x => x.MaterialDesc).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(500);
b.Property(x => x.SpareDate);
b.Property(x => x.DeliveryOrderNo).IsRequired().HasMaxLength(50);
b.Property(x => x.DeliveryLineNum).HasMaxLength(50);
b.Property(x => x.BatchNo).HasMaxLength(50);
b.Property(x => x.Unit).HasMaxLength(50);
b.Property(x => x.TaxRate);
b.Property(x => x.TaxCode);
b.Property(x => x.GermanInvoiceNo).HasMaxLength(100);
b.Property(x => x.Factory).HasMaxLength(50);
b.Property(x => x.FactoryName).HasMaxLength(50);
b.Property(x => x.Extend).HasMaxLength(250);
//b.Property(x => x.DeliveryOrderNo).IsRequired().HasMaxLength(50);
//b.Property(x => x.DeliveryLineNum).HasMaxLength(50);
//b.Property(x => x.BatchNo).HasMaxLength(50);
//b.Property(x => x.Unit).HasMaxLength(50);
//b.Property(x => x.TaxRate);
//b.Property(x => x.TaxCode);
//b.Property(x => x.GermanInvoiceNo).HasMaxLength(100);
//b.Property(x => x.Factory).HasMaxLength(50);
//b.Property(x => x.FactoryName).HasMaxLength(50);
//b.Property(x => x.Extend).HasMaxLength(250);
//创建索引(没有版本一说)
b.HasIndex(x => new { x.Version,x.PurchaseOrderNo, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
//b.HasIndex(x => new { x.Version,x.PurchaseOrderNo, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
});
}
@ -937,14 +937,20 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
b.Property(x => x.Kanban).IsRequired().HasMaxLength(150);//必填项
b.Property(x => x.Relation).HasMaxLength(100);
b.Property(x => x.Factory).HasMaxLength(50);
b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150);
b.Property(x => x.PartType).HasMaxLength(50);
b.Property(x => x.SupplierCode).HasMaxLength(50);
b.Property(x => x.Batch).HasMaxLength(50);
b.Property(x => x.Flag).HasMaxLength(50);
//b.ConfigureByConvention();
//b.Property(x => x.Kanban).IsRequired().HasMaxLength(150);//必填项
//b.Property(x => x.Relation).HasMaxLength(100);
//b.Property(x => x.Factory).HasMaxLength(50);
//b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150);
//b.Property(x => x.PartType).HasMaxLength(50);
//b.Property(x => x.SupplierCode).HasMaxLength(50);
//b.Property(x => x.Batch).HasMaxLength(50);
//b.Property(x => x.Flag).HasMaxLength(50);
//创建组合索引
b.HasIndex(x => new { x.Version,x.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
//b.HasIndex(x => new { x.Version,x.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
});
}

47
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs

@ -43,7 +43,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" SELECT\n" +
" row_number() over(order by b.EstimateTypeDesc) as RowId ,\n" +
" c.WMSDeliveryNote,--交货单号\n" +
" c.WMSActualGoodsDate,--实际发货日期\n" +
" CONVERT ( VARCHAR ( 100 ), c.WMSActualGoodsDate, 23 ) AS WMSActualGoodsDate,--实际发货日期年-月-日\n" +
" a.Kanban,--条码号\n" +
" b.MaterialCode SapMaterialCode,--厂内物料号\n" +
@ -59,7 +59,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" 0 AS InvoiceDiffQty,--开票数量,默认0,后续拿算法动态算\n" +
" d.InvoicePrice,--开票单价\n" +
" 0 AS InvoiceMoney,--开票金额\n" +
" c.DeliveryOrderNo --出库单号\n" +
" '' DeliveryOrderNo --出库单号\n" +
" \n" +
" FROM\n" +
" Set_KanBanSettle AS a\n" +
@ -96,6 +96,39 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
return _query.ToList();
}
public virtual List<InvoiceSettleDiff> GetVWKanBanInvoiceDiff(string version)
{
var str = "SELECT\n" +
" * \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" b.MaterialCode,\n" +
" InvocieQty-SettleQty DiffQty \n" +
" FROM\n" +
" ( SELECT sum( Qty ) SettleQty, MaterialCode FROM Set_KanBanSettle a WHERE version = '{0}' GROUP BY MaterialCode ) a\n" +
" INNER JOIN ( SELECT SUM( QTY ) InvocieQty, MaterialCode FROM Set_Invoice WHERE version = '{0}' GROUP BY MaterialCode ) b ON a.MaterialCode = b.MaterialCode \n" +
" ) temp \n" +
" WHERE\n" +
" temp.DiffQty <>0";
var _list = DbConnection.Query<InvoiceSettleDiff>(string.Format(str, version));
return _list.ToList();
}
/// <summary>
///
/// </summary>
@ -189,8 +222,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "交货单号")]
public string WMSDeliveryNote { set; get; }
[ExporterHeader(DisplayName = "实际发货日期")]
public DateTime ActualGoodsDate { set; get; }
[ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")]
public DateTime WMSActualGoodsDate { set; get; }
[ExporterHeader(DisplayName = "条码号")]
public string Kanban { set; get; }
@ -204,8 +237,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "客户物料")]
public string CustomerPartCode { set; get; }
[ExporterHeader(DisplayName = "厂内物料号")]
public string SapMaterialCode { set; get; }
//[ExporterHeader(DisplayName = "厂内物料号")]
//public string SapMaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
@ -223,7 +256,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算数量")]
public decimal SettleNumber { set; get; }
[ExporterHeader(DisplayName = "结算日期")]
[ExporterHeader(DisplayName = "结算日期", Format = "yyyy-MM-dd")]
public DateTime SettleDate { set; get; }
[ExporterHeader(DisplayName = "结算金额")]

35
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs

@ -41,13 +41,13 @@ namespace SettleAccount.Job.Services.Report
var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var _list = _dapper.GetSettleKBWithCodeReportList(kanban, version, sapMaterialCode, customerPartCode,materialGroup, beginTime, endTime);
var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
var _list = _dapper.GetSettleKBWithCodeReportList(kanban, version, sapMaterialCode, customerPartCode, materialGroup, beginTime, endTime);
var diffList = _dapper.GetVWKanBanInvoiceDiff(version);
if (diffList != null)
{
foreach (var itm in diffList)
{
var _first = _list.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode);
var _first = _list.FirstOrDefault(p => p.CustomerPartCode == itm.MaterialCode);//结算物料号去匹配发票汇总中的物料号
if (_first != null)
{
_first.InvoiceDiffQty = _first.SettleNumber + itm.DiffQty;//开票数量(结算数量+差异)
@ -64,15 +64,23 @@ namespace SettleAccount.Job.Services.Report
_list = _list.Where(p => _groupList.Contains(p.EstimateTypeDesc)).ToList();
}
}
if (!string.IsNullOrEmpty(sapMaterialCode))
{
var _groupList = sapMaterialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
_list = _list.Where(p => _groupList.Contains(p.MaterialCode)).ToList();
}
}
//if (!string.IsNullOrEmpty(sapMaterialCode))
//{
// var _groupList = sapMaterialCode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
// }
//}
if (!string.IsNullOrEmpty(customerPartCode))
{
@ -85,13 +93,22 @@ namespace SettleAccount.Job.Services.Report
if (!string.IsNullOrEmpty(beginTime))
{
_list = _list.Where(p => DateTime.Parse(beginTime)<=p.ActualGoodsDate).ToList();
_list = _list.Where(p => DateTime.Parse(beginTime) <= p.WMSActualGoodsDate).ToList();
}
if (!string.IsNullOrEmpty(endTime))
{
_list = _list.Where(p => DateTime.Parse(endTime) >= p.ActualGoodsDate).ToList();
_list = _list.Where(p => DateTime.Parse(endTime) >= p.WMSActualGoodsDate).ToList();
}
//if (!string.IsNullOrEmpty(beginTime))
//{
// _list = _list.Where(p => DateTime.Parse(beginTime)<=p.ActualGoodsDate).ToList();
//}
//if (!string.IsNullOrEmpty(endTime))
//{
// _list = _list.Where(p => DateTime.Parse(endTime) >= p.ActualGoodsDate).ToList();
//}
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
@ -101,10 +118,10 @@ namespace SettleAccount.Job.Services.Report
}
}
_outputService.Export<SettleKBWithCode>(id,_filename , _list);
_outputService.Export<SettleKBWithCode>(id, _filename, _list);
return id.ToString();
}

Loading…
Cancel
Save