Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
郑勃旭 1 year ago
parent
commit
d54035ae14
  1. 6
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml
  2. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/CustomerItems/ICustomerItemAppService.cs
  3. 12
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAppService.cs
  4. 7
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs
  5. 16
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransType.cs
  6. 22
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Statuses/EnumRequestStatus.cs
  7. 35
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumInjectionModelType.cs
  8. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs
  9. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs
  10. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteEditInput.cs
  11. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteImportInput.cs
  12. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/DTOs/MesNoteDTO.cs
  13. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/Inputs/MesNoteEditInput.cs
  14. 17
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/DTOs/InjectioModelPlanDTO.cs
  15. 15
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/Inputs/InjectioModelPlanEditInput.cs
  16. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDTO.cs
  17. 29
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs
  18. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs
  19. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAppService.cs
  20. 35
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs
  21. 60
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs
  22. 36
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs
  23. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/InjectioModelPlans/InjectioModelPlanAppService.cs
  24. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs
  25. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs
  26. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
  27. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs
  28. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/MesNotes/MesNote.cs
  29. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/InjectioModelPlans/InjectioModelPlan.cs
  30. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs
  31. 77
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs
  32. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteDbContextModelCreatingExtensions.cs
  33. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Plans/InjectioModelPlans/InjectioModelPlanDbContextModelCreatingExtensions.cs
  34. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs
  35. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/NoOkConvertOKNoteAutoMapperProfile.cs
  36. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs
  37. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs
  38. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs
  39. 153
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
  40. 57
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/MesNoteEventHandler.cs
  41. 166
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

6
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml

@ -10,8 +10,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform> <LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider> <PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net6.0\publish\</PublishUrl> <PublishUrl>D:\发布\WMS\store</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod> <WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId> <_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net6.0</TargetFramework>
<ProjectGuid>488eeada-cfed-4016-9884-7a1dcbe5eb9c</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/CustomerItems/ICustomerItemAppService.cs

@ -1,3 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
namespace Win_in.Sfs.Basedata.Application.Contracts; namespace Win_in.Sfs.Basedata.Application.Contracts;
@ -7,5 +10,5 @@ public interface ICustomerItemAppService
, ISfsUpsertAppService<CustomerItemEditInput> , ISfsUpsertAppService<CustomerItemEditInput>
{ {
Task<List<CustomerItem>> GetListByPartsAsync(List<string> inputs);
} }

12
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAppService.cs

@ -1,8 +1,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Basedata.Domain;
@ -36,7 +39,6 @@ public class CustomerItemAppService : SfsBaseDataAppServiceBase<CustomerItem, Cu
} }
[HttpPost("upsert")] [HttpPost("upsert")]
public virtual async Task UpsertAsync(CustomerItemEditInput input) public virtual async Task UpsertAsync(CustomerItemEditInput input)
{ {
var entity = ObjectMapper.Map<CustomerItemEditInput, CustomerItem>(input); var entity = ObjectMapper.Map<CustomerItemEditInput, CustomerItem>(input);
@ -48,4 +50,12 @@ public class CustomerItemAppService : SfsBaseDataAppServiceBase<CustomerItem, Cu
await base.CheckItemBasicItemCodeAsync(importInput.ItemCode, validationRresult).ConfigureAwait(false); await base.CheckItemBasicItemCodeAsync(importInput.ItemCode, validationRresult).ConfigureAwait(false);
await base.CheckCustomerCodeAsync(importInput.CustomerCode, validationRresult).ConfigureAwait(false); await base.CheckCustomerCodeAsync(importInput.CustomerCode, validationRresult).ConfigureAwait(false);
} }
[HttpPost("get-part-list")]
public virtual async Task<List<CustomerItem>> GetListByPartsAsync(List<string> inputs)
{
return await _repository.WithDetails().Where(p => inputs.Contains(p.ItemCode)).ToListAsync().ConfigureAwait(false);
}
} }

7
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs

@ -214,12 +214,7 @@ public enum EnumTransSubType
/// </summary> /// </summary>
[Display(Name = "导入盘点计划")] [Display(Name = "导入盘点计划")]
ExcelInCountPlan = 6002, ExcelInCountPlan = 6002,
[Display(Name = "MES冻结")]
MesFreeze = 10001,
[Display(Name = "MES解冻")]
MesUnFreeze = 10002,
[Display(Name = "MES不合格")]
MesUnQualified = 10003

16
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransType.cs

@ -161,5 +161,21 @@ public enum EnumTransType
/// <summary>
/// MES冻结
/// </summary>
[Display(Name = "Mes冻结")]
MesFreezed= 40,
/// <summary>
/// MES冻结
/// </summary>
[Display(Name = "Mes解冻")]
MesUnFreezed = 41,
} }

22
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Statuses/EnumRequestStatus.cs

@ -65,17 +65,17 @@ public enum EnumRequestStatus
Partial = 9, Partial = 9,
/// <summary> ///// <summary>
/// 部分完成 ///// 部分完成
/// </summary> ///// </summary>
[Display(Name = "已过时")] //[Display(Name = "已过时")]
Deprecated = 10, //Deprecated = 11,
/// <summary> ///// <summary>
/// 有更新 ///// 有更新
/// </summary> ///// </summary>
[Display(Name = "有更新")] //[Display(Name = "有更新")]
Updated = 10, //Updated = 10,

35
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumInjectionModelType.cs

