Browse Source

房大伟:大众看板明细导入及发票汇总导入代码

branch_ccpg_220107
44673626 3 years ago
parent
commit
1dc7a4d346
  1. 8069
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210830073315_init.Designer.cs
  2. 3505
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210830073315_init.cs
  3. 8246
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210830073634_202108300001.Designer.cs
  4. 80
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210830073634_202108300001.cs
  5. 8434
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210901012406_201209010001.Designer.cs
  6. 95
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210901012406_201209010001.cs
  7. 8434
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210901030011_202109010002.Designer.cs
  8. 39
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210901030011_202109010002.cs
  9. 8514
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210902032556_202109020001.Designer.cs
  10. 45
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210902032556_202109020001.cs
  11. 8626
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210908064420_20210908.Designer.cs
  12. 61
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210908064420_20210908.cs
  13. 8706
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210908064843_2021090801.Designer.cs
  14. 45
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210908064843_2021090801.cs
  15. 8712
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210909023755_data09-02.Designer.cs
  16. 34
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210909023755_data09-02.cs
  17. 8722
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210911114440_202109110001.Designer.cs
  18. 75
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210911114440_202109110001.cs
  19. 8733
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210923073158_202109230001.Designer.cs
  20. 93
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210923073158_202109230001.cs
  21. 8735
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210923075035_202109230003.Designer.cs
  22. 57
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210923075035_202109230003.cs
  23. 8739
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210928072540_data20190928.Designer.cs
  24. 24
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210928072540_data20190928.cs
  25. 8860
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210930051830_2021093001.Designer.cs
  26. 55
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210930051830_2021093001.cs
  27. 8970
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211008014847_2021100801.Designer.cs
  28. 58
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211008014847_2021100801.cs
  29. 8973
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211008025050_2021100802.Designer.cs
  30. 23
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211008025050_2021100802.cs
  31. 9138
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009013417_2021100901.Designer.cs
  32. 126
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009013417_2021100901.cs
  33. 9142
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009013927_2021100902.Designer.cs
  34. 24
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009013927_2021100902.cs
  35. 9145
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009083009_2021100900012.Designer.cs
  36. 23
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009083009_2021100900012.cs
  37. 9145
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211010014458_202110100001.Designer.cs
  38. 17
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211010014458_202110100001.cs
  39. 9285
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211010014700_202110100002.Designer.cs
  40. 62
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211010014700_202110100002.cs
  41. 9288
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211011084504_202110110001.Designer.cs
  42. 89
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211011084504_202110110001.cs
  43. 9292
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211012080054_20211012.Designer.cs
  44. 68
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211012080054_20211012.cs
  45. 9292
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211012084512_2021101201.Designer.cs
  46. 35
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211012084512_2021101201.cs
  47. 20
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/IInvoiceAppService.cs
  48. 64
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceDtoBase.cs
  49. 131
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/IVWKanBanAppService.cs
  50. 16
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanCreateDto.cs
  51. 85
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDto.cs
  52. 86
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDtoBase.cs
  53. 93
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanExportDto.cs
  54. 95
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImportDto.cs
  55. 94
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanRequestDto.cs
  56. 103
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanVersionDtoBase.cs
  57. 16
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBantUpdateDto.cs
  58. 15
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs
  59. 16
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs
  60. 173
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs
  61. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs
  62. 316
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWKanBan/VWKanBanAppService.cs
  63. 87
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  64. 38
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  65. 56
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/Invoice.cs
  66. 4
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/InvoiceVersion.cs
  67. 86
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/KanBan/KanBan.cs
  68. 34
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/KanBan/KanBanManager.cs
  69. 51
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/KanBan/KanBanVersion.cs
  70. 94
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  71. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceRepository.cs
  72. 2
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceVersionRepository.cs
  73. 80
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Invoices/InvoiceImportService.cs

8069
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210830073315_init.Designer.cs

File diff suppressed because it is too large

3505
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210830073315_init.cs

File diff suppressed because it is too large

8246
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210830073634_202108300001.Designer.cs

File diff suppressed because it is too large

80
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210830073634_202108300001.cs

@ -1,80 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202108300001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_MaterialRelationshipDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ErpMaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MaterialDesc = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MaterialProperty = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SettleMaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ShipMaterailCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
AppraisalCategory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_MaterialRelationshipDetail", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Set_MaterialRelationshipVersion",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Year = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_MaterialRelationshipVersion", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_MaterialRelationshipDetail");
migrationBuilder.DropTable(
name: "Set_MaterialRelationshipVersion");
}
}
}

8434
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210901012406_201209010001.Designer.cs

File diff suppressed because it is too large

95
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210901012406_201209010001.cs

@ -1,95 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _201209010001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_settle_version",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Factory = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_settle_version", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Set_settlement_part",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Factory = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Model = table.Column<string>(type: "nvarchar(max)", nullable: true),
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
SettlementPartCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
SettlementPartDesc = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Uom = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_settlement_part", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Set_settle_version_Version",
table: "Set_settle_version",
column: "Version",
unique: true,
filter: "IsDeleted=0");
migrationBuilder.CreateIndex(
name: "IX_Set_settlement_part_Period_CustomerCode_Version_SettlementPartCode",
table: "Set_settlement_part",
columns: new[] { "Period", "CustomerCode", "Version", "SettlementPartCode" },
unique: true,
filter: "IsDeleted=0");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_settle_version");
migrationBuilder.DropTable(
name: "Set_settlement_part");
}
}
}

8434
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210901030011_202109010002.Designer.cs

File diff suppressed because it is too large

39
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210901030011_202109010002.cs

@ -1,39 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202109010002 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Set_InvoiceVersion",
table: "Set_InvoiceVersion");
migrationBuilder.RenameTable(
name: "Set_InvoiceVersion",
newName: "Set_settlement_part_version");
migrationBuilder.AddPrimaryKey(
name: "PK_Set_settlement_part_version",
table: "Set_settlement_part_version",
column: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Set_settlement_part_version",
table: "Set_settlement_part_version");
migrationBuilder.RenameTable(
name: "Set_settlement_part_version",
newName: "Set_InvoiceVersion");
migrationBuilder.AddPrimaryKey(
name: "PK_Set_InvoiceVersion",
table: "Set_InvoiceVersion",
column: "Id");
}
}
}

8514
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210902032556_202109020001.Designer.cs

File diff suppressed because it is too large

45
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210902032556_202109020001.cs

@ -1,45 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202109020001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_InvoiceVersion",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Year = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_InvoiceVersion", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_InvoiceVersion");
}
}
}

8626
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210908064420_20210908.Designer.cs

File diff suppressed because it is too large

61
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210908064420_20210908.cs

@ -1,61 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _20210908 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_item_invoice_price",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Factory = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
MaterialCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
MaterialDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
UM = table.Column<string>(type: "nvarchar(max)", nullable: true),
Sales = table.Column<string>(type: "nvarchar(max)", nullable: true),
SubAcct = table.Column<string>(type: "nvarchar(max)", nullable: true),
CC = table.Column<string>(type: "nvarchar(max)", nullable: true),
Backorder = table.Column<string>(type: "nvarchar(max)", nullable: true),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
ExtendedPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
ExtendedMargin = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_item_invoice_price", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Set_item_invoice_price_Period_Version_MaterialCode",
table: "Set_item_invoice_price",
columns: new[] { "Period", "Version", "MaterialCode" },
unique: true,
filter: "IsDeleted=0");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_item_invoice_price");
}
}
}

8706
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210908064843_2021090801.Designer.cs

File diff suppressed because it is too large

45
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210908064843_2021090801.cs

@ -1,45 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _2021090801 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_item_invoice_price_version",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Year = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_item_invoice_price_version", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_item_invoice_price_version");
}
}
}

8712
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210909023755_data09-02.Designer.cs

File diff suppressed because it is too large

34
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210909023755_data09-02.cs

@ -1,34 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class data0902 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ErpMaterialCode",
table: "Set_fis",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "SettleState",
table: "Set_fis",
type: "int",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ErpMaterialCode",
table: "Set_fis");
migrationBuilder.DropColumn(
name: "SettleState",
table: "Set_fis");
}
}
}

8722
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210911114440_202109110001.Designer.cs

File diff suppressed because it is too large

75
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210911114440_202109110001.cs

@ -1,75 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202109110001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Set_fis_ChassisNumber2_Version_Model_ItemCode",
table: "Set_fis");
migrationBuilder.AddColumn<decimal>(
name: "DiffQty",
table: "Set_InvoiceSettledDiff",
type: "decimal(18,2)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<string>(
name: "Version",
table: "Set_InvoiceSettledDiff",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ErpMaterialCode",
table: "Set_fis_extend",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "SettleState",
table: "Set_fis_extend",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateIndex(
name: "IX_Set_fis_ChassisNumber2_Version_Model_ItemCode",
table: "Set_fis",
columns: new[] { "ChassisNumber2", "Version", "Model", "ItemCode" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Set_fis_ChassisNumber2_Version_Model_ItemCode",
table: "Set_fis");
migrationBuilder.DropColumn(
name: "DiffQty",
table: "Set_InvoiceSettledDiff");
migrationBuilder.DropColumn(
name: "Version",
table: "Set_InvoiceSettledDiff");
migrationBuilder.DropColumn(
name: "ErpMaterialCode",
table: "Set_fis_extend");
migrationBuilder.DropColumn(
name: "SettleState",
table: "Set_fis_extend");
migrationBuilder.CreateIndex(
name: "IX_Set_fis_ChassisNumber2_Version_Model_ItemCode",
table: "Set_fis",
columns: new[] { "ChassisNumber2", "Version", "Model", "ItemCode" },
unique: true,
filter: "[ChassisNumber2] IS NOT NULL AND [Model] IS NOT NULL");
}
}
}

8733
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210923073158_202109230001.Designer.cs

File diff suppressed because it is too large

93
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210923073158_202109230001.cs

@ -1,93 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202109230001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Model",
table: "Set_fis",
type: "nvarchar(36)",
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "KENNCode",
table: "Set_fis",
type: "nvarchar(36)",
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(450)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ErpMaterialCode",
table: "Set_fis",
type: "nvarchar(36)",
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ChassisNumber2",
table: "Set_fis",
type: "nvarchar(36)",
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(450)",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Model",
table: "Set_fis",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "KENNCode",
table: "Set_fis",
type: "nvarchar(450)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ErpMaterialCode",
table: "Set_fis",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ChassisNumber2",
table: "Set_fis",
type: "nvarchar(450)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36,
oldNullable: true);
}
}
}

8735
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210923075035_202109230003.Designer.cs

File diff suppressed because it is too large

57
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210923075035_202109230003.cs

@ -1,57 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202109230003 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "YearKennCode",
table: "Set_prebatch",
type: "nvarchar(36)",
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36);
migrationBuilder.AlterColumn<string>(
name: "CarCode",
table: "Set_prebatch",
type: "nvarchar(36)",
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "YearKennCode",
table: "Set_prebatch",
type: "nvarchar(36)",
maxLength: 36,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CarCode",
table: "Set_prebatch",
type: "nvarchar(36)",
maxLength: 36,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(36)",
oldMaxLength: 36,
oldNullable: true);
}
}
}

8739
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210928072540_data20190928.Designer.cs

File diff suppressed because it is too large

24
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210928072540_data20190928.cs

@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class data20190928 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Year",
table: "Set_prebatch",
type: "nvarchar(36)",
maxLength: 36,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Year",
table: "Set_prebatch");
}
}
}

8860
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210930051830_2021093001.Designer.cs

File diff suppressed because it is too large

55
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20210930051830_2021093001.cs

@ -1,55 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _2021093001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_SettlementPakAndSpareParts",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ApplicableFunction = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SettlementPartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
SettlementPartDesc = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ErpSparePartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ErpSparePartName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
PartType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
QADCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SupplierCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SupplierName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ProductLine = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
PerCarNum = table.Column<decimal>(type: "decimal(18,2)", maxLength: 50, nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", maxLength: 50, nullable: false),
SupplyProportion = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
QuantityPrice = table.Column<decimal>(type: "decimal(18,2)", maxLength: 50, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_SettlementPakAndSpareParts", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_SettlementPakAndSpareParts");
}
}
}

8970
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211008014847_2021100801.Designer.cs

File diff suppressed because it is too large

58
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211008014847_2021100801.cs

@ -1,58 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _2021100801 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_SettlementCrossReference",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Model = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
PartType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SettlementMaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
BomMaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
MaterialDesc = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SupplierCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SupplierDesc = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Buyer = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Version = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_SettlementCrossReference", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Set_SettlementCrossReference_Period_SettlementMaterialCode_BomMaterialCode",
table: "Set_SettlementCrossReference",
columns: new[] { "Period", "SettlementMaterialCode", "BomMaterialCode" },
unique: true,
filter: "IsDeleted=0");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_SettlementCrossReference");
}
}
}

8973
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211008025050_2021100802.Designer.cs

File diff suppressed because it is too large

23
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211008025050_2021100802.cs

@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _2021100802 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Version",
table: "Set_SettlementPakAndSpareParts",
type: "nvarchar(max)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Version",
table: "Set_SettlementPakAndSpareParts");
}
}
}

9138
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009013417_2021100901.Designer.cs

File diff suppressed because it is too large

126
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009013417_2021100901.cs

@ -1,126 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _2021100901 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Version",
table: "Set_SettlementPakAndSpareParts",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "CustomerCode",
table: "Set_SettlementPakAndSpareParts",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "Version",
table: "Set_SettlementCrossReference",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.CreateTable(
name: "Set_SettlementCrossReference_Version",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Year = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_SettlementCrossReference_Version", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Set_SettlementPakAndSpareParts_Version",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Year = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_SettlementPakAndSpareParts_Version", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_SettlementCrossReference_Version");
migrationBuilder.DropTable(
name: "Set_SettlementPakAndSpareParts_Version");
migrationBuilder.DropColumn(
name: "CustomerCode",
table: "Set_SettlementPakAndSpareParts");
migrationBuilder.AlterColumn<string>(
name: "Version",
table: "Set_SettlementPakAndSpareParts",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Version",
table: "Set_SettlementCrossReference",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
}
}
}

9142
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009013927_2021100902.Designer.cs

File diff suppressed because it is too large

24
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009013927_2021100902.cs

@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _2021100902 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CustomerCode",
table: "Set_SettlementCrossReference",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CustomerCode",
table: "Set_SettlementCrossReference");
}
}
}

9145
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009083009_2021100900012.Designer.cs

File diff suppressed because it is too large

23
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211009083009_2021100900012.cs

@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _2021100900012 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Model",
table: "Set_SettlementPakAndSpareParts",
type: "nvarchar(50)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Model",
table: "Set_SettlementPakAndSpareParts");
}
}
}

9145
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211010014458_202110100001.Designer.cs

File diff suppressed because it is too large

17
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211010014458_202110100001.cs

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

9285
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211010014700_202110100002.Designer.cs

File diff suppressed because it is too large

62
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211010014700_202110100002.cs

@ -1,62 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202110100002 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_SecMatchBase",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Index = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Model = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
PartType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SettleMentPartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MaterialPartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MaterialDesc = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SupplierCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SupplierName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
UsedNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SupplyProportion = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Buyer = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
SettlementPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
DiffPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
SettlementNumber = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
TheoreticalSettlementNumber = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
RealSettlementNumber = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
RealSettlementPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
IsDiffNumber = table.Column<bool>(type: "bit", nullable: false),
DiffAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_SecMatchBase", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_SecMatchBase");
}
}
}

9288
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211011084504_202110110001.Designer.cs

File diff suppressed because it is too large

89
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211011084504_202110110001.cs

@ -1,89 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202110110001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "SupplierDesc",
table: "Set_SettlementCrossReference",
type: "nvarchar(128)",
maxLength: 128,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<decimal>(
name: "UsedNumber",
table: "Set_SecMatchBase",
type: "decimal(18,2)",
maxLength: 50,
nullable: false,
defaultValue: 0m,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<decimal>(
name: "SupplyProportion",
table: "Set_SecMatchBase",
type: "decimal(18,2)",
maxLength: 50,
nullable: false,
defaultValue: 0m,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "IsSettle",
table: "Set_SecMatchBase",
type: "nvarchar(max)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsSettle",
table: "Set_SecMatchBase");
migrationBuilder.AlterColumn<string>(
name: "SupplierDesc",
table: "Set_SettlementCrossReference",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(128)",
oldMaxLength: 128,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "UsedNumber",
table: "Set_SecMatchBase",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "SupplyProportion",
table: "Set_SecMatchBase",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)",
oldMaxLength: 50);
}
}
}

