学 赵
1 year ago
17 changed files with 4511 additions and 166 deletions
@ -0,0 +1,51 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos |
|||
{ |
|||
/// <summary>
|
|||
/// PUB结算
|
|||
/// </summary>
|
|||
public class PUB_SA_DTO : EntityDto<Guid> |
|||
{ |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
[Display(Name = "期间")] |
|||
public int Version { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 结算单据
|
|||
/// </summary>
|
|||
[Display(Name = "结算单据")] |
|||
public string BillNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 状态
|
|||
/// </summary>
|
|||
[Display(Name = "状态")] |
|||
public string State { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 导入
|
|||
/// </summary>
|
|||
public class PUB_SA_IMPORT_DTO |
|||
{ |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 导出
|
|||
/// </summary>
|
|||
public class PUB_SA_EXPORT_DTO |
|||
{ |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,103 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using SettleAccount.Domain.BQ; |
|||
using Shouldly; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Caching; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.RepositoryBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.BQ |
|||
{ |
|||
/// <summary>
|
|||
/// PUB结算
|
|||
/// </summary>
|
|||
[AllowAnonymous] |
|||
[Route("api/settleaccount/[controller]/[action]")]
|
|||
public class PUB_SA_SERVICE : SettleAccountApplicationBase<TB_RePartsRelationship> |
|||
{ |
|||
/// <summary>
|
|||
/// PUB结算仓储
|
|||
/// </summary>
|
|||
private readonly INormalEfCoreRepository<PUB_SA, Guid> _repository; |
|||
|
|||
/// <summary>
|
|||
/// 构造
|
|||
/// </summary>
|
|||
public PUB_SA_SERVICE(INormalEfCoreRepository<PUB_SA, Guid> repository, |
|||
IDistributedCache<TB_RePartsRelationship> cache, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager |
|||
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
|
|||
#region 导入、导出
|
|||
/// <summary>
|
|||
/// 导入
|
|||
/// </summary>
|
|||
[HttpPost] |
|||
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) |
|||
{ |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<PUB_SA_IMPORT_DTO>(files, _excelImportService); |
|||
var _ls = ObjectMapper.Map<List<PUB_SA_IMPORT_DTO>, List<PUB_SA>>(result); |
|||
await _repository.InsertManyAsync(_ls); |
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 导出
|
|||
/// </summary>
|
|||
[HttpPost] |
|||
public async Task<string> ExportAsync(RequestDto input) |
|||
{ |
|||
string fileName = $"HBPO的EDI数据_{Guid.NewGuid()}.xlsx"; |
|||
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); |
|||
var dtos = ObjectMapper.Map<List<PUB_SA>, List<PUB_SA_EXPORT_DTO>>(entities); |
|||
|
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.ExcelExporter(dtos); |
|||
result.ShouldNotBeNull(); |
|||
|
|||
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); |
|||
return fileName; |
|||
} |
|||
#endregion
|
|||
|
|||
#region CURD
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
[HttpPost] |
|||
public async Task<PagedResultDto<PUB_SA_DTO>> GetListAsync(RequestDto input) |
|||
{ |
|||
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); |
|||
var totalCount = await _repository.GetCountByFilterAsync(input.Filters); |
|||
var dtos = ObjectMapper.Map<List<PUB_SA>, List<PUB_SA_DTO>>(entities); |
|||
return new PagedResultDto<PUB_SA_DTO>(totalCount, dtos); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除
|
|||
/// </summary>
|
|||
[HttpPost] |
|||
public async Task DeleteAsync(Guid id) |
|||
{ |
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
#endregion
|
|||
|
|||
} |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,206 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Migrations |
|||
{ |
|||
public partial class _202307131 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<int>( |
|||
name: "State", |
|||
table: "Set_INVOICE_GRP", |
|||
type: "int", |
|||
nullable: false, |
|||
defaultValue: 0); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Extend1", |
|||
table: "Set_HBPO_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Extend2", |
|||
table: "Set_HBPO_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Extend3", |
|||
table: "Set_HBPO_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Extend4", |
|||
table: "Set_HBPO_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Site", |
|||
table: "Set_HBPO_SE_EDI", |
|||
type: "nvarchar(max)", |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<int>( |
|||
name: "State", |
|||
table: "Set_HBPO_CAN_SA", |
|||
type: "int", |
|||
maxLength: 50, |
|||
nullable: false, |
|||
defaultValue: 0, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(50)", |
|||
oldMaxLength: 50, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Extend1", |
|||
table: "Set_BBAC_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Extend2", |
|||
table: "Set_BBAC_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Extend3", |
|||
table: "Set_BBAC_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Extend4", |
|||
table: "Set_BBAC_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Site", |
|||
table: "Set_BBAC_SE_EDI", |
|||
type: "nvarchar(max)", |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<int>( |
|||
name: "State", |
|||
table: "Set_BBAC_CAN_SA", |
|||
type: "int", |
|||
maxLength: 50, |
|||
nullable: false, |
|||
defaultValue: 0, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(50)", |
|||
oldMaxLength: 50, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "Set_CodeSetting", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Project = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Value = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Description = 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_CodeSetting", x => x.Id); |
|||
}); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "Set_CodeSetting"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "State", |
|||
table: "Set_INVOICE_GRP"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Extend1", |
|||
table: "Set_HBPO_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Extend2", |
|||
table: "Set_HBPO_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Extend3", |
|||
table: "Set_HBPO_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Extend4", |
|||
table: "Set_HBPO_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Site", |
|||
table: "Set_HBPO_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Extend1", |
|||
table: "Set_BBAC_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Extend2", |
|||
table: "Set_BBAC_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Extend3", |
|||
table: "Set_BBAC_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Extend4", |
|||
table: "Set_BBAC_SE_EDI"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Site", |
|||
table: "Set_BBAC_SE_EDI"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "State", |
|||
table: "Set_HBPO_CAN_SA", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true, |
|||
oldClrType: typeof(int), |
|||
oldType: "int", |
|||
oldMaxLength: 50); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "State", |
|||
table: "Set_BBAC_CAN_SA", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true, |
|||
oldClrType: typeof(int), |
|||
oldType: "int", |
|||
oldMaxLength: 50); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue