wanggang 1 year ago
parent
commit
32461cdc5e
  1. 68
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  2. 46
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  3. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  4. 7
      docs/demo/src/WTA.Application/Identity/Data/IdentityDbSeed.cs
  5. 2
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/BOM.cs
  6. 2
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/CentralizedControl.cs
  7. 2
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/PURCHASE_PRICE.cs
  8. 2
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/TB_PRICE_LIST.cs

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

@ -1,9 +1,6 @@
using System; using Magicodes.ExporterAndImporter.Core;
using System.Collections.Generic; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
@ -35,9 +32,66 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// <summary> /// <summary>
/// 导入 /// 导入
/// </summary> /// </summary>
public class PUB_SA_IMPORT_DTO public class ZGJ_PUB_SA_DETAIL_IMPORT_DTO
{ {
///// <summary>
///// 期间
///// </summary>
//public int Version { set; get; }
///// <summary>
///// 单价
///// </summary>
//public decimal Price { set; get; }
///// <summary>
///// 结算单
///// </summary>
//public string BillNum { set; get; }
/// <summary>
/// 结算日期
/// </summary>
[ImporterHeader(Name = "Pstng Date")]
public DateTime SettleDate { set; get; }
/// <summary>
/// 零件号
/// </summary>
[ImporterHeader(Name = "Material")]
public string LU { get; set; }
/// <summary>
/// 生产号
/// </summary>
[ImporterHeader(Name = "External Delivery ID")]
public string PN { get; set; }
///// <summary>
///// 组合键值(LU+PN)
///// </summary>
//public string KeyCode
//{
// get => LU + PN;
//}
///// <summary>
/// 数量
/// </summary>
[ImporterHeader(Name = "Quantity")]
public decimal Qty { get; set; }
/// <summary>
/// 结算分组号
/// </summary>
[ImporterHeader(Name = "Delivery")]
public string GroupNum { get; set; }
/////// <summary>
/////// 工厂地点
/////// </summary>
////[Display(Name = "工厂地点")]
////public string Site { get; set; }
} }
/// <summary> /// <summary>

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

@ -1,10 +1,12 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using NPOI.Util;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Shouldly; using Shouldly;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching; using Volo.Abp.Caching;
@ -23,37 +25,69 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class PUB_SA_SERVICE : SettleAccountApplicationBase<TB_RePartsRelationship> public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
/// <summary> /// <summary>
/// PUB结算仓储 /// PUB结算仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PUB_SA, Guid> _repository; private readonly INormalEfCoreRepository<PUB_SA, Guid> _repository;
/// <summary>
/// PUB结算明细仓储
/// </summary>
private readonly INormalEfCoreRepository<PUB_SA_DETAIL, Guid> _pubSaDetailRepository;
/// <summary> /// <summary>
/// 构造 /// 构造
/// </summary> /// </summary>
public PUB_SA_SERVICE(INormalEfCoreRepository<PUB_SA, Guid> repository, public PUB_SA_SERVICE(INormalEfCoreRepository<PUB_SA, Guid> repository,
IDistributedCache<TB_RePartsRelationship> cache, INormalEfCoreRepository<PUB_SA_DETAIL, Guid> pubSaDetailRepository,
IDistributedCache<PUB_SA> cache,
IExcelImportAppService excelImportService, IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{ {
_repository = repository; _repository = repository;
_pubSaDetailRepository = pubSaDetailRepository;
} }
#region 直供件
#endregion
#region 导入、导出 #region 导入、导出
/// <summary> /// <summary>
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) public async Task<string> ZGJImportAsync([FromForm] IFormFileCollection files)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<PUB_SA_IMPORT_DTO>(files, _excelImportService); var result = await _exportImporter.UploadExcelImport<ZGJ_PUB_SA_DETAIL_IMPORT_DTO>(files, _excelImportService);
var _ls = ObjectMapper.Map<List<PUB_SA_IMPORT_DTO>, List<PUB_SA>>(result); var _ls = ObjectMapper.Map<List<ZGJ_PUB_SA_DETAIL_IMPORT_DTO>, List<PUB_SA_DETAIL>>(result);
await _repository.InsertManyAsync(_ls);
var billNum = GuidGenerator.Create().ToString();
var pubSa = new PUB_SA()
{
BillNum = billNum,
State = "1"
};
_ls.ForEach(s =>
{
string[] luArr = s.LU.Split(" ");
var lus = luArr.Reverse();
var result = lus.Aggregate(" ", (current, index) => current + index);
//s.LU = s.LU.Replace(" ", "").Replace(" ", " ");
s.BillNum = billNum;
s.Site = "直供件";
s.KeyCode = s.LU + s.PN;
});
//await _repository.InsertAsync(pubSa);
//await _pubSaDetailRepository.InsertManyAsync(_ls);
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;
} }

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -819,6 +819,8 @@ namespace Win.Sfs.SettleAccount
private void CreateMapPUB_SA() private void CreateMapPUB_SA()
{ {
CreateMap<PUB_SA, PUB_SA_DTO>(); CreateMap<PUB_SA, PUB_SA_DTO>();
CreateMap<ZGJ_PUB_SA_DETAIL_IMPORT_DTO, PUB_SA_DETAIL>();
} }
} }

7
docs/demo/src/WTA.Application/Identity/Data/IdentityDbSeed.cs

@ -176,16 +176,9 @@ public class IdentityDbSeed : IDbSeed<IdentityDbContext>
context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "1号测试数据" }); context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "1号测试数据" });
context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "2号测试数据" }); context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "2号测试数据" });
context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "3号测试数据" }); context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "3号测试数据" });
context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "一号测试数据" });
context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "二号测试数据" });
context.Set<PUB_SA>().Add(new PUB_SA { Version = "测试数据", State = "测试数据", BillNum = "三号测试数据" });
context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "1号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" }); context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "1号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" });
context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "2号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" }); context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "2号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" });
context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "3号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" }); context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "3号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" });
context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "一号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" });
context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "二号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" });
context.Set<PUB_SA_DETAIL>().Add(new PUB_SA_DETAIL { KeyCode = "测试数据", Version = "测试数据", BillNum = "三号测试数据", LU = "测试数据", PN = "测试数据", Site = "测试数据", InvGroupNum = "测试数据", SettleDate = new DateTime(), Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", GroupNum = "测试数据" });
} }
private static void InitDictionaries(DbContext context) private static void InitDictionaries(DbContext context)

2
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/BOM.cs

@ -6,7 +6,7 @@ namespace WTA.Application.Identity.Entities.SystemManagement;
[SystemManagement] [SystemManagement]
[Display(Name = "BOM结构")] [Display(Name = "BOM结构")]
[Order(9)] [Order(11)]
public class BOM : BaseEntity public class BOM : BaseEntity
{ {
} }

2
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/CentralizedControl.cs

@ -4,7 +4,7 @@ using WTA.Shared.Domain;
namespace WTA.Application.Identity.Entities.SystemManagement; namespace WTA.Application.Identity.Entities.SystemManagement;
[Order(11)] [Order(9)]
[SystemManagement] [SystemManagement]
[Display(Name = "期间设置")] [Display(Name = "期间设置")]
public class CentralizedControl : BaseEntity public class CentralizedControl : BaseEntity

2
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/PURCHASE_PRICE.cs

@ -5,7 +5,7 @@ using WTA.Shared.Domain;
namespace WTA.Application.Identity.Entities.SystemManagement; namespace WTA.Application.Identity.Entities.SystemManagement;
[SystemManagement] [SystemManagement]
[Display(Name = "采购价格单")] [Display(Name = "采购价格单")]
[Order(14)] [Order(12)]
public class PURCHASE_PRICE : BaseEntity public class PURCHASE_PRICE : BaseEntity
{ {
} }

2
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/TB_PRICE_LIST.cs

@ -4,7 +4,7 @@ using WTA.Shared.Domain;
namespace WTA.Application.Identity.Entities.SystemManagement; namespace WTA.Application.Identity.Entities.SystemManagement;
[Order(12)] [Order(14)]
[SystemManagement] [SystemManagement]
[Display(Name = "销售价格单")] [Display(Name = "销售价格单")]
public class TB_PRICE_LIST : BaseEntity public class TB_PRICE_LIST : BaseEntity

Loading…
Cancel
Save