9292
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211012080054_20211012.Designer.cs

File diff suppressed because it is too large

68
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211012080054_20211012.cs

@ -1,68 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _20211012 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Version",
table: "Set_SettlementCrossReference",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Period",
table: "Set_SettlementCrossReference",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AddColumn<string>(
name: "Year",
table: "Set_SettlementCrossReference",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Year",
table: "Set_SettlementCrossReference");
migrationBuilder.AlterColumn<string>(
name: "Version",
table: "Set_SettlementCrossReference",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Period",
table: "Set_SettlementCrossReference",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
}
}
}

9292
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211012084512_2021101201.Designer.cs

File diff suppressed because it is too large

35
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211012084512_2021101201.cs

@ -1,35 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _2021101201 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Set_SettlementCrossReference_Period_SettlementMaterialCode_BomMaterialCode",
table: "Set_SettlementCrossReference");
migrationBuilder.CreateIndex(
name: "IX_Set_SettlementCrossReference_Version_SettlementMaterialCode_BomMaterialCode",
table: "Set_SettlementCrossReference",
columns: new[] { "Version", "SettlementMaterialCode", "BomMaterialCode" },
unique: true,
filter: "IsDeleted=0");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Set_SettlementCrossReference_Version_SettlementMaterialCode_BomMaterialCode",
table: "Set_SettlementCrossReference");
migrationBuilder.CreateIndex(
name: "IX_Set_SettlementCrossReference_Period_SettlementMaterialCode_BomMaterialCode",
table: "Set_SettlementCrossReference",
columns: new[] { "Period", "SettlementMaterialCode", "BomMaterialCode" },
unique: true,
filter: "IsDeleted=0");
}
}
}

20
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/IInvoiceAppService.cs

@ -1,12 +1,30 @@
using System;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.Invoices.Win.Sfs.SettleAccount.Entities.Invoices;
namespace Win.Sfs.SettleAccount.Entities.Invoices
{
public interface IInvoiceAppService
{
Task<string> InvoiceUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory);
Task<InvoiceDto> GetAsync(Guid id);
Task<PagedResultDto<InvoiceDto>> GetListAsync(InvoiceRequestDto input);
Task<ListResultDto<InvoiceDto>> GetAllAsync(Guid branchId);
Task<InvoiceDto> UpdateAsync(Guid id, InvoiceDto input);
Task DeleteAsync(Guid id);
Task<bool> DeleteListAsync(List<Guid> ids);
Task<PagedResultDto<InvoiceVersionDto>> GetVersionListAsync(InvoiceVersionRequestDto input);
Task<string> ExportAsync(InvoiceRequestDto input);
}
}

64
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceDtoBase.cs

@ -20,26 +20,18 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
/// </summary>
[ImporterHeader(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///入库文本号
/// </summary>
[ImporterHeader(Name = "物料凭证")]
public string TextCode { get; set; }
/// <summary>
///零件号
/// </summary>
[ImporterHeader(Name = "物料")]
[ImporterHeader(Name = "零件号")]
public string MaterialCode { get; set; }
/// <summary>
///零件名称
/// </summary>
[ImporterHeader(Name = "物料描述")]
[ImporterHeader(Name = "零件名称")]
public string MaterialDesc { get; set; }
///// <summary>
/////入库日期
///// </summary>
//[ImporterHeader(Name = "入库日期")]
//public DateTime Date { get; set; }
/// <summary>
///数量
/// </summary>
@ -50,21 +42,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
/// </summary>
[ImporterHeader(Name = "金额")]
public decimal Amt { get; set; }
/// <summary>
///记账号码
/// </summary>
[ImporterHeader(Name = "货币")]
public string Number { get; set; }
/// <summary>
///记账人员
/// </summary>
[ImporterHeader(Name = "工厂名称")]
public string Accounting { get; set; }
/// <summary>
///记账日期
/// </summary>
[ImporterHeader(Name = "过账日期")]
public DateTime AccountDate { get; set; }
}
@ -81,26 +59,18 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
/// </summary>
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///入库文本号
/// </summary>
[Display(Name = "物料凭证")]
public string TextCode { get; set; }
/// <summary>
///零件号
/// </summary>
[Display(Name = "物料")]
[Display(Name = "零件号")]
public string MaterialCode { get; set; }
/// <summary>
///零件名称
/// </summary>
[Display(Name = "物料描述")]
[Display(Name = "零件名称")]
public string MaterialDesc { get; set; }
///// <summary>
/////入库日期
///// </summary>
//[Display(Name = "入库日期")]
//public DateTime Date { get; set; }
/// <summary>
///数量
/// </summary>
@ -111,21 +81,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
/// </summary>
[Display(Name = "金额")]
public decimal Amt { get; set; }
/// <summary>
///记账号码
/// </summary>
[Display(Name = "货币")]
public string Number { get; set; }
/// <summary>
///记账人员
/// </summary>
[Display(Name = "工厂名称")]
public string Accounting { get; set; }
/// <summary>
///记账日期
/// </summary>
[Display(Name = "过账日期")]
public DateTime AccountDate { get; set; }
}

131
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/IVWKanBanAppService.cs

@ -0,0 +1,131 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.Entities.VWKanBanVersion;
using Win.Sfs.Shared.ApplicationBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public interface IVWKanBanAppService
{
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
Task<string> VWKanBanUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode);
/// <summary>
/// 按ID获取唯一实体
/// </summary>
/// <remarks>
/// 返回实体全部属性
/// </remarks>
/// <param name="id">ID</param>
/// <returns>实体DTO</returns>
Task<VWKanBanDto> GetAsync(Guid id);
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
Task<PagedResultDto<VWKanBanDto>> GetListAsync(Guid parentId, VWKanBanRequestDto input);
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
Task<PagedResultDto<VWKanBanVersionDto>> GetVersionListAsync(VWKanBanVersionRequestDto input);
Task<string> ExportAsync(VWKanBanRequestDto input);
/// <summary>
/// 获取实体总数
/// </summary>
/// <returns>实体总数</returns>
Task<long> GetTotalCountAsync(Guid branchId);
///// <summary>
///// 获取全部实体列表
///// </summary>
///// <returns>实体DTO列表</returns>
//Task<ListResultDto<SettleAccountDto>> GetAllAsync(Guid branchId);
///// <summary>
///// 新增实体
///// </summary>
///// <param name="input">新增实体DTO</param>
///// <returns>实体DTO</returns>
//Task<SettleAccountDto> CreateAsync(SettleAccountCreateDto input);
///// <summary>
///// 修改实体
///// </summary>
///// <param name="id">ID</param>
///// <param name="input">修改实体DTO</param>
///// <returns>实体DTO</returns>
//Task<SettleAccountDto> UpdateAsync(Guid id, SettleAccountUpdateDto input);
///// <summary>
///// 删除实体
///// </summary>
///// <param name="id">ID</param>
///// <returns>无</returns>
Task DeleteAsync(Guid id);
/// <summary>
/// 按IDs删除实体列表
/// </summary>
/// <param name="ids">IDs</param>
/// <returns>是否执行成功</returns>
Task<bool> DeleteListAsync(List<Guid> ids);
}
}

16
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanCreateDto.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.SettleAccount.Entities.VWKanBan;
using Win.Sfs.Shared;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
public class VWKanBanCreateDto : VWKanBanDtoBase, IBranch<Guid>
{
public virtual Guid BranchId { get ; set ; }
}
}

85
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDto.cs