@ -0,0 +1,35 @@
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Shared.Domain.Shared;
public enum EnumInjectionModelStatus
{
/// <summary>
/// 有更新
/// </summary>
[Display(Name = "有更新")]
Updated = 10,
/// <summary>
/// 执行中
/// </summary>
[Display(Name = "执行中")]
Handling = 5,
/// <summary>
/// 部分完成
/// </summary>
[Display(Name = "已过时")]
Deprecated = 11,
/// <summary>
/// 已完成
/// </summary>
[Display(Name = "已完成")]
Completed = 6,
/// <summary>
/// 新增
/// </summary>
[Display(Name = "新增")]
New = 1
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs

@ -7,5 +7,5 @@ public interface IProductRecycleJobAppService
: ISfsJobAppServiceBase<ProductRecycleJobDTO, SfsJobRequestInputBase, ProductRecycleJobCheckInput, ProductRecycleJobEditInput> : ISfsJobAppServiceBase<ProductRecycleJobDTO, SfsJobRequestInputBase, ProductRecycleJobCheckInput, ProductRecycleJobEditInput>
{ {
Task<ProductRecycleJobDTO> CompleteByRequestNumberAsync(string number);
} }

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs

@ -15,6 +15,14 @@ public class CustomerProductionReturnNoteDTO : SfsStoreDTOBase<CustomerProductio
[Display(Name = "任务ID")] [Display(Name = "任务ID")]
public string JobNumber { get; set; } public string JobNumber { get; set; }
/// <summary>
///客户编码
/// </summary>
[Display(Name = "客户编码")]
public string CustomerCode { get; set; }
/// <summary> /// <summary>
/// 退料单号 /// 退料单号
/// </summary> /// </summary>

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteEditInput.cs

@ -23,6 +23,14 @@ public class CustomerProductionReturnNoteEditInput : SfsStoreCreateOrUpdateInput
[Display(Name = "退料时间")] [Display(Name = "退料时间")]
public DateTime ReturnTime { get; set; } public DateTime ReturnTime { get; set; }
/// <summary>
///客户编码
/// </summary>
[Display(Name = "客户编码")]
public string CustomerCode { get; set; }
/// <summary> /// <summary>
/// 退料申请单号 /// 退料申请单号
/// </summary> /// </summary>

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteImportInput.cs

@ -26,6 +26,14 @@ public class CustomerProductionReturnNoteImportInput : SfsStoreImportInputBase
[Display(Name = "退料单号")] [Display(Name = "退料单号")]
public string ProductionReturnRequestNumber { get; set; } public string ProductionReturnRequestNumber { get; set; }
/// <summary>
///客户编码
/// </summary>
[Display(Name = "客户编码")]
public string CustomerCode { get; set; }
/// <summary> /// <summary>
/// 采购订单号 /// 采购订单号
/// </summary> /// </summary>

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/DTOs/MesNoteDTO.cs

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -12,7 +13,7 @@ public class MesNoteDTO : SfsStoreDTOBase<MesNoteDetailDTO>, IHasNumber
public string JobNumber { get; set; } public string JobNumber { get; set; }
/// <summary> /// <summary>
/// 类型 /// Mes类型(40-冻结、41-解冻 )
/// </summary> /// </summary>
[Display(Name = "类型")] [Display(Name = "类型")]
public string Type { get; set; } public string Type { get; set; }

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/Inputs/MesNoteEditInput.cs

@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store.Types; using Win_in.Sfs.Shared.Domain.Shared.Enums.Store.Types;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -28,7 +29,7 @@ public class MesNoteEditInput : SfsStoreCreateOrUpdateInputBase
public string MesRequestNumber { get; set; } public string MesRequestNumber { get; set; }
/// <summary> /// <summary>
/// 报废类型 /// Mes类型(40-冻结、41-解冻 )
/// </summary> /// </summary>
[Display(Name = "类型")] [Display(Name = "类型")]
public string Type { get; set; } public string Type { get; set; }
@ -38,5 +39,10 @@ public class MesNoteEditInput : SfsStoreCreateOrUpdateInputBase
/// </summary> /// </summary>
[Display(Name = "明细列表")] [Display(Name = "明细列表")]
public List<MesNoteDetailInput> Details { get; set; } public List<MesNoteDetailInput> Details { get; set; }
#endregion #endregion
} }

17
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/DTOs/InjectioModelPlanDTO.cs

@ -2,6 +2,7 @@ using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -10,6 +11,22 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
/// </summary> /// </summary>
public class InjectioModelPlanDTO : SfsStoreRequestDTOBase<InjectioModelPlanDetailDTO>, IHasNumber public class InjectioModelPlanDTO : SfsStoreRequestDTOBase<InjectioModelPlanDetailDTO>, IHasNumber
{ {
[ExporterHeader(DisplayName = "状态")]
public EnumInjectionModelStatus Status { get; set; }
[ExporterHeader(DisplayName = "版本号")]
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary> /// <summary>
/// 车间 /// 车间
/// </summary> /// </summary>

15
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/Inputs/InjectioModelPlanEditInput.cs

@ -1,7 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -67,6 +69,19 @@ public class InjectioModelPlanEditInput : SfsStoreRequestCreateOrUpdateInputBase
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Number { get; set; } public string Number { get; set; }
[Display(Name = "状态")]
public EnumInjectionModelStatus Status { get; set; }
[Display(Name = "版本号")]
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary> /// <summary>
/// 明细列表 /// 明细列表
/// </summary> /// </summary>

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDTO.cs

@ -5,9 +5,9 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ThirdLocationRequestDTO : SfsStoreRequestDTOBase<ThirdLocationRequestDetailDTO>, IHasNumber public class ThirdLocationRequestDTO : SfsStoreRequestDTOBase<ThirdLocationRequestDetailDTO>, IHasNumber
{ {
/// <summary> /// <summary>
/// 叫料类型 /// 类型
/// </summary> /// </summary>
[Display(Name = "叫料类型")] [Display(Name = "类型")]
public string Type { get; set; } public string Type { get; set; }
/// <summary> /// <summary>
@ -22,24 +22,5 @@ public class ThirdLocationRequestDTO : SfsStoreRequestDTOBase<ThirdLocationReque
[Display(Name = "是否使用在途库")] [Display(Name = "是否使用在途库")]
public bool IsUseOnTheWayLocation { get; set; } public bool IsUseOnTheWayLocation { get; set; }
/// <summary>
/// 可用来源库位Json集合
/// </summary>
public string FromLocationCodeJsonList { get; set; }
/// <summary>
/// 叫料库位
/// </summary>
public string ToLocationCode { get; set; }
/// <summary>
/// 目标ERP储位
/// </summary>
[Display(Name = "目标ERP储位")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 来源库区
/// </summary>
public string FromLocationArea { get; set; }
} }

29
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs

@ -8,6 +8,30 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ThirdLocationRequestDetailDTO : SfsStoreDetailWithQtyDTOBase public class ThirdLocationRequestDetailDTO : SfsStoreDetailWithQtyDTOBase
{ {
/// <summary>
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
public string ToLocationCode { get; set; }
/// <summary>
/// 目标ERP储位
/// </summary>
[Display(Name = "目标ERP储位")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLocationCode { get; set; }
/// <summary>
/// 来源库区
/// </summary>
[Display(Name = "来源库区")]
public string FromLocationArea { get; set; }
/// <summary> /// <summary>
/// 已发数量 /// 已发数量
/// </summary> /// </summary>
@ -20,11 +44,6 @@ public class ThirdLocationRequestDetailDTO : SfsStoreDetailWithQtyDTOBase
[Display(Name = "已收数量")] [Display(Name = "已收数量")]
public decimal ReceivedQty { get; set; } public decimal ReceivedQty { get; set; }
/// <summary>
/// 明细状态
/// </summary>
[Display(Name = "明细状态")]
public EnumStatus Status { get; set; }
/// <summary> /// <summary>
/// 请求未发 /// 请求未发

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs

@ -72,11 +72,6 @@ public class ThirdLocationRequestDetailInput : SfsStoreDetailWithQtyInputBase
[Display(Name = "已收数量")] [Display(Name = "已收数量")]
public decimal ReceivedQty { get; set; } public decimal ReceivedQty { get; set; }
/// <summary>
/// 明细状态
/// </summary>
[Display(Name = "明细状态")]
public EnumStatus Status { get; set; }
/// <summary> /// <summary>
/// 位置码 /// 位置码

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAppService.cs

@ -8,6 +8,10 @@ using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Domain.Shared;
using Volo.Abp.Domain.Entities;
using static Volo.Abp.Identity.Settings.IdentitySettingNames;
using Volo.Abp.Users;
using Volo.Abp.Domain.Repositories;
namespace Win_in.Sfs.Wms.Store.Application; namespace Win_in.Sfs.Wms.Store.Application;
@ -19,13 +23,14 @@ public class ProductRecycleJobAppService
, IProductRecycleJobAppService , IProductRecycleJobAppService
{ {
private readonly IProductRecycleJobManager _productRecycleJobManager; private readonly IProductRecycleJobManager _productRecycleJobManager;
private readonly IProductRecycleJobRepository _repository;
private readonly IProductRecycleRequestAppService _productRecycleRequestAppService; private readonly IProductRecycleRequestAppService _productRecycleRequestAppService;
public ProductRecycleJobAppService( public ProductRecycleJobAppService(
IProductRecycleJobRepository repository, IProductRecycleJobManager productRecycleJobManager, IProductRecycleJobRepository repository, IProductRecycleJobManager productRecycleJobManager,
IProductRecycleRequestAppService productRecycleRequestAppService) IProductRecycleRequestAppService productRecycleRequestAppService)
: base(repository, productRecycleJobManager) : base(repository, productRecycleJobManager)
{ {
_repository = repository;
_productRecycleJobManager = productRecycleJobManager; _productRecycleJobManager = productRecycleJobManager;
_productRecycleRequestAppService = productRecycleRequestAppService; _productRecycleRequestAppService = productRecycleRequestAppService;
} }
@ -55,4 +60,20 @@ public class ProductRecycleJobAppService
var handleDto = ObjectMapper.Map<ProductRecycleJob, ProductRecycleJobDTO>(handleResult); var handleDto = ObjectMapper.Map<ProductRecycleJob, ProductRecycleJobDTO>(handleResult);
return handleDto; return handleDto;
} }
/// <summary>
/// 根据请求号完成任务
/// </summary>
/// <param name="number"></param>
/// <returns></returns>
[HttpPost("complete-by-request-number")]
public async Task<ProductRecycleJobDTO> CompleteByRequestNumberAsync(string number)
{
var entity = await _repository.FirstOrDefaultAsync(r => r.RequestNumber == number).ConfigureAwait(false);
await entity.CompleteAsync(CurrentUser.Id, CurrentUser.Name, Clock.Now).ConfigureAwait(false);
var updatejob = await _repository.UpdateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<ProductRecycleJob, ProductRecycleJobDTO>(updatejob);
return dto;
}
} }

35
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs

@ -35,13 +35,8 @@ public class TransferLibJobAppService
/// <returns></returns> /// <returns></returns>
public override async Task<TransferLibJobDTO> CompleteAsync(Guid id, TransferLibJobDTO dto) public override async Task<TransferLibJobDTO> CompleteAsync(Guid id, TransferLibJobDTO dto)
{ {
var str = "Win_in.Sfs.Wms.Store.Application.InjectionJobAppService"; //var str = "Win_in.Sfs.Wms.Store.Application.InjectionJobAppService";
var implementation=_serviceProvider.GetService(Type.GetType("Win_in.Sfs.Wms.Store.Application.InjectionJobAppService"));
MethodInfo methodInfo=implementation.GetType().GetMethod("Test");
methodInfo.Invoke(implementation, null);
string methodPrefix = "TransferLibJobAppService.CompleteAsync - "; string methodPrefix = "TransferLibJobAppService.CompleteAsync - ";
if (dto.CallServerName.IsNullOrEmpty()) if (dto.CallServerName.IsNullOrEmpty())
{ {
throw new UserFriendlyException($"{methodPrefix}CallServerName 不能为空"); throw new UserFriendlyException($"{methodPrefix}CallServerName 不能为空");
@ -62,18 +57,17 @@ public class TransferLibJobAppService
var ret = await base.CompleteAsync(id, dto).ConfigureAwait(false); var ret = await base.CompleteAsync(id, dto).ConfigureAwait(false);
if (ret != null) if (ret != null)
{ {
var assembly = Assembly.GetExecutingAssembly(); Type ty = Type.GetType(dto.CallServerName);
var ty = assembly.GetType(dto.CallServerName);
if (ty == null) if (ty == null)
{ {
throw new UserFriendlyException($"{methodPrefix}没有找到类型为{dto.CallServerName}的对象"); throw new UserFriendlyException($"{methodPrefix}没有找到类型为{dto.CallServerName}的对象");
} }
var instance = Activator.CreateInstance(ty); var instance = _serviceProvider.GetService(ty);
if (instance == null) if (instance == null)
{ {
throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象创建失败"); throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象创建失败");
} }
ITransferLibCallback transferLibCallback = (ITransferLibCallback)instance; ITransferLibCallback transferLibCallback = (Win_in.Sfs.Wms.Store.Notes.ITransferLibCallback)instance;
if (transferLibCallback == null) if (transferLibCallback == null)
{ {
throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象没有实现ITransferLibCallback接口"); throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象没有实现ITransferLibCallback接口");
@ -83,6 +77,27 @@ public class TransferLibJobAppService
{ {
throw new UserFriendlyException($"{methodPrefix}执行回调服务{dto.CallServerName}出错,返回错误信息:{callbackRet.Item2}"); throw new UserFriendlyException($"{methodPrefix}执行回调服务{dto.CallServerName}出错,返回错误信息:{callbackRet.Item2}");
} }
//var assembly = Assembly.GetExecutingAssembly();
//var ty = assembly.GetType(dto.CallServerName);
//if (ty == null)
//{
// throw new UserFriendlyException($"{methodPrefix}没有找到类型为{dto.CallServerName}的对象");
//}
//var instance = Activator.CreateInstance(ty);
//if (instance == null)
//{
// throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象创建失败");
//}
//ITransferLibCallback transferLibCallback = (ITransferLibCallback)instance;
//if (transferLibCallback == null)
//{
// throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象没有实现ITransferLibCallback接口");
//}
//Tuple<bool?, string> callbackRet = transferLibCallback.DoTransferLibCallback(dto.CallServerName, dto.CallRequestNumber, dto.CallJobNumber);
//if (callbackRet != null && callbackRet.Item1 == false)
//{
// throw new UserFriendlyException($"{methodPrefix}执行回调服务{dto.CallServerName}出错,返回错误信息:{callbackRet.Item2}");
//}
} }
return ret; return ret;
} }

60
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs

@ -1,6 +1,10 @@
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Omu.ValueInjecter;
using Volo.Abp;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
@ -20,11 +24,21 @@ public class CustomerProductionReturnNoteAppService :
{ {
private readonly ICustomerProductionReturnNoteManager _CustomerProductionReturnNoteManager; private readonly ICustomerProductionReturnNoteManager _CustomerProductionReturnNoteManager;
private readonly ICustomerItemAppService _customerItemAppService;
public CustomerProductionReturnNoteAppService( public CustomerProductionReturnNoteAppService(
ICustomerProductionReturnNoteRepository repository ICustomerProductionReturnNoteRepository repository
, ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager , ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager
, ICustomerItemAppService customerItemAppService
) : base(repository) ) : base(repository)
{ {
_customerItemAppService = customerItemAppService;
_CustomerProductionReturnNoteManager = CustomerProductionReturnNoteManager; _CustomerProductionReturnNoteManager = CustomerProductionReturnNoteManager;
} }
@ -38,15 +52,55 @@ public class CustomerProductionReturnNoteAppService :
public override async Task<CustomerProductionReturnNoteDTO> CreateAsync(CustomerProductionReturnNoteEditInput input) public override async Task<CustomerProductionReturnNoteDTO> CreateAsync(CustomerProductionReturnNoteEditInput input)
{ {
var entity = ObjectMapper.Map<CustomerProductionReturnNoteEditInput, CustomerProductionReturnNote>(input); var entity = ObjectMapper.Map<CustomerProductionReturnNoteEditInput, CustomerProductionReturnNote>(input);
var parts= input.Details.Select(itm => itm.ItemCode).Distinct();
var custitmDetail = await _customerItemAppService.GetListByPartsAsync(parts.ToList()).ConfigureAwait(false);
var checkPart= from itm in entity.Details.ToList()
join itm1 in custitmDetail
on itm.ItemCode equals itm1.ItemCode
into temp
from tm in temp.DefaultIfEmpty()
where tm == null
select itm;
var partErr = checkPart.Select(x => x.ItemCode).Distinct().ToList();
if (partErr.Count > 0)
{
throw new UserFriendlyException($"客户零件{string.Join(",",partErr)}不在零件关系表中,不能退货!");
}
var checkCustomer= from itm in entity.Details.ToList()
join itm1 in custitmDetail
on itm.ItemCode equals itm1.ItemCode
select itm1;
var custErr= checkCustomer.Select(x => x.CustomerCode).Distinct().ToList();
if (custErr.Count > 1)
{
throw new UserFriendlyException($"提交客户退货零件{string.Join(",", custErr)}存在多个客户,不能退货!");
}
if(entity.Details.Count>0)
{
entity.CustomerCode = checkCustomer.FirstOrDefault().CustomerCode;
}
foreach (var itm in entity.Details) foreach (var itm in entity.Details)
{ {
itm.FromLocationCode = "HOLD"; itm.FromLocationCode = "OK";
itm.FromStatus = EnumInventoryStatus.OK; itm.FromStatus = EnumInventoryStatus.OK;
itm.ToStatus=EnumInventoryStatus.OK; itm.ToStatus=EnumInventoryStatus.OK;
itm.FromLocationArea = "OK";
itm.FromLocationErpCode= "OK";
itm.FromLot = "NONE";
itm.FromPackingCode = "NONE";
itm.FromWarehouseCode = "OK";
itm.FromLocationGroup = "OK";
itm.FromContainerCode = "OK";
itm.ToContainerCode =string.IsNullOrEmpty(itm.ToContainerCode)? "OK": itm.ToContainerCode;
itm.ToWarehouseCode= string.IsNullOrEmpty(itm.ToWarehouseCode)? "OK": itm.ToContainerCode;
} }
await _CustomerProductionReturnNoteManager.CreateAsync(entity).ConfigureAwait(false); await _CustomerProductionReturnNoteManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<CustomerProductionReturnNote, CustomerProductionReturnNoteDTO>(entity); var dto = ObjectMapper.Map<CustomerProductionReturnNote, CustomerProductionReturnNoteDTO>(entity);
return dto; return dto;

36
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs

@ -83,24 +83,24 @@ public class MesNoteAppService :
#region 添加校验 #region 添加校验
//RecommendBalanceRequestInput rInput = new RecommendBalanceRequestInput(); RecommendBalanceRequestInput rInput = new RecommendBalanceRequestInput();
//rInput.ItemCode = detail.ItemCode; rInput.ItemCode = detail.ItemCode;
//rInput.Locations = new List<string>() { detail.FromLocationCode }; rInput.Locations = new List<string>() { detail.FromLocationCode };
//rInput.Qty = detail.Qty; rInput.Qty = detail.Qty;
//rInput.Statuses = new List<EnumInventoryStatus> { EnumInventoryStatus.OK }; rInput.Statuses = new List<EnumInventoryStatus> { EnumInventoryStatus.OK };
//var balanceLst = await _balanceAppService.GetRecommendBalancesByLocationsAsync(rInput).ConfigureAwait(false); var balanceLst = await _balanceAppService.GetRecommendBalancesByLocationsAsync(rInput).ConfigureAwait(false);
//var first = balanceLst.FirstOrDefault(); var first = balanceLst.FirstOrDefault();
//if (first != null) if (first != null)
//{ {
// if (detail.Qty <= first.Qty) if (detail.Qty <= first.Qty)
// { {
// throw new UserFriendlyException($"库存数量不足"); throw new UserFriendlyException($"库存数量不足");
// } }
//} }
//else else
//{ {
// throw new UserFriendlyException($"库存数量不足"); throw new UserFriendlyException($"库存数量不足");
//} }
#endregion #endregion
} }

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/InjectioModelPlans/InjectioModelPlanAppService.cs

@ -29,24 +29,17 @@ public class InjectioModelPlanAppService :
{ {
private readonly IBomAppService _bomAppService; private readonly IBomAppService _bomAppService;
private readonly IInjectioModelPlanManager _InjectioModelPlanManager; private readonly IInjectioModelPlanManager _InjectioModelPlanManager;
//private readonly IWorkShopAppService _workShopApp;
/* private readonly IProductionLineAppService _productionLineApp*/
//private readonly ITeamAppService _teamApp;
//private readonly IShiftAppService _shiftApp;
public InjectioModelPlanAppService(IInjectioModelPlanRepository repository, public InjectioModelPlanAppService(IInjectioModelPlanRepository repository,
IInjectioModelPlanManager InjectioModelPlanManager IInjectioModelPlanManager InjectioModelPlanManager
, IWorkShopAppService workShopApp , IWorkShopAppService workShopApp
, IBomAppService bomAppService , IBomAppService bomAppService
, IProductionLineAppService productionLineApp , IProductionLineAppService productionLineApp
//, ITeamAppService teamApp
//, IShiftAppService shiftApp
) : base(repository, InjectioModelPlanManager) ) : base(repository, InjectioModelPlanManager)
{ {
//_workShopApp = workShopApp;
//_productionLineApp = productionLineApp;
//_teamApp = teamApp;
//_shiftApp = shiftApp;
_InjectioModelPlanManager = InjectioModelPlanManager; _InjectioModelPlanManager = InjectioModelPlanManager;
_bomAppService=bomAppService; _bomAppService=bomAppService;
base.CreatePolicyName = InjectioModelPlanPermissions.Create; base.CreatePolicyName = InjectioModelPlanPermissions.Create;

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs

@ -248,7 +248,9 @@ public class DeliverRequestAppService :
private async Task SetRequestAutoPropertiesAsync(DeliverRequest entity) private async Task SetRequestAutoPropertiesAsync(DeliverRequest entity)
{ {
//普通件
var transType = EnumTransSubType.Deliver_Standard; var transType = EnumTransSubType.Deliver_Standard;
//jis件
if (entity.DeliverRequestType == EnumDeliverRequestType.FIS) if (entity.DeliverRequestType == EnumDeliverRequestType.FIS)
{ {
transType = EnumTransSubType.Deliver_FIS; transType = EnumTransSubType.Deliver_FIS;

24
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs

@ -20,6 +20,7 @@ using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -44,6 +45,8 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
private readonly IProductionLineAppService _productionLineAppService; private readonly IProductionLineAppService _productionLineAppService;
private readonly IInjectionJobAppService _issueJobAppService; private readonly IInjectionJobAppService _issueJobAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService; private readonly ITransactionTypeAppService _transactionTypeAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly IBalanceAppService _balanceAppService;
public ThirdLocationRequestAppService( public ThirdLocationRequestAppService(
IThirdLocationRequestRepository repository, IThirdLocationRequestRepository repository,
@ -55,6 +58,8 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
IItemBasicAppService itemBasicAppService, IItemBasicAppService itemBasicAppService,
IProductionLineAppService productionLineAppService, IProductionLineAppService productionLineAppService,
ITransactionTypeAppService transactionTypeAppService, ITransactionTypeAppService transactionTypeAppService,
IExpectOutAppService expectOutAppService,
IBalanceAppService balanceAppService,
IInjectionJobAppService issueJobAppService) IInjectionJobAppService issueJobAppService)
: base(repository, thirdLocationRequestManager) : base(repository, thirdLocationRequestManager)
{ {
@ -66,6 +71,8 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
_productionLineAppService = productionLineAppService; _productionLineAppService = productionLineAppService;
_issueJobAppService = issueJobAppService; _issueJobAppService = issueJobAppService;
_transactionTypeAppService = transactionTypeAppService; _transactionTypeAppService = transactionTypeAppService;
_expectOutAppService= expectOutAppService;
_balanceAppService= balanceAppService;
} }
@ -97,6 +104,23 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false); var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detailInput.ItemCode); CheckItemBasic(itemBasicDto, detailInput.ItemCode);
var balanceNums= await _balanceAppService.GetListByLocationCodeAndItemCodeAsync(detailInput.ToLocationCode, detailInput.ItemCode).ConfigureAwait(false);
decimal balanceSum = 0;
foreach (var item in balanceNums)
{
balanceSum += item.Qty;
}
var expectOutNums= await _expectOutAppService.GetListByItemAsync(detailInput.ItemCode).ConfigureAwait(false);
decimal expectOutSum = 0;
foreach (var item in expectOutNums)
{
expectOutSum += item.Qty;
}
decimal realityBalance = balanceSum - expectOutSum;
if (detailInput.Qty> realityBalance)
{
throw new UserFriendlyException($"{detailInput.ItemCode} 物品的库存为 {realityBalance} ,库存不够");
}
detailInput.ProdLine = detailInput.ToLocationCode; detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode; detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs

@ -43,7 +43,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
CreateMap<ThirdLocationRequestImportInput, ThirdLocationRequestDetail>() CreateMap<ThirdLocationRequestImportInput, ThirdLocationRequestDetail>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()
.ForMember(x => x.Status, y => y.MapFrom(t => EnumStatus.Open))
.Ignore(x => x.ToLocationErpCode) .Ignore(x => x.ToLocationErpCode)
.Ignore(x => x.ToWarehouseCode) .Ignore(x => x.ToWarehouseCode)
.Ignore(x => x.ToLocationArea) .Ignore(x => x.ToLocationArea)

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs

@ -20,6 +20,14 @@ public class CustomerProductionReturnNote : SfsStoreAggregateRootBase<CustomerPr
/// </summary> /// </summary>
public string ProductionReturnRequestNumber { get; set; } public string ProductionReturnRequestNumber { get; set; }
/// <summary>
///客户编码
/// </summary>
public string CustomerCode { get; set; }
/// <summary> /// <summary>
/// 退料时间 /// 退料时间
/// </summary> /// </summary>

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/MesNotes/MesNote.cs

@ -1,11 +1,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store.Types; using Win_in.Sfs.Shared.Domain.Shared.Enums.Store.Types;
namespace Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary> /// <summary>
/// 报废记录 /// MES冻结记录
/// </summary> /// </summary>
public class MesNote : SfsStoreAggregateRootBase<MesNoteDetail>, IHasJobNumber public class MesNote : SfsStoreAggregateRootBase<MesNoteDetail>, IHasJobNumber
{ {
@ -22,7 +23,7 @@ public class MesNote : SfsStoreAggregateRootBase<MesNoteDetail>, IHasJobNumber
public string MesRequestNumber { get; set; } public string MesRequestNumber { get; set; }
/// <summary> /// <summary>
/// Mes类型 /// Mes类型(40-冻结、41-解冻 )
/// </summary> /// </summary>
[IgnoreUpdate] [IgnoreUpdate]
public string Type { get; set; } public string Type { get; set; }

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/InjectioModelPlans/InjectioModelPlan.cs

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Domain;
@ -41,6 +42,18 @@ public class InjectioModelPlan : SfsStoreRequestAggregateRootBase<InjectioModelP
/// </summary> /// </summary>
public DateTime PlanTime { get; set; } public DateTime PlanTime { get; set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary>
/// 状态
/// </summary>
public EnumInjectionModelStatus Status { get; set; }
/// <summary> /// <summary>
/// 明细列表 /// 明细列表
/// </summary> /// </summary>

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs

@ -47,10 +47,10 @@ public class ThirdLocationRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasT
// /// <summary> /// <summary>
// /// 在途库库位 /// 在途库库位
// /// </summary> /// </summary>
// public string OnTheWayLocationCode { get; set; } public string OnTheWayLocationCode { get; set; }
/// <summary> /// <summary>
/// 生产线 /// 生产线
@ -77,10 +77,7 @@ public class ThirdLocationRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasT
/// </summary> /// </summary>
public decimal ReceivedQty { get; set; } public decimal ReceivedQty { get; set; }
/// <summary>
/// 明细状态
/// </summary>
public EnumStatus Status { get; set; }
/// <summary> /// <summary>
/// 请求未发 还未发送的数量 /// 请求未发 还未发送的数量

77
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs

@ -73,48 +73,49 @@ public class ThirdLocationRequestManager
private void SetMaterialRequestDetailStatus(ThirdLocationRequestDetail detail) private void SetMaterialRequestDetailStatus(ThirdLocationRequestDetail detail)
{ {
if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数 //if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数
{ //{
detail.Status = EnumStatus.Close; // detail.Status = EnumStatus.Close;
} //}
else //else
{ //{
detail.Status = EnumStatus.Open; // detail.Status = EnumStatus.Open;
} //}
} }
private async Task SetMaterialRequestStatusAsync(ThirdLocationRequest materialRequest) private async Task SetMaterialRequestStatusAsync(ThirdLocationRequest materialRequest)
{ {
if (materialRequest.Details.All(p => p.Status == EnumStatus.Close)) //if (materialRequest.Details.All(p => p.Status == EnumStatus.Close))
{ //{
materialRequest.RequestStatus = EnumRequestStatus.Completed; // materialRequest.RequestStatus = EnumRequestStatus.Completed;
} //}
else //else
{ //{
var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false); // var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false);
if (issueJobs.Count > 0) // if (issueJobs.Count > 0)
{ // {
if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled)) // if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled))
{ // {
if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty)) // if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty))
{ // {
materialRequest.RequestStatus = EnumRequestStatus.Completed; // materialRequest.RequestStatus = EnumRequestStatus.Completed;
} // }
else // else
{ // {
materialRequest.RequestStatus = EnumRequestStatus.Partial; // materialRequest.RequestStatus = EnumRequestStatus.Partial;
} // }
} // }
else // else
{ // {
materialRequest.RequestStatus = EnumRequestStatus.Partial; // materialRequest.RequestStatus = EnumRequestStatus.Partial;
} // }
} // }
else // else
{ // {
materialRequest.RequestStatus = EnumRequestStatus.Partial; // materialRequest.RequestStatus = EnumRequestStatus.Partial;
} // }
} //}
} }
public virtual async Task CompleteAsync(string number) public virtual async Task CompleteAsync(string number)

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteDbContextModelCreatingExtensions.cs

@ -20,6 +20,8 @@ public static class CustomerProductionReturnNoteDbContextModelCreatingExtensions
b.ConfigureSfsStoreBase(); b.ConfigureSfsStoreBase();
//Properties //Properties
b.Property(q => q.JobNumber).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.JobNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.CustomerCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProductionReturnRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.ProductionReturnRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations //Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Plans/InjectioModelPlans/InjectioModelPlanDbContextModelCreatingExtensions.cs

@ -26,6 +26,9 @@ public static class InjectioModelPlanDbContextModelCreatingExtensions
b.Property(q => q.PlanDate).IsRequired(); b.Property(q => q.PlanDate).IsRequired();
b.Property(q => q.PlanTime).IsRequired(); b.Property(q => q.PlanTime).IsRequired();
b.Property(q => q.Version).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations //Relations

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs

@ -48,12 +48,12 @@ public static class ThirdLocationRequestDbContextModelCreatingExtensions
b.Property(q => q.ToLocationGroup).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.ToLocationGroup).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.FromLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromLocationArea).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.FromLocationArea).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.OnTheWayLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ExpiredTime).IsRequired(); b.Property(q => q.ExpiredTime).IsRequired();
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.IssuedQty).HasPrecision(18, 6); b.Property(q => q.IssuedQty).HasPrecision(18, 6);
b.Property(q => q.ReceivedQty).HasPrecision(18, 6); b.Property(q => q.ReceivedQty).HasPrecision(18, 6);
b.Property(q => q.Status).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/NoOkConvertOKNoteAutoMapperProfile.cs

@ -14,10 +14,10 @@ public partial class StoreEventAutoMapperProfile : Profile
.ForMember(x => x.DocNumber, y => y.MapFrom(d => d.Number)) .ForMember(x => x.DocNumber, y => y.MapFrom(d => d.Number))
.Ignore(x => x.SupplierBatch) .Ignore(x => x.SupplierBatch)
.Ignore(x => x.ProduceDate) // .Ignore(x => x.ProduceDate)
.Ignore(x => x.Worker) .Ignore(x => x.Worker)
.Ignore(x => x.ArriveDate) // .Ignore(x => x.ArriveDate)
.Ignore(x => x.ExpireDate) //.Ignore(x => x.ExpireDate)
.Ignore(x => x.ExtraProperties) .Ignore(x => x.ExtraProperties)
.Ignore(x => x.TransType) .Ignore(x => x.TransType)

24
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs

@ -11,6 +11,30 @@ public partial class StoreEventAutoMapperProfile : Profile
{ {
private void ThirdLocationRequestAutoMapperProfile() private void ThirdLocationRequestAutoMapperProfile()
{ {
CreateMap<ThirdLocationRequestDetail, TransferLogEditInput>()
.Ignore(x => x.DocNumber)
.Ignore(x => x.JobNumber)
.Ignore(x => x.Worker)
.Ignore(x => x.TransType)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.TransSubType)
.Ignore(x => x.FromPackingCode)
.Ignore(x => x.ToPackingCode)
.Ignore(x => x.FromLot)
.Ignore(x => x.FromStatus)
.Ignore(x => x.FromWarehouseCode)
.Ignore(x => x.FromLocationGroup)
.Ignore(x => x.FromLocationErpCode)
.Ignore(x => x.FromContainerCode)
.Ignore(x => x.ToLot)
.Ignore(x => x.SupplierBatch)
.Ignore(x => x.ArriveDate)
.Ignore(x => x.ProduceDate)
.Ignore(x => x.ExpireDate)
.Ignore(x => x.ToStatus)
.Ignore(x => x.ToContainerCode)
;
CreateMap<ThirdLocationRequest, ThirdLocationJobEditInput>() CreateMap<ThirdLocationRequest, ThirdLocationJobEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.Number)) .ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.RequestType, y => y.MapFrom(d => d.Type)) .ForMember(x => x.RequestType, y => y.MapFrom(d => d.Type))

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs

@ -37,6 +37,15 @@ public class ThirdLocationJobEventHandler :
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<ThirdLocationJob> eventData) public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<ThirdLocationJob> eventData)
{ {
var entity = eventData.Entity; var entity = eventData.Entity;
entity.CompleteTime = Clock.Now;
entity.JobStatus = EnumJobStatus.Done;
foreach (var detail in eventData.Entity.Details)
{
detail.SetHandledFromRecommend();
}
var thirdLocationNote = await BuildThirdLocationNoteAsync(entity).ConfigureAwait(false); var thirdLocationNote = await BuildThirdLocationNoteAsync(entity).ConfigureAwait(false);
await _thirdLocationNoteAppService.CreateAsync(thirdLocationNote).ConfigureAwait(false); await _thirdLocationNoteAppService.CreateAsync(thirdLocationNote).ConfigureAwait(false);
} }

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs

@ -21,6 +21,7 @@ public class ProductRecycleRequestEventHandler
, ILocalEventHandler<SfsHandledEntityEventData<ProductRecycleRequest>> , ILocalEventHandler<SfsHandledEntityEventData<ProductRecycleRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<ProductRecycleRequest>> , ILocalEventHandler<SfsCreatedEntityEventData<ProductRecycleRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ProductRecycleRequest>>> , ILocalEventHandler<SfsCreatedEntityEventData<List<ProductRecycleRequest>>>
, ILocalEventHandler<SfsAbortedEntityEventData<ProductRecycleRequest>>
{ {
private readonly IProductRecycleJobAppService _productRecycleJobAppService; private readonly IProductRecycleJobAppService _productRecycleJobAppService;
private readonly IProductRecycleNoteAppService _productRecycleNoteApp; private readonly IProductRecycleNoteAppService _productRecycleNoteApp;
@ -50,6 +51,21 @@ public class ProductRecycleRequestEventHandler
} }
/// <summary>
/// 中止
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception>
[UnitOfWork]
public async Task HandleEventAsync(SfsAbortedEntityEventData<ProductRecycleRequest> eventData)
{
var number = eventData.Entity?.Number;
if (!string.IsNullOrEmpty(number))
{
await _productRecycleJobAppService.CompleteByRequestNumberAsync(number).ConfigureAwait(false);
}
}
/// <summary> /// <summary>
/// 创建后 /// 创建后
/// </summary> /// </summary>
@ -278,6 +294,8 @@ public class ProductRecycleRequestEventHandler
return detailInput; return detailInput;
} }
#endregion #endregion

153
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs

@ -1,8 +1,10 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using FluentValidation.Validators; using FluentValidation.Validators;
using IdentityServer4.Models;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Volo.Abp.SettingManagement; using Volo.Abp.SettingManagement;
@ -13,6 +15,7 @@ using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Event.Transactions;
namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest;
@ -30,11 +33,16 @@ public class ThirdLocationRequestEventHandler
private readonly ILocationAppService _locationAppService; private readonly ILocationAppService _locationAppService;
private readonly IBalanceAppService _balanceAppService; private readonly IBalanceAppService _balanceAppService;
private const EnumTransType TransType = EnumTransType.TransferLib;
private readonly ITransferLogAppService _transferLogAppService;
public ThirdLocationRequestEventHandler( public ThirdLocationRequestEventHandler(
IThirdLocationJobAppService thirdLocationJobAppService IThirdLocationJobAppService thirdLocationJobAppService
, IProductionLineAppService productionLineAppService , IProductionLineAppService productionLineAppService
, IThirdLocationRequestManager thirdLocationRequestManager , IThirdLocationRequestManager thirdLocationRequestManager
, ILocationAppService locationAppService , ILocationAppService locationAppService
, ITransferLogAppService transferLogAppService
, IBalanceAppService balanceAppService) , IBalanceAppService balanceAppService)
{ {
_thirdLocationJobAppService = thirdLocationJobAppService; _thirdLocationJobAppService = thirdLocationJobAppService;
@ -42,6 +50,7 @@ public class ThirdLocationRequestEventHandler
_thirdLocationRequestManager = thirdLocationRequestManager; _thirdLocationRequestManager = thirdLocationRequestManager;
_locationAppService = locationAppService; _locationAppService = locationAppService;
_balanceAppService = balanceAppService; _balanceAppService = balanceAppService;
_transferLogAppService = transferLogAppService;
} }
/// <summary> /// <summary>
@ -88,8 +97,108 @@ public class ThirdLocationRequestEventHandler
{ {
await _thirdLocationJobAppService.CreateManyAsync(thirdLocationJobs).ConfigureAwait(false); await _thirdLocationJobAppService.CreateManyAsync(thirdLocationJobs).ConfigureAwait(false);
} }
//来源库位更新为在途库位
var transferLogs = new List<TransferLogEditInput>();
var route = entity.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false));
await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
private async Task<List<TransferLogEditInput>> BuildTransferLogsAsync(ThirdLocationRequest thirdLocationRequest, EnumTransferRoute route)
{
var transferLogs = new List<TransferLogEditInput>();
foreach (var detail in thirdLocationRequest.Details.Where(detail => detail.Qty != 0))
{
var transferLog = ObjectMapper.Map<ThirdLocationRequestDetail, TransferLogEditInput>(detail);
LocationDTO fromLocationDTO = null;
LocationDTO toLocationDTO = null;
var transportLocation = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
if (transportLocation != null)
{
detail.OnTheWayLocationCode = transportLocation.Code;
}
else
{
throw new UserFriendlyException($"未获取到在途库代码");
}
if (thirdLocationRequest.UseOnTheWayLocation)
{
var location = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
switch (route)
{
case EnumTransferRoute.SourceToOnTheWay:
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
break;
case EnumTransferRoute.OnTheWayToDestination:
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
await RemovePackingCodeAndContainerCodeAndLotAsync(transferLog).ConfigureAwait(false);
break;
case EnumTransferRoute.SourceToDestination:
default:
throw new ArgumentOutOfRangeException(nameof(route), route, null);
}
}
else
{
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
}
transferLog.FromLocationCode = fromLocationDTO.Code;
transferLog.FromLocationArea = fromLocationDTO.AreaCode;
transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode;
transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode;
transferLog.FromWarehouseCode = fromLocationDTO.WarehouseCode;
transferLog.ToLocationCode = toLocationDTO.Code;
transferLog.ToLocationArea = toLocationDTO.AreaCode;
transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode;
transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode;
transferLog.ToWarehouseCode = toLocationDTO.WarehouseCode;
transferLog.TransSubType = Enum.Parse<EnumTransSubType>(thirdLocationRequest.Type);
transferLog.TransType = TransType;
transferLog.DocNumber = thirdLocationRequest.Number;
transferLog.JobNumber = "";
transferLog.FromPackingCode = "";
transferLog.FromLot = "";
transferLog.ToPackingCode = "";
transferLog.ToLot = "";
transferLog.FromStatus = EnumInventoryStatus.OK;
transferLog.ToStatus = EnumInventoryStatus.OK;
transferLogs.Add(transferLog);
}
return transferLogs;
} }
private async Task RemovePackingCodeAndContainerCodeAndLotAsync(TransferLogEditInput transferLogCreateInput)
{
transferLogCreateInput.ToPackingCode = "";
transferLogCreateInput.ToLot = "";
transferLogCreateInput.ToContainerCode = "";
transferLogCreateInput.FromPackingCode = "";
transferLogCreateInput.FromLot = "";
transferLogCreateInput.FromContainerCode = "";
}
/// <summary> /// <summary>
/// 驳回后 /// 驳回后
/// </summary> /// </summary>
@ -147,38 +256,12 @@ public class ThirdLocationRequestEventHandler
jobs.Add(job); jobs.Add(job);
} }
job.Details.AddRange(jobDetails); job.Details.AddRange(jobDetails);
if (thirdLocationRequestDetail.ToBeIssuedQty < 0)
{
thirdLocationRequestDetail.Status = EnumStatus.Close;
}
} }
jobs = jobs.Where(p => p.Details.Any()).ToList(); jobs = jobs.Where(p => p.Details.Any()).ToList();
var openRequestDetails =
thirdLocationRequest.Details.Where(p => p.Status != EnumStatus.Close).ToList();
if (!openRequestDetails.Any())
{
return jobs;
}
var enableMultipleCreateThirdLocationJob = await SettingManager.IsTrueAsync(StoreSettings.MaterialRequest.EnableMultipleCreateIssueJob).ConfigureAwait(false);
if (enableMultipleCreateThirdLocationJob)
{
//thirdLocationRequest.Partial();
}
else
{
var sb = new StringBuilder();
foreach (var openRequestDetail in openRequestDetails)
{
sb.AppendLine($"{openRequestDetail.ItemCode}请求数量 {openRequestDetail.Qty},可用库存数量 {openRequestDetail.IssuedQty}");
}
throw new UserFriendlyException($"{sb} 可用库存数量不足, 无法生成发料任务");
}
return jobs; return jobs;
} }
@ -245,7 +328,7 @@ public class ThirdLocationRequestEventHandler
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false); //ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
var detail = ObjectMapper.Map<BalanceDTO, ThirdLocationJobDetailInput>(balance); var detail = ObjectMapper.Map<BalanceDTO, ThirdLocationJobDetailInput>(balance);
detail.FromLocationCode = thirdLocationRequestDetail.FromLocationCode;
detail.WorkStation = thirdLocationRequestDetail.WorkStation; detail.WorkStation = thirdLocationRequestDetail.WorkStation;
detail.ExpiredTime = thirdLocationRequestDetail.ExpiredTime; detail.ExpiredTime = thirdLocationRequestDetail.ExpiredTime;
detail.PositionCode = thirdLocationRequestDetail.PositionCode; detail.PositionCode = thirdLocationRequestDetail.PositionCode;
@ -271,7 +354,19 @@ public class ThirdLocationRequestEventHandler
detail.ToLocationErpCode = thirdLocationRequestDetail.ToLocationErpCode; detail.ToLocationErpCode = thirdLocationRequestDetail.ToLocationErpCode;
detail.ToLocationArea = thirdLocationRequestDetail.ToLocationArea; detail.ToLocationArea = thirdLocationRequestDetail.ToLocationArea;
detail.ToWarehouseCode = thirdLocationRequestDetail.ToWarehouseCode; detail.ToWarehouseCode = thirdLocationRequestDetail.ToWarehouseCode;
detail.FromLocationArea = thirdLocationRequestDetail.FromLocationArea;
var transportLocation = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
if (transportLocation != null)
{
detail.FromLocationCode = transportLocation.Code;
detail.FromLocationArea = transportLocation.AreaCode;
}
else
{
throw new UserFriendlyException($"未获取到在途库代码");
}
//detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code; //detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
detail.ProdLine = toLocationGroupCode; detail.ProdLine = toLocationGroupCode;

57
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/MesNoteEventHandler.cs

@ -19,7 +19,9 @@ public class MesNoteEventHandler
, ILocalEventHandler<SfsCreatedEntityEventData<List<MesNote>>> , ILocalEventHandler<SfsCreatedEntityEventData<List<MesNote>>>
{ {
private const EnumTransType TransType = EnumTransType.Scrap; //private const EnumTransType FreezedTransType = EnumTransType.MesFreezed;
//private const EnumTransType UnFreezedTransType = EnumTransType.MesUnFreezed;
[UnitOfWork] [UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<MesNote> eventData) public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<MesNote> eventData)
@ -53,9 +55,6 @@ public class MesNoteEventHandler
//{ //{
var transferLogs = new List<TransferLogEditInput>(); var transferLogs = new List<TransferLogEditInput>();
foreach (var MesNote in MesNotes) foreach (var MesNote in MesNotes)
{ {
@ -63,24 +62,26 @@ public class MesNoteEventHandler
} }
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
var transactions = new List<TransactionEditInput>(); //var transactions = new List<TransactionEditInput>();
foreach (var MesNote in MesNotes) //foreach (var MesNote in MesNotes)
{ //{
transactions.AddRange(BuildTransactions(MesNote)); // transactions.AddRange(BuildTransactions(MesNote));
} //}
await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false); //await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false);
//} //}
} }
private List<TransferLogEditInput> BuildTransferLogs(MesNote MesNote) private List<TransferLogEditInput> BuildTransferLogs(MesNote MesNote)
{ {
var transferLogs = new List<TransferLogEditInput>(); var transferLogs = new List<TransferLogEditInput>();
foreach (var detail in MesNote.Details.Where(detail => detail.Qty != 0)) foreach (var detail in MesNote.Details.Where(detail => detail.Qty != 0))
{ {
var transferLog = ObjectMapper.Map<MesNoteDetail, TransferLogEditInput>(detail); var transferLog = ObjectMapper.Map<MesNoteDetail, TransferLogEditInput>(detail);
transferLog.TransType = TransType; transferLog.TransType = Enum.Parse<EnumTransType>(MesNote.Type); ;
transferLog.TransSubType = Enum.Parse<EnumTransSubType>(MesNote.Type); transferLog.TransSubType = EnumTransSubType.None;
transferLog.Worker = MesNote.Worker; transferLog.Worker = MesNote.Worker;
transferLog.DocNumber = MesNote.Number; transferLog.DocNumber = MesNote.Number;
transferLog.JobNumber = MesNote.JobNumber; transferLog.JobNumber = MesNote.JobNumber;
@ -90,24 +91,24 @@ public class MesNoteEventHandler
return transferLogs; return transferLogs;
} }
private List<TransactionEditInput> BuildTransactions(MesNote deliverNote) //private List<TransactionEditInput> BuildTransactions(MesNote deliverNote)
{ //{
var transactions = new List<TransactionEditInput>(); // var transactions = new List<TransactionEditInput>();
foreach (var detail in deliverNote.Details) // foreach (var detail in deliverNote.Details)
{ // {
var transaction = ObjectMapper.Map<MesNoteDetail, TransactionEditInput>(detail); // var transaction = ObjectMapper.Map<MesNoteDetail, TransactionEditInput>(detail);
transaction.TransType = TransType; // transaction.TransType = deliverNote.Type;
transaction.TransInOut = EnumTransInOut.Out; // transaction.TransInOut = EnumTransInOut.Out;
transaction.Worker = deliverNote.Worker; // transaction.Worker = deliverNote.Worker;
transaction.DocNumber = deliverNote.Number; // transaction.DocNumber = deliverNote.Number;
transaction.JobNumber = deliverNote.JobNumber; // transaction.JobNumber = deliverNote.JobNumber;
transactions.Add(transaction); // transactions.Add(transaction);
} // }
return transactions; // return transactions;
} //}
#endregion #endregion
} }

166
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Event.Transaction;
namespace Win_in.Sfs.Wms.Store.Event.Transactions;
public class ThirdLocationNoteEventHandler
: StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<ThirdLocationNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ThirdLocationNote>>>
, ILocalEventHandler<SfsConfirmedEntityEventData<ThirdLocationNote>>
{
private const EnumTransType TransType = EnumTransType.TransferLib;
private readonly ILocationAppService _locationAppService;
private readonly IThirdLocationRequestManager _thirdLocationRequestManager;
public ThirdLocationNoteEventHandler(ILocationAppService locationAppService
, IThirdLocationRequestManager thirdLocationRequestManager)
{
_locationAppService = locationAppService;
_thirdLocationRequestManager = thirdLocationRequestManager;
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<ThirdLocationNote> eventData)
{
var entity = eventData.Entity;
var transferLogs = new List<TransferLogEditInput>();
var route = EnumTransferRoute.OnTheWayToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false));
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
if (!string.IsNullOrEmpty(entity.RequestNumber))
{
var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
await _thirdLocationRequestManager.CompleteAsync(thirdLocationRequest).ConfigureAwait(false);
}
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<ThirdLocationNote>> eventData)
{
var entities = eventData.Entity;
var transferLogs = new List<TransferLogEditInput>();
//如果要做库存事务汇总,可以修改此处
foreach (var thirdLocationNote in entities)
{
var route = EnumTransferRoute.OnTheWayToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(thirdLocationNote, route).ConfigureAwait(false));
}
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData<ThirdLocationNote> eventData)
{
var entity = eventData.Entity;
var inputList = await BuildTransferLogsAsync(entity, EnumTransferRoute.OnTheWayToDestination).ConfigureAwait(false);
await AddTransferLogsAsync(inputList).ConfigureAwait(false);
}
private async Task AddTransferLogsAsync(List<TransferLogEditInput> inputList)
{
var transferLogs = new List<TransferLogEditInput>();
transferLogs.AddRange(inputList);
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
private async Task<List<TransferLogEditInput>> BuildTransferLogsAsync(ThirdLocationNote thirdLocationNote, EnumTransferRoute route)
{
var transferLogs = new List<TransferLogEditInput>();
foreach (var detail in thirdLocationNote.Details.Where(detail => detail.Qty != 0))
{
var transferLog = ObjectMapper.Map<ThirdLocationNoteDetail, TransferLogEditInput>(detail);
LocationDTO fromLocationDTO = null;
LocationDTO toLocationDTO = null;
if (thirdLocationNote.UseOnTheWayLocation)
{
var location = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
switch (route)
{
case EnumTransferRoute.SourceToOnTheWay:
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
break;
case EnumTransferRoute.OnTheWayToDestination:
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
await RemovePackingCodeAndContainerCodeAndLotAsync(transferLog).ConfigureAwait(false);
break;
case EnumTransferRoute.SourceToDestination:
default:
throw new ArgumentOutOfRangeException(nameof(route), route, null);
}
}
else
{
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
}
transferLog.FromLocationCode = fromLocationDTO.Code;
transferLog.FromLocationArea = fromLocationDTO.AreaCode;
transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode;
transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode;
transferLog.ToLocationCode = toLocationDTO.Code;
transferLog.ToLocationArea = toLocationDTO.AreaCode;
transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode;
transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode;
transferLog.TransSubType = Enum.Parse<EnumTransSubType>(thirdLocationNote.RequestType);
transferLog.TransType = TransType;
transferLog.DocNumber = thirdLocationNote.Number;
transferLog.JobNumber = thirdLocationNote.JobNumber;
transferLog.FromPackingCode = "";
transferLog.FromLot = "";
transferLog.ToPackingCode = "";
transferLog.ToLot = "";
transferLog.FromStatus = EnumInventoryStatus.OK;
transferLog.ToStatus = EnumInventoryStatus.OK;
transferLogs.Add(transferLog);
}
return transferLogs;
}
private async Task RemovePackingCodeAndContainerCodeAndLotAsync(TransferLogEditInput transferLogCreateInput)
{
transferLogCreateInput.ToPackingCode = "";
transferLogCreateInput.ToLot = "";
transferLogCreateInput.ToContainerCode = "";
transferLogCreateInput.FromPackingCode = "";
transferLogCreateInput.FromLot = "";
transferLogCreateInput.FromContainerCode = "";
}
}
Loading…
Cancel
Save