@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared;
using Win.Sfs.Shared.DomainBase;
using Win.Sfs.Shared.DtoBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public class VWKanBanDto: AuditedEntityDtoBase<Guid>
{
/// <summary>
/// 期间
/// </summary>
public string Period { set; get; }
/// <summary>
/// 版本
/// </summary>
public virtual string Version { get; set; }
/// <summary>
///看板条码号
/// </summary>
public string Kanban { set; get; }
/// <summary>
/// 入库关联号
/// </summary>
public virtual string Relation { set; get; }
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { set; get; }
/// <summary>
/// 零件号
/// </summary>
public virtual string MaterialCode { set; get; }
/// <summary>
/// 零件类型
/// </summary>
public virtual string PartType { set; get; }
/// <summary>
/// R3入库时间
/// </summary>
public virtual DateTime SettleInputDate { set; get; }
/// <summary>
///供应商编码
/// </summary>
public virtual string SupplierCode { get; set; }
/// <summary>
/// 数量
/// </summary>
public virtual decimal Qty { get; set; }
/// <summary>
/// 批次
/// </summary>
public virtual string Batch { get; set; }
/// <summary>
/// 入库结算标识
/// </summary>
public virtual string Flag { get; set; }
/// <summary>
/// 结算日期
/// </summary>
public virtual DateTime SettleDate { get; set; }
/// <summary>
/// 结算状态
/// </summary>
public virtual int State { get ; set ; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
}

86
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDtoBase.cs

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
using Win.Sfs.Shared.DtoBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public class VWKanBanDtoBase: CreateOrUpdateEntityDtoBase<Guid>
{
/// <summary>
/// 期间
/// </summary>
public string Period { set; get; }
/// <summary>
///看板条码号
/// </summary>
public string Kanban { set; get; }
/// <summary>
/// 入库关联号
/// </summary>
public virtual string Relation { set; get; }
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { set; get; }
/// <summary>
/// 零件号
/// </summary>
public virtual string MaterialCode { set; get; }
/// <summary>
/// 零件类型
/// </summary>
public virtual string PartType { set; get; }
/// <summary>
/// R3入库时间
/// </summary>
public virtual DateTime SettleInputDate { set; get; }
/// <summary>
///供应商编码
/// </summary>
public virtual string SupplierCode { get; set; }
/// <summary>
/// 数量
/// </summary>
public virtual decimal Qty { get; set; }
/// <summary>
/// 批次
/// </summary>
public virtual string Batch { get; set; }
/// <summary>
/// 入库结算标识
/// </summary>
public virtual string Flag { get; set; }
/// <summary>
/// 结算日期
/// </summary>
public virtual DateTime SettleDate { get; set; }
/// <summary>
/// 结算状态
/// </summary>
public virtual int State { get; set; }
public virtual string Version { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
}

93
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanExportDto.cs

@ -0,0 +1,93 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public class VWKanBanExportDto
{
/// <summary>
/// 期间
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public string Period { set; get; }
/// <summary>
/// 版本
/// </summary>
[ExporterHeader(DisplayName = "版本")]
public virtual string Version { get; set; }
/// <summary>
///看板条码号
/// </summary>
[ExporterHeader(DisplayName = "看板条码号")]
public string Kanban { set; get; }
/// <summary>
/// 入库关联号
/// </summary>
[ExporterHeader(DisplayName = "入库关联号")]
public virtual string Relation { set; get; }
/// <summary>
/// 工厂
/// </summary>
[ExporterHeader(DisplayName = "工厂")]
public virtual string Factory { set; get; }
/// <summary>
/// 零件号
/// </summary>
[ExporterHeader(DisplayName = "零件号")]
public virtual string MaterialCode { set; get; }
/// <summary>
/// 零件类型
/// </summary>
[ExporterHeader(DisplayName = "零件类型")]
public virtual string PartType { set; get; }
/// <summary>
/// R3入库日期
/// </summary>
[ExporterHeader(DisplayName = "R3入库日期")]
public virtual DateTime SettleInputDate { set; get; }
/// <summary>
///供应商编码
/// </summary>
[ExporterHeader(DisplayName = "供应商")]
public virtual string SupplierCode { get; set; }
/// <summary>
/// 数量
/// </summary>
[ExporterHeader(DisplayName = "数量")]
public virtual decimal Qty { get; set; }
/// <summary>
/// 批次
/// </summary>
[ExporterHeader(DisplayName = "批次")]
public virtual string Batch { get; set; }
/// <summary>
/// 入库结算标识
/// </summary>
[ExporterHeader(DisplayName = "入库结算标识")]
public virtual string Flag { get; set; }
/// <summary>
/// 结算日期
/// </summary>
[ExporterHeader(DisplayName = "R3结算时间")]
public virtual DateTime SettleDate { get; set; }
/// <summary>
/// 结算状态
/// </summary>
[ExporterHeader(DisplayName = "结算状态")]
public virtual int State { get; set; }
}
}

95
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImportDto.cs

@ -0,0 +1,95 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public class VWKanBanImportDto
{
/// <summary>
/// 期间
/// </summary>
[ImporterHeader(Name = "期间")]
public string Period { set; get; }
/// <summary>
/// 版本
/// </summary>
[ImporterHeader(Name = "版本")]
public virtual string Version { get; set; }
/// <summary>
///看板条码号
/// </summary>
[ImporterHeader(Name = "看板条码号")]
public string Kanban { set; get; }
/// <summary>
/// 入库关联号
/// </summary>
[ImporterHeader(Name = "入库关联号")]
public virtual string Relation { set; get; }
/// <summary>
/// 工厂
/// </summary>
[ImporterHeader(Name = "工厂")]
public virtual string Factory { set; get; }
/// <summary>
/// 零件号
/// </summary>
[ImporterHeader(Name = "零件号")]
public virtual string MaterialCode { set; get; }
/// <summary>
/// 零件类型
/// </summary>
[ImporterHeader(Name = "零件类型")]
public virtual string PartType { set; get; }
/// <summary>
/// R3入库日期
/// </summary>
[ImporterHeader(Name = "R3入库日期")]
public virtual DateTime SettleInputDate { set; get; }
/// <summary>
///供应商编码
/// </summary>
[ImporterHeader(Name = "供应商")]
public virtual string SupplierCode { get; set; }
/// <summary>
/// 数量
/// </summary>
[ImporterHeader(Name = "数量")]
public virtual decimal Qty { get; set; }
/// <summary>
/// 批次
/// </summary>
[ImporterHeader(Name = "批次")]
public virtual string Batch { get; set; }
/// <summary>
/// 入库结算标识
/// </summary>
[ImporterHeader(Name = "入库结算标识")]
public virtual string Flag { get; set; }
/// <summary>
/// 结算日期
/// </summary>
[ImporterHeader(Name = "R3结算时间")]
public virtual DateTime SettleDate { get; set; }
/// <summary>
/// 结算状态
/// </summary>
[ImporterHeader(Name = "结算状态")]
public virtual int State { get; set; }
}
}

94
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanRequestDto.cs

@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared;
using Win.Sfs.Shared.DomainBase;
using Win.Sfs.Shared.DtoBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public class VWKanBanRequestDto: RequestDtoBase
{
/// <summary>
/// 期间
/// </summary>
public string Period { set; get; }
/// <summary>
/// 版本
/// </summary>
public virtual string Version { get; set; }
/// <summary>
///看板条码号
/// </summary>
public string Kanban { set; get; }
/// <summary>
/// 入库关联号
/// </summary>
public virtual string Relation { set; get; }
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { set; get; }
/// <summary>
/// 零件号
/// </summary>
public virtual string MaterialCode { set; get; }
/// <summary>
/// 零件类型
/// </summary>
public virtual string PartType { set; get; }
/// <summary>
/// R3入库时间
/// </summary>
public virtual DateTime SettleInputDate { set; get; }
/// <summary>
///供应商编码
/// </summary>
public virtual string SupplierCode { get; set; }
/// <summary>
/// 数量
/// </summary>
public virtual decimal Qty { get; set; }
/// <summary>
/// 批次
/// </summary>
public virtual string Batch { get; set; }
/// <summary>
/// 入库结算标识
/// </summary>
public virtual string Flag { get; set; }
/// <summary>
/// 结算日期
/// </summary>
public virtual DateTime SettleDate { get; set; }
/// <summary>
/// 结算状态
/// </summary>
public virtual int State { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
public virtual Guid ParentId { get; set; }
public virtual Guid BranchId { get; set; }
public virtual Guid UserId { get; set; }
public virtual int FileType { get; set; }
}
}

103
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanVersionDtoBase.cs

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared;
using Win.Sfs.Shared.DomainBase;
using Win.Sfs.Shared.DtoBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBanVersion
{
/// <summary>
/// SettleAccountVersion
/// </summary>
public class VWKanBanVersionDtoBase : CreateOrUpdateEntityDtoBase<Guid>
{
public string Year { get; private set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; private set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; private set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { private set; get; }
}
public class VWKanBanVersionDto : AuditedEntityDtoBase<Guid>, IBranch<Guid>
{
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { set; get; }
public Guid BranchId { get ; set; }
}
public class VWKanBanVersionCreateDto : VWKanBanVersionDtoBase
{ }
public class VWKanBanVersionUpdateDto : VWKanBanVersionDtoBase
{ }
public class VWKanBanVersionRequestDto : RequestDtoBase, IBranch<Guid>
{
public string Year { get; private set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; private set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; private set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { private set; get; }
public Guid BranchId { get ; set ; }
}
public class VWKanBanVersionImportDto
{
public string Year { get; private set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; private set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; private set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { private set; get; }
}
}

16
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBantUpdateDto.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public class VWKanBantUpdateDto: VWKanBanDtoBase
{
}
}

15
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs

@ -9,8 +9,18 @@ namespace Win.Sfs.SettleAccount
public override void Define(IPermissionDefinitionContext context)
{
var myGroup = context.AddGroup(SettleAccountPermissions.GroupName, L("SettleAccount"));
#region 派格
//大众看板明细结算导入
var vwKanban = myGroup.AddPermission(SettleAccountPermissions.VWKanBan.Default, L("VWKanBan"));
vwKanban.AddChild(SettleAccountPermissions.VWKanBan.Create, L("Create"));
vwKanban.AddChild(SettleAccountPermissions.VWKanBan.Update, L("Update"));
vwKanban.AddChild(SettleAccountPermissions.VWKanBan.Delete, L("Delete"));
#endregion
#region 天合
var boms = myGroup.AddPermission(SettleAccountPermissions.Boms.Default, L("Boms"));
boms.AddChild(SettleAccountPermissions.Boms.Create, L("Create"));
boms.AddChild(SettleAccountPermissions.Boms.Update, L("Update"));
@ -114,7 +124,8 @@ namespace Win.Sfs.SettleAccount
var Reports = myGroup.AddPermission(SettleAccountPermissions.Reports.Default, L("Reports"));
Reports.AddChild(SettleAccountPermissions.Reports.Create, L("Create"));
Reports.AddChild(SettleAccountPermissions.Reports.Update, L("Update"));
Reports.AddChild(SettleAccountPermissions.Reports.Delete, L("Delete"));
Reports.AddChild(SettleAccountPermissions.Reports.Delete, L("Delete"));
#endregion
#region 车轮相关

16
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs

@ -12,7 +12,21 @@ namespace Win.Sfs.SettleAccount
public const string UpdateStr = "Update";
public const string DeleteStr = "Delete";
#region 派格
/// <summary>
/// 大众看板明细结算-权限
/// </summary>
public static class VWKanBan
{
public const string Default = GroupName + "." + nameof(VWKanBan);
public const string Create = Default + "." + CreateStr;
public const string Update = Default + "." + UpdateStr;
public const string Delete = Default + "." + DeleteStr;
}
#endregion
#region 天合
public static class Boms
{
public const string Default = GroupName + "." + nameof(Boms);
@ -242,7 +256,7 @@ namespace Win.Sfs.SettleAccount
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(SettleAccountPermissions));
}
#endregion

173
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs

@ -43,7 +43,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
//[AllowAnonymous]
[Route("api/settleaccount/Invoices")]
public class InvoiceAppService : SettleAccountApplicationBase<Invoice>
public class InvoiceAppService : SettleAccountApplicationBase<Invoice>,IInvoiceAppService
{
private readonly ISettleAccountBranchEfCoreRepository<Invoice, Guid> _repository;
@ -84,40 +84,51 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
//[Authorize(SettleAccountPermissions.Invoices.Default)]
public async Task<string> InvoiceUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode });
customConditionList.Add(new CustomCondition() { Name = "Factory", Value = customerCode });
var _taskid = await _service.ImportEnqueueAsync<ImportTaskArgs>(files, "发票数据导入", CurrentUser, typeof(InvoiceImportService), customConditionList, (rs) => {
});
return _taskid;
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<InvoiceImportDto>(files, _excelImportService);
var entityList = ObjectMapper.Map<List<InvoiceImportDto>, List<Invoice>>(result);
//删除版本
var _versionQuery = _versionRepository.Where(p => p.Version == version);
await _versionQuery.BatchDeleteAsync();
//删除明细
var _query = _repository.Where(p => p.Version == version);
await _query.BatchDeleteAsync();
var _id = GuidGenerator.Create();
var _bomList = new List<InvoiceVersion>();
_bomList.Add(new InvoiceVersion(_id, branchId, year, period, version, customerCode));
await _repository.GetDbContext().BulkInsertAsync<Invoice>(entityList);
await _versionRepository.GetDbContext().BulkInsertAsync(_bomList);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport-TH")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.Invoices.Default)]
public async Task<string> InvoiceUploadExcelImportTH([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version??string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SITE", Value = "TH" });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Factory", Value = customerCode ?? string.Empty });
var _taskid = await _service.ImportEnqueueAsync<ImportTaskArgs>(files, "发票数据导入", CurrentUser, typeof(InvoiceImportService), customConditionList,(rs) => {
var _versionQuery = _versionRepository.Where(p => p.Version == version);
_versionQuery.BatchDelete();
var _query = _repository.Where(p => p.Version == version);
_query.BatchDelete();
});
return _taskid;
}
//[HttpPost]
//[Route("ExcelImport-TH")]
//[DisableRequestSizeLimit]
////[Authorize(SettleAccountPermissions.Invoices.Default)]
//public async Task<string> InvoiceUploadExcelImportTH([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version??string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SITE", Value = "TH" });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "Factory", Value = customerCode ?? string.Empty });
// var _taskid = await _service.ImportEnqueueAsync<ImportTaskArgs>(files, "发票数据导入", CurrentUser, typeof(InvoiceImportService), customConditionList,(rs) => {
// var _versionQuery = _versionRepository.Where(p => p.Version == version);
// _versionQuery.BatchDelete();
// var _query = _repository.Where(p => p.Version == version);
// _query.BatchDelete();
// });
// return _taskid;
//}
@ -230,28 +241,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
var entity = await _repository.GetAsync(id);
if (entity != null)
{
//var _inventory = new Invoice(
// id,
// entity.BranchId,
// entity.MaterialCode,
// entity.MaterialDesc,
// input.InputQty,
// input.OutputQty,
// input.OpeningInventoryQty,
// input.EndingInventoryQty,
// entity.AppraisalCategory,
// entity.AppraisalDesc,
// entity.StorageLocation,
// entity.StorageLocationDesc,
// entity.Unit,
// entity.Price,
// entity.Year,
// entity.Period
//);
//await _repository.UpdateAsync(_inventory);
//update cache
await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES);
var dto = ObjectMapper.Map<Invoice, InvoiceDto>(entity);
@ -332,81 +322,38 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
//[Authorize(SettleAccountPermissions.Invoices.Default)]
virtual public async Task<string> ExportAsync(InvoiceRequestDto input)
{
string _fileName = string.Empty;
IExporter _excel = new ExcelExporter();
if (!string.IsNullOrEmpty(input.Site))
if (!string.IsNullOrEmpty(input.Version))
{
if (input.Site == "TH")
{
IExporter _excel = new ExcelExporter();
if (!string.IsNullOrEmpty(input.Version))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
}
var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<Invoice>, List<InvoiceTHExportDto>>(entities);
//声明导出容器
byte[] result = null;
_fileName = string.Format("发票明细_{0}.xlsx", _snowflakeIdGenerator.Create().ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
}
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
}
else
{
IExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
if (!string.IsNullOrEmpty(input.Version))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
}
var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<Invoice>, List<InvoiceTHExportDto>>(entities);
var dtoDetails = ObjectMapper.Map<List<Invoice>, List<InvoiceExportDto>>(entities);
//声明导出容器
//声明导出容器
byte[] result = null;
byte[] result = null;
string _fileName = string.Format("大众发票汇总_{0}.xlsx", _snowflakeIdGenerator.Create().ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
_fileName = string.Format("发票明细_{0}.xlsx", _snowflakeIdGenerator.Create().ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
}
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
}

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs

@ -313,7 +313,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
IExporter _excel = new ExcelExporter();
//2021-09-27 添加过滤条件
var output = "二配打印表" + input.Version + ".zip";

316
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWKanBan/VWKanBanAppService.cs

@ -0,0 +1,316 @@
using Magicodes.ExporterAndImporter.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.Filter;
using EFCore.BulkExtensions;
using Win.Sfs.SettleAccount.Constant;
using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.VWKanBanVersion;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Shouldly;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
/// <summary>
/// 大众看板结算明细导入
/// </summary>
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/VWKanBan")]
public class VWKanBanAppService : SettleAccountApplicationBase<KanBan>, IVWKanBanAppService
{
private readonly IGuidGenerator _guidGenerator;
private readonly IExcelImportAppService _excelImportService;
private readonly ISettleAccountBranchEfCoreRepository<KanBanVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<KanBan, Guid> _repository;
/// <summary>
/// 构建方法
/// </summary>
/// <param name="guidGenerator">构建UID</param>
/// <param name="repository">仓储接口</param>
/// <param name="cache">缓存</param>
public VWKanBanAppService(IGuidGenerator guidGenerator,
ISettleAccountBranchEfCoreRepository<KanBanVersion, Guid> versionRepository,
ISettleAccountBranchEfCoreRepository<KanBan, Guid> repository,
IDistributedCache<KanBan> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_versionRepository = versionRepository;
_guidGenerator = guidGenerator;
_excelImportService = excelImportService;
_repository = repository;
}
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> VWKanBanUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<VWKanBanImportDto>(files, _excelImportService);
var entityList = ObjectMapper.Map<List<VWKanBanImportDto>, List<KanBan>>(result);
//删除版本
var _versionQuery = _versionRepository.Where(p => p.Version == version);
await _versionQuery.BatchDeleteAsync();
//删除明细
var _query = _repository.Where(p => p.Version == version);
await _query.BatchDeleteAsync();
//插入数据前检验
var checkList = new List<ErrorExportDto>();
var _group = entityList.GroupBy(x => new { x.Kanban, x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), Kanban = p.Key.Kanban, MaterialCode = p.Key.MaterialCode });
foreach (var itm in _group)
{
if (itm.Count > 1)
{
checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的零件号{0},其看板条码号{1}有重复数据,请检查!", itm.MaterialCode, itm.Kanban), string.Empty));
}
}
var _id = GuidGenerator.Create();
var _bomList = new List<KanBanVersion>();
_bomList.Add(new KanBanVersion(_id, branchId, year, period, version, customerCode));
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
await _repository.GetDbContext().BulkInsertAsync<KanBan>(entityList);
await _versionRepository.GetDbContext().BulkInsertAsync(_bomList);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 按ID获取唯一实体
/// </summary>
/// <remarks>
/// 返回实体全部属性
/// </remarks>
/// <param name="id">ID</param>
/// <returns>实体DTO</returns>
[HttpGet]
[Route("{id}")]
[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<VWKanBanDto> GetAsync(Guid id)
{
var result = await GetFromCacheAsync(id);
var dto = ObjectMapper.Map<KanBan, VWKanBanDto>(result);
return dto;
}
private async Task<KanBan> GetFromCacheAsync(Guid id)
{
var result = await _repository.GetAsync(id);
return result;
}
private async Task<long> GetCountAsync(VWKanBanRequestDto input)
{
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
private async Task<long> GetCountAsync(VWKanBanVersionRequestDto input)
{
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
/// <summary>
/// 导出文件
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("Export")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> ExportAsync(VWKanBanRequestDto input)
{
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
if (input.ParentId != Guid.Empty)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<KanBan>, List<VWKanBanExportDto>>(entities);
string _fileName = string.Empty;
//声明导出容器
byte[] result = null;
switch (input.FileType)
{
case 0:
_fileName = string.Format("大众看板结算明细_{0}.csv", input.UserId.ToString());
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
_fileName = string.Format("大众看板结算明细_{0}.xlsx", input.UserId.ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("list")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<VWKanBanDto>> GetListAsync(Guid id, VWKanBanRequestDto input)
{
if (input.ParentId != Guid.Empty)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
}
else
{
return new PagedResultDto<VWKanBanDto>(0, new List<VWKanBanDto>());
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var dtos = ObjectMapper.Map<List<KanBan>, List<VWKanBanDto>>(entities);
return new PagedResultDto<VWKanBanDto>(totalCount, dtos);
}
/// <summary>
/// 获取实体总数
/// </summary>
/// <returns>实体总数</returns>
[HttpGet]
[Route("count")]
[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<long> GetTotalCountAsync(Guid branchId)
{
return await _repository.GetCountAsync(branchId);
}
/// <summary>
/// 获取全部实体列表
/// </summary>
/// <returns>实体DTO列表</returns>
[HttpGet]
[Route("all")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<ListResultDto<VWKanBanDto>> GetAllAsync(Guid branchId)
{
var entities = await _repository.GetAllAsync(branchId, true);
var dtos = ObjectMapper.Map<List<KanBan>, List<VWKanBanDto>>(entities);
return new ListResultDto<VWKanBanDto>(dtos);
}
/// <summary>
/// 删除实体
/// </summary>
/// <param name="id">ID</param>
/// <returns>无</returns>
[HttpDelete]
[Route("{id}")]
/// [Authorize(SettleAccountPermissions.SettleAccounts.Delete)]
virtual public async Task DeleteAsync(Guid id)
{
await _repository.DeleteAsync(id);
}
/// <summary>
/// 按IDs删除实体列表
/// </summary>
/// <param name="ids">IDs</param>
/// <returns>是否执行成功</returns>
[HttpPost]
[Route("delete")]
// [Authorize(SettleAccountPermissions.SettleAccounts.Delete)]
virtual public async Task<bool> DeleteListAsync(List<Guid> ids)
{
foreach (var id in ids)
{
var entity = await GetFromCacheAsync(id);
//await Cache.DeleteAsync<SettleAccount>(id.ToString());
}
return await _repository.DeleteListAsync(ids);
}
/// <summary>
/// 版本列表查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("listversion")]
public async Task<PagedResultDto<VWKanBanVersionDto>> GetVersionListAsync(VWKanBanVersionRequestDto input)
{
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var dtos = ObjectMapper.Map<List<KanBanVersion>, List<VWKanBanVersionDto>>(entities);
return new PagedResultDto<VWKanBanVersionDto>(totalCount, dtos);
}
}
}

87
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -672,13 +672,6 @@
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.Invoices.InvoiceAppService.InvoiceUploadExcelImportTH(Microsoft.AspNetCore.Http.IFormFileCollection,System.Guid,System.String,System.String,System.String,System.String,System.String)">
<summary>
导入功能
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.Invoices.InvoiceAppService.GetAsync(System.Guid)">
<summary>
按ID获取唯一实体
@ -1506,6 +1499,86 @@
<param name="action">生成任务后回调函数</param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService">
<summary>
大众看板结算明细导入
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.#ctor(Volo.Abp.Guids.IGuidGenerator,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.VWKanBan.KanBanVersion,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.VWKanBan.KanBan,System.Guid},Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.VWKanBan.KanBan},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<summary>
构建方法
</summary>
<param name="guidGenerator">构建UID</param>
<param name="repository">仓储接口</param>
<param name="cache">缓存</param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.VWKanBanUploadExcelImport(Microsoft.AspNetCore.Http.IFormFileCollection,System.Guid,System.String,System.String,System.String,System.String)">
<summary>
导入功能
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.GetAsync(System.Guid)">
<summary>
按ID获取唯一实体
</summary>
<remarks>
返回实体全部属性
</remarks>
<param name="id">ID</param>
<returns>实体DTO</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.ExportAsync(Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanRequestDto)">
<summary>
导出文件
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.GetListAsync(System.Guid,Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanRequestDto)">
<summary>
根据筛选条件获取实体列表
</summary>
<remarks>
请求条件包括:筛选条件列表,排序条件,数据数量,页码
</remarks>
<param name="input">请求条件</param>
<returns>实体DTO列表</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.GetTotalCountAsync(System.Guid)">
<summary>
获取实体总数
</summary>
<returns>实体总数</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.GetAllAsync(System.Guid)">
<summary>
获取全部实体列表
</summary>
<returns>实体DTO列表</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.DeleteAsync(System.Guid)">
<summary>
删除实体
</summary>
<param name="id">ID</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.DeleteListAsync(System.Collections.Generic.List{System.Guid})">
<summary>
按IDs删除实体列表
</summary>
<param name="ids">IDs</param>
<returns>是否执行成功</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService.GetVersionListAsync(Win.Sfs.SettleAccount.Entities.VWKanBanVersion.VWKanBanVersionRequestDto)">
<summary>
版本列表查询
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.FISes.FISAppService">
<summary>
区域相关应用服务

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

@ -75,6 +75,7 @@ using Win.Sfs.SettleAccount.Entities.SettlementPartss;
using Win.Sfs.SettleAccount.Entities.SettlementCrossReference;
using Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss;
using Win.Sfs.SettleAccount.Entities.SecMatch;
using Win.Sfs.SettleAccount.Entities.VWKanBan;
namespace Win.Sfs.SettleAccount
{
@ -185,8 +186,21 @@ namespace Win.Sfs.SettleAccount
CreateMapSettlementPakAndSpareParts();
CreateMapSettlementPakAndSparePartsVersion();
CreateMapSecMatchBaseDto();
CreateMapVWKanBan();
}
#region PG-派格映射
private void CreateMapVWKanBan()
{
CreateMap<KanBan, VWKanBanDto>().ReverseMap();
//CreateMap<MaterialRelationshipDetail, MaterialRelationshipDetailRequestDto>().ReverseMap();
//CreateMap<MaterialRelationshipDetail, MaterialRelationshipDetailImportDto>().ReverseMap();
//CreateMap<MaterialRelationshipDetail, MaterialRelationshipDetailExportDto>().ReverseMap();
}
#endregion
private void CreateMapMaterialRelationshipDetail()
@ -618,16 +632,16 @@ namespace Win.Sfs.SettleAccount
}
private void CreateMapSettleAccount()
{
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, SettleAccountDto>().ReverseMap();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, SettleAccountCreateDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, SettleAccountUpdateDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, VWKanBanDto>().ReverseMap();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, VWKanBanCreateDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, VWKanBantUpdateDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, SettleAccountExportDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, VWKanBanExportDto>();
CreateMap<SettleAccountCreateDto, Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
CreateMap<SettleAccountUpdateDto, Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
CreateMap<VWKanBanCreateDto, Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
CreateMap<VWKanBantUpdateDto, Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
}
private void CreateMapSettleAccountVersion()
@ -641,16 +655,16 @@ namespace Win.Sfs.SettleAccount
private void CreateMapUnSettleAccount()
{
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, SettleAccountDto>().ReverseMap();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, SettleAccountCreateDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, SettleAccountUpdateDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, VWKanBanDto>().ReverseMap();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, VWKanBanCreateDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, VWKanBantUpdateDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, SettleAccountExportDto>();
CreateMap<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount, VWKanBanExportDto>();
CreateMap<SettleAccountCreateDto, Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
CreateMap<SettleAccountUpdateDto, Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
CreateMap<VWKanBanCreateDto, Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
CreateMap<VWKanBantUpdateDto, Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
}
private void CreateMapUnSettleAccountVersion()

56
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/Invoice.cs

@ -12,21 +12,18 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
{
public Invoice()
{ }
public Invoice(Guid Id,string year, string period, string version, string factory, string textCode, string materialCode, string materialDesc, string date, decimal qty, decimal amt, string number, string accounting, DateTime accountDate):base(Id)
public Invoice(Guid Id,string year, string period, string version, string factory,
string materialCode, string materialDesc, decimal qty,
decimal amt):base(Id)
{
Year = year;
Period = period;
Version = version;
Factory = factory;
TextCode = textCode;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
InputDate = date;
Qty = qty;
Amt = amt;
Number = number;
Accounting = accounting;
AccountDate = accountDate;
}
//过账日期 物料 物料描述 数量 单位 金额 工厂 工厂名称 物料凭证 物料凭证的年份 货币 项目
@ -54,8 +51,8 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
/// <summary>
/// 入库文本号
/// </summary>
[Display(Name = "入库文本号")]
public string TextCode { set; get; }
//[Display(Name = "入库文本号")]
//public string TextCode { set; get; }
/// <summary>
/// 零件号
@ -69,11 +66,11 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
[Display(Name = "零件名称")]
public string MaterialDesc { get; set; }
/// <summary>
/// 入库日期
/// </summary>
[Display(Name = "入库日期")]
public string InputDate { get; set; }
///// <summary>
///// 入库日期
///// </summary>
//[Display(Name = "入库日期")]
//public string InputDate { get; set; }
/// <summary>
/// 数量
@ -87,23 +84,30 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
[Display(Name = "金额")]
public decimal Amt { set; get; }
/// <summary>
/// 记账号码
/// </summary>
[Display(Name = "记账号码")]
public string Number { set; get; }
/// <summary>
/// 记账人员
/// 备注
/// </summary>
[Display(Name = "记账人员")]
public string Accounting { set; get; }
[Display(Name = "备注")]
public string Remark { set; get; }
/// <summary>
/// 记账日期
/// </summary>
[Display(Name = "记账日期")]
public DateTime AccountDate { set; get; }
///// <summary>
///// 记账号码
///// </summary>
//[Display(Name = "记账号码")]
//public string Number { set; get; }
///// <summary>
///// 记账人员
///// </summary>
//[Display(Name = "记账人员")]
//public string Accounting { set; get; }
///// <summary>
///// 记账日期
///// </summary>
//[Display(Name = "记账日期")]
//public DateTime AccountDate { set; get; }
}
}

4
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/InvoiceVersion.cs

@ -28,18 +28,16 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
public string CustomerCode { private set; get; }
public string Factory { private set; get; }
public InvoiceVersion(
Guid id,
Guid branchId,
string year, string period, string version, string customerCode, string factory) : base(id)
string year, string period, string version, string customerCode) : base(id)
{
BranchId = branchId;
Year = year;
Period = period;
Version = version;
CustomerCode = customerCode;
Factory = factory;
}
}

86
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/KanBan/KanBan.cs

@ -4,8 +4,9 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.KanBan
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
@ -26,8 +27,22 @@ namespace Win.Sfs.SettleAccount.Entities.KanBan
*
*
*/
public class KanBan
public class KanBan : 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>
@ -37,7 +52,7 @@ namespace Win.Sfs.SettleAccount.Entities.KanBan
/// <summary>
/// 入库关联号
/// </summary>
public string Relation { set; get; }
/// <summary>
/// 工厂
@ -88,12 +103,69 @@ namespace Win.Sfs.SettleAccount.Entities.KanBan
/// <summary>
/// 结算状态
/// </summary>
[Display(Name ="结算状态")]
[Display(Name = "结算状态")]
public int State { set; get; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "备注")]
public string Remark { set; get; }
public Guid ParentId { get; protected set; }
public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId)
{
Period = peroid;
Year = year;
Id = guid;
Version = version;
BranchId = branchId;
ParentId = parentId;
}
public KanBan()
{ }
public KanBan(
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,
int state,
string remark,
Guid parentId,
DateTime creationTime,
Guid guid) : base(id)
{
BranchId = branchId;
Year = year;
Kanban = kanban;
Relation = relation;
Factory = factory;
MaterialCode = materialCode;
PartType = partType;
SettleInputDate = settleInputDate;
SupplierCode = supplierCode;
Qty = qty;
Batch = batch;
Flag = flag;
SettleDate = settleDate;
State = state;
Remark = remark;
ParentId = parentId;
CreationTime = creationTime;
CreatorId = guid;
}

34
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/KanBan/KanBanManager.cs

@ -0,0 +1,34 @@
using EFCore.BulkExtensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public class KanBanManager:DomainService
{
private readonly ISettleAccountBranchEfCoreRepository<KanBan, Guid> _repository;
private readonly ISettleAccountBranchEfCoreRepository<KanBanVersion, Guid> _versionRepository;
public KanBanManager(
ISettleAccountBranchEfCoreRepository<KanBan, Guid> repository,
ISettleAccountBranchEfCoreRepository<KanBanVersion, Guid> versionRepository
)
{
_versionRepository = versionRepository;
_repository = repository;
}
}
}

51
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/KanBan/KanBanVersion.cs

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Guids;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.VWKanBan
{
public class KanBanVersion : FullAuditedAggregateRootBase<Guid>,ISettleAccountEntityBase
{
public KanBanVersion()
{ }
public string Year { get; private set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; private set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { private set; get; }
public KanBanVersion(
Guid id,
Guid branchId,
string year, string period, string version, string customerCode) : base(id)
{
BranchId = branchId;
Year = year;
Period = period;
Version = version;
CustomerCode = customerCode;
}
}
}

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

@ -62,6 +62,7 @@ using Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartsRef;
using Win.Sfs.SettleAccount.Entities.SettlementCrossReferences;
using Win.Sfs.SettleAccount.Entities.SettlementCrossReference;
using Win.Sfs.SettleAccount.Entities.SecMatch;
using Win.Sfs.SettleAccount.Entities.VWKanBan;
namespace Win.Sfs.SettleAccount
{
@ -80,9 +81,9 @@ namespace Win.Sfs.SettleAccount
SettleAccountDbProperties.DbSchema
);
// optionsAction?.Invoke(options);
// optionsAction?.Invoke(options);
#region old
//产品结构
builder.ConfigureBom(options);
@ -261,10 +262,71 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureSettlementPakAndSparePartsVersion(options);
builder.ConfigureSecMatchBase(options);
#endregion
}
#region PG-派格
/// <summary>
/// 大众看板结算明细导入表结构
/// </summary>
/// <param name="builder"></param>
/// <param name="options"></param>
private static void ConfigureKanBanVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<KanBan>(b =>
{
b.ToTable($"{options.TablePrefix}_VWKanBan", options.Schema);
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.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
});
}
/// <summary>
/// 大众发票汇总导入
/// </summary>
/// <param name="builder"></param>
/// <param name="options"></param>
private static void ConfigureInvoice(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<Invoice>(b =>
{
b.ToTable($"{options.TablePrefix}_Invoice", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Year).HasMaxLength(50);
b.Property(x => x.Period).HasMaxLength(50);
b.Property(x => x.Version).HasMaxLength(50);
b.Property(x => x.Factory).HasMaxLength(50);
b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(50);//零件号不能为空
b.Property(x => x.MaterialDesc).HasMaxLength(50);
b.Property(x => x.Remark).HasMaxLength(1000);
});
}
#endregion
#region old
private static void ConfigureHangfire(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<Job>(b =>
@ -1913,29 +1975,7 @@ namespace Win.Sfs.SettleAccount
});
}
private static void ConfigureInvoice(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<Invoice>(b =>
{
b.ToTable($"{options.TablePrefix}_Invoice", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Year).HasMaxLength(50);
b.Property(x => x.Period).HasMaxLength(50);
b.Property(x => x.Version).HasMaxLength(50);
b.Property(x => x.Factory).HasMaxLength(50);
b.Property(x => x.TextCode).HasMaxLength(50);
b.Property(x => x.MaterialCode).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(50);
b.Property(x => x.InputDate).HasMaxLength(50);
b.Property(x => x.Number).HasMaxLength(50);
b.Property(x => x.Accounting).HasMaxLength(50);
b.Property(x => x.AccountDate).HasMaxLength(50);
});
}
private static void ConfigureInvoiceVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
@ -1950,7 +1990,7 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.Period).HasMaxLength(50);
b.Property(x => x.Version).HasMaxLength(50);
b.Property(x => x.CustomerCode).HasMaxLength(50);
b.Property(x => x.Factory).HasMaxLength(50);
// b.Property(x => x.Factory).HasMaxLength(50);
});
}
@ -2135,7 +2175,7 @@ namespace Win.Sfs.SettleAccount
});
}
#endregion
}
}

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceRepository.cs

@ -42,9 +42,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount
if (list.Count > 0)
{
var _version = list.FirstOrDefault().Version;
var _ls = GetQueryable().Where(p => p.Version == _version).Select(p => new { MaterialCode = p.MaterialCode,TextCode= p.TextCode }).ToList();
var _ls = GetQueryable().Where(p => p.Version == _version).Select(p => new { MaterialCode = p.MaterialCode}).ToList();
var _query = from r1 in list
join r2 in _ls on new { r1.TextCode,r1.MaterialCode } equals new { r2.TextCode, r2.MaterialCode }
join r2 in _ls on new {r1.MaterialCode } equals new { r2.MaterialCode }
into temp
from t in temp.DefaultIfEmpty()
where t == null

2
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceVersionRepository.cs

@ -40,7 +40,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount
var _first = GetQueryable().FirstOrDefault(p => p.Version == p_version);
if (_first == null)
{
var _version = new InvoiceVersion(GuidGenerator.Create(), GuidGenerator.Create(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), p_version, p_customCode, p_factory);
var _version = new InvoiceVersion(GuidGenerator.Create(), GuidGenerator.Create(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), p_version, p_customCode);
List<InvoiceVersion> _ls = new List<InvoiceVersion>();
_ls.Add(_version);
DbContext.BulkInsert(_ls);

80
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Invoices/InvoiceImportService.cs

@ -66,90 +66,16 @@ namespace TaskJob.Services
List<Invoice> _setls = new List<Invoice>();
List<string> _errorList = new List<string>();
var _id = Guid.NewGuid();
if (Site == "TH")
{
var dtoList = _inputService.Input<InvoiceTHImportDto>(filePath);
foreach (var dto in dtoList)
{
var _invoice = new Invoice(Guid.NewGuid(),DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(),version,dto.Factory,dto.TextCode, dto.MaterialCode, dto.MaterialDesc,dto.AccountDate.ToString(), dto.Qty, dto.Amt,dto.Number,dto.Accounting,dto.AccountDate);
var _invoice = new Invoice(Guid.NewGuid(),DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(),version,dto.Factory,dto.MaterialCode, dto.MaterialDesc, dto.Qty, dto.Amt);
_setls.Add(_invoice);
}
_repository.Insert(_setls);
_versionRepository.Insert(version, customerCode, customerCode);
}
else
{
try
{
List<string> _precodeList = new List<string>();//
using (TextReader textReader = new StreamReader(filePath))
{
int i = 0;
while (true)
{
string str = textReader.ReadLine();
if (string.IsNullOrEmpty(str))
{
break;
}
else
{
try
{
var _lst = str.Split(new char[] { '|' }).ToList();
var _factory = _lst[1].Trim();
var _textCode = _lst[2].Trim();
var _remark = _lst[3].Trim();
var _materialCode = _lst[4].Trim();
var _materialDesc = _lst[5].Trim();
var _date = _lst[6].Trim();
var _qty = decimal.Parse(_lst[7].Trim());
var _amt = decimal.Parse(_lst[8].Trim());
//var _number = _lst[9].Trim();
//var _accounting = _lst[10].Trim();
//var _accountDate = _lst[11].Trim();
_setls.Add(new Invoice(Guid.NewGuid()
, DateTime.Now.Year.ToString()
, DateTime.Now.Month.ToString()
, version
, customerCode
, _textCode
, _materialCode
, _materialDesc
, _date
, _qty
, _amt
, string.Empty
, string.Empty
,DateTime.Now/* _date*/
//,_number
//,_accounting
//,_accountDate
));
}
catch
{
}
}
i++;
}
textReader.Close();
}
var _ls = _setls;
var query = from arc in _ls
group arc by new { arc.TextCode, arc.MaterialCode }
into g
where g.Count() > 1
select g;
_repository.Insert(_setls);
_versionRepository.Insert(version, customerCode, customerCode);
}
catch (Exception e)
{
throw e;
}
}
}
return taskid.ToString();
}

Loading…
Cancel
